Skip to content

Commit

Permalink
Change API as suggested in code review
Browse files Browse the repository at this point in the history
  • Loading branch information
robertmaynard committed Oct 3, 2023
1 parent d61b05a commit 5a67645
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
6 changes: 1 addition & 5 deletions rapids-cmake/export/detail/post_find_package_code.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ has been found successfully.
rapids_export_post_find_package_code((BUILD|INSTALL)
<PackageName>
<code>
(<ExportSetName> | EXPORT_SET [ExportSetName])
EXPORT_SET [ExportSetName]
[CONDITION <variableName>]
)
Expand Down Expand Up @@ -64,10 +64,6 @@ function(rapids_export_post_find_package_code type name code)
set(one_value EXPORT_SET CONDITION)
set(multi_value "")
cmake_parse_arguments(_RAPIDS "${options}" "${one_value}" "${multi_value}" ${ARGN})
# handle when we are given just an export set name and not `EXPORT_SET <name>`
if(_RAPIDS_UNPARSED_ARGUMENTS AND NOT _RAPIDS_COMPONENTS_EXPORT_SET)
set(_RAPIDS_EXPORT_SET ${_RAPIDS_UNPARSED_ARGUMENTS})
endif()
# Early terminate conditions
if(NOT _RAPIDS_EXPORT_SET OR NOT ${_RAPIDS_CONDITION})
return()
Expand Down
6 changes: 3 additions & 3 deletions testing/export/export_package-build-post-find-code.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ include(${rapids-cmake-dir}/export/package.cmake)
include(${rapids-cmake-dir}/export/detail/post_find_package_code.cmake)

rapids_export_package( BUILD FAKE_PACKAGE test_export_set VERSION 22.08)
rapids_export_post_find_package_code( BUILD FAKE_PACKAGE "set(a ON)" test_export_set)
rapids_export_post_find_package_code( BUILD FAKE_PACKAGE "set(a ON)" EXPORT_SET test_export_set)
rapids_export_post_find_package_code( bUILd FAKE_PACKAGE
[=[
set(b ON)
set(c ON)]=] test_export_set)
rapids_export_post_find_package_code(build FAKE_PACKAGE "set(d ON);set(e ON)" test_export_set)
set(c ON)]=] EXPORT_SET test_export_set)
rapids_export_post_find_package_code(build FAKE_PACKAGE "set(d ON);set(e ON)" EXPORT_SET test_export_set)

include(${rapids-cmake-dir}/export/write_dependencies.cmake)
rapids_export_write_dependencies(BUILD test_export_set "${CMAKE_CURRENT_BINARY_DIR}/install_export_set.cmake")
Expand Down
2 changes: 1 addition & 1 deletion testing/export/export_package-install-post-find-code.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ include(${rapids-cmake-dir}/export/package.cmake)
include(${rapids-cmake-dir}/export/detail/post_find_package_code.cmake)

rapids_export_package(INSTALL FAKE_PACKAGE test_export_set VERSION 22.08)
rapids_export_post_find_package_code(INSTALL FAKE_PACKAGE "set(a ON)" test_export_set)
rapids_export_post_find_package_code(INSTALL FAKE_PACKAGE "set(a ON)" EXPORT_SET test_export_set)

get_target_property(install_code rapids_export_install_test_export_set FAKE_PACKAGE_POST_FIND_CODE)
cmake_language(EVAL CODE "${install_code}")
Expand Down

0 comments on commit 5a67645

Please sign in to comment.