From 4bb794f0bce09cad8b2371dd17e17aecc2f5efd3 Mon Sep 17 00:00:00 2001 From: Robert Maynard Date: Thu, 24 Oct 2024 13:01:21 -0400 Subject: [PATCH] Correct lack of var expansion in TOLOWER --- rapids-cmake/cpm/detail/get_default_json.cmake | 2 +- rapids-cmake/cpm/detail/get_override_json.cmake | 2 +- rapids-cmake/cpm/detail/load_preset_versions.cmake | 2 +- rapids-cmake/cpm/package_override.cmake | 3 ++- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/rapids-cmake/cpm/detail/get_default_json.cmake b/rapids-cmake/cpm/detail/get_default_json.cmake index a43f4074..accf5987 100644 --- a/rapids-cmake/cpm/detail/get_default_json.cmake +++ b/rapids-cmake/cpm/detail/get_default_json.cmake @@ -26,7 +26,7 @@ get_default_json #]=======================================================================] function(get_default_json package_name output_variable) list(APPEND CMAKE_MESSAGE_CONTEXT "rapids.cpm.get_default_json") - string(TOLOWER package_name package_name) + string(TOLOWER "${package_name}" package_name) get_property(json_data GLOBAL PROPERTY rapids_cpm_${package_name}_json) set(${output_variable} "${json_data}" PARENT_SCOPE) endfunction() diff --git a/rapids-cmake/cpm/detail/get_override_json.cmake b/rapids-cmake/cpm/detail/get_override_json.cmake index 9e01770c..3496aeae 100644 --- a/rapids-cmake/cpm/detail/get_override_json.cmake +++ b/rapids-cmake/cpm/detail/get_override_json.cmake @@ -26,7 +26,7 @@ get_override_json #]=======================================================================] function(get_override_json package_name output_variable) list(APPEND CMAKE_MESSAGE_CONTEXT "rapids.cpm.get_override_json") - string(TOLOWER package_name package_name) + string(TOLOWER "${package_name}" package_name) get_property(json_data GLOBAL PROPERTY rapids_cpm_${package_name}_override_json) set(${output_variable} "${json_data}" PARENT_SCOPE) endfunction() diff --git a/rapids-cmake/cpm/detail/load_preset_versions.cmake b/rapids-cmake/cpm/detail/load_preset_versions.cmake index 17355f53..a6e764d4 100644 --- a/rapids-cmake/cpm/detail/load_preset_versions.cmake +++ b/rapids-cmake/cpm/detail/load_preset_versions.cmake @@ -77,7 +77,7 @@ function(rapids_cpm_load_preset_versions) # Normalize the names all to lower case. This will allow us to better support overrides with # different package name casing - string(TOLOWER package_name normalized_pkg_name) + string(TOLOWER "${package_name}" normalized_pkg_name) get_property(already_exists GLOBAL PROPERTY rapids_cpm_${normalized_pkg_name}_json SET) if(NOT already_exists) set_property(GLOBAL PROPERTY rapids_cpm_${normalized_pkg_name}_json "${data}") diff --git a/rapids-cmake/cpm/package_override.cmake b/rapids-cmake/cpm/package_override.cmake index 83108d85..d39e8d7a 100644 --- a/rapids-cmake/cpm/package_override.cmake +++ b/rapids-cmake/cpm/package_override.cmake @@ -94,7 +94,7 @@ function(rapids_cpm_package_override _rapids_override_filepath) # cmake-lint: disable=E1120 foreach(index RANGE ${package_count}) string(JSON package_name MEMBER "${json_data}" packages ${index}) - string(TOLOWER package_name normalized_pkg_name) + string(TOLOWER "${package_name}" normalized_pkg_name) get_property(override_exists GLOBAL PROPERTY rapids_cpm_${normalized_pkg_name}_override_json DEFINED) @@ -137,6 +137,7 @@ function(rapids_cpm_package_override _rapids_override_filepath) GIT_TAG ${tag} GIT_SHALLOW ${shallow} ${patch_command} ${exclude_from_all}) + unset(package_proper_name) endforeach() endif() endfunction()