From d1e26c2b2654635eee162d458e03c5ba98d9d47b Mon Sep 17 00:00:00 2001 From: Robert Maynard Date: Mon, 4 Nov 2024 16:50:27 -0500 Subject: [PATCH] Resolve long standing bug where rapids-cmake overrides kept applying --- rapids-cmake/cpm/package_override.cmake | 4 +--- testing/cpm/cpm_init-override-multiple.cmake | 2 +- testing/cpm/cpm_package_override-multiple.cmake | 4 ++-- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/rapids-cmake/cpm/package_override.cmake b/rapids-cmake/cpm/package_override.cmake index d39e8d7a..4ccf8ce5 100644 --- a/rapids-cmake/cpm/package_override.cmake +++ b/rapids-cmake/cpm/package_override.cmake @@ -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() diff --git a/testing/cpm/cpm_init-override-multiple.cmake b/testing/cpm/cpm_init-override-multiple.cmake index 562f86b7..25851352 100644 --- a/testing/cpm/cpm_init-override-multiple.cmake +++ b/testing/cpm/cpm_init-override-multiple.cmake @@ -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) diff --git a/testing/cpm/cpm_package_override-multiple.cmake b/testing/cpm/cpm_package_override-multiple.cmake index d4fc1f1d..e67e943e 100644 --- a/testing/cpm/cpm_package_override-multiple.cmake +++ b/testing/cpm/cpm_package_override-multiple.cmake @@ -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()