Skip to content

Commit

Permalink
Resolve long standing bug where rapids-cmake overrides kept applying
Browse files Browse the repository at this point in the history
  • Loading branch information
robertmaynard committed Nov 5, 2024
1 parent 8c26daa commit 39ec6f2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
4 changes: 1 addition & 3 deletions rapids-cmake/cpm/package_override.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,7 @@ function(rapids_cpm_package_override _rapids_override_filepath)
foreach(index RANGE ${package_count})
string(JSON package_name MEMBER "${json_data}" packages ${index})
string(TOLOWER "${package_name}" normalized_pkg_name)
get_property(override_exists GLOBAL PROPERTY rapids_cpm_${normalized_pkg_name}_override_json
DEFINED)

get_property(override_exists GLOBAL PROPERTY rapids_cpm_${normalized_pkg_name}_override_json SET)
if(override_exists OR DEFINED CPM_${package_name}_SOURCE)
continue()
endif()
Expand Down
2 changes: 1 addition & 1 deletion testing/cpm/cpm_init-override-multiple.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ include(${rapids-cmake-dir}/cpm/init.cmake)
function(expect_fetch_content_details project expected)
string(TOLOWER ${project} project)
set(internal_fetch_content_var_name "_FetchContent_${project}_savedDetails")
get_property(exists GLOBAL PROPERTY ${internal_fetch_content_var_name} DEFINED)
get_property(exists GLOBAL PROPERTY ${internal_fetch_content_var_name} SET)
if(expected AND NOT exists)
message(FATAL_ERROR "FetchContent expected ${project} doesn't match expected[${exists}!=${expected})")
elseif(NOT expected AND exists)
Expand Down
4 changes: 2 additions & 2 deletions testing/cpm/cpm_package_override-multiple.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ if(NOT tag STREQUAL "my_tag")
endif()

rapids_cpm_package_details(GTest version repository tag shallow exclude)
if(NOT version STREQUAL "3.99")
if(NOT version STREQUAL "2.99")
message(FATAL_ERROR "custom version field was removed. ${version} was found instead")
endif()
if(NOT tag MATCHES "3.99")
if(NOT tag MATCHES "2.99")
message(FATAL_ERROR "custom version field not used when computing git_tag value. ${tag} was found instead")
endif()

Expand Down

0 comments on commit 39ec6f2

Please sign in to comment.