Skip to content

Commit

Permalink
Warn when override packages use a name casing that is wrong compared …
Browse files Browse the repository at this point in the history
…to defaults
  • Loading branch information
robertmaynard committed Oct 24, 2024
1 parent 95fe56f commit 657fd55
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions rapids-cmake/cpm/detail/load_preset_versions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ function(rapids_cpm_load_preset_versions)
if(NOT already_exists)
set_property(GLOBAL PROPERTY rapids_cpm_${normalized_pkg_name}_json "${data}")
set_property(GLOBAL PROPERTY rapids_cpm_${normalized_pkg_name}_json_file "${filepath}")

set_property(GLOBAL PROPERTY rapids_cpm_${normalized_pkg_name}_proper_name "${package_name}")
endif()
endforeach()

Expand Down
7 changes: 7 additions & 0 deletions rapids-cmake/cpm/package_override.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,13 @@ function(rapids_cpm_package_override _rapids_override_filepath)
continue()
endif()

# Warn if our name all lower case matches a default package, but our
# case sensitive names doesn't ( ABC vs abc )
get_property(package_proper_name GLOBAL PROPERTY rapids_cpm_${normalized_pkg_name}_proper_name)
if(package_proper_name AND NOT package_proper_name STREQUAL package_name)
message(AUTHOR_WARNING "RAPIDS-CMake is assuming the override ${package_name} is meant for the ${package_proper_name} package. For correctness please use the correctly cased name")
endif()

# only add the first override for a project we encounter
string(JSON data GET "${json_data}" packages "${package_name}")
set_property(GLOBAL PROPERTY rapids_cpm_${normalized_pkg_name}_override_json "${data}")
Expand Down

0 comments on commit 657fd55

Please sign in to comment.