Description
Describe the bug
After rapids-cmake 25.04 updated to CPM 0.40.2 projects that had nvtx3
entries started to fail to build due to nvt3
targets no longer existing.
Before CPM 0.40.2 when a rapids-cmake override exists the following calls occur:
FetchContent_Populate(
nvtx3
GIT_REPOSITORY ${override_repository}
GIT_TAG ${override_tag}
)
FetchContent_Declare(
nvtx3
GIT_REPOSITORY ${repository}
GIT_TAG ${tag}
SOURCE_SUBDIR c
)
FetchContent_GetProperties(nvtx3)
if(NOT nvtx3_POPULATED)
add_subdirectory(${nvtx3_SOURCE_DIR}/${nvtx3_SOURCE_SUBDIR} ${nvtx3_BINARY_DIR})
endif()
The key parts are that CPM would itself track nvtx3_SOURCE_SUBDIR
and call add_subdirectory based on the last value seen by it.
When we switch to CPM 0.40.2 all of that logic has been removed ( due to complying with policy 168 ) and instead FetchContent always handles the call to add_subdirectory
. When FetchContent calls add_subdirectory
it only considers information provided to it in the first FetchContent_Declare
and therefore ignores the SOURCE_SUBDIR
value.
Steps/Code to reproduce bug
Have nvtx3 in a rapids-cmake override file