Skip to content

Commit

Permalink
Ensure <pkg>_FOUND is set in the generated Find<pkg>.cmake file (#…
Browse files Browse the repository at this point in the history
…266)

Authors:
  - Paul Taylor (https://github.com/trxcllnt)
  - Robert Maynard (https://github.com/robertmaynard)

Approvers:
  - Robert Maynard (https://github.com/robertmaynard)

URL: #266
  • Loading branch information
trxcllnt authored Sep 9, 2022
1 parent 5fb42f7 commit 06cb278
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 0 deletions.
2 changes: 2 additions & 0 deletions rapids-cmake/find/template/find_module.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,12 @@ include(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake)

if(@_RAPIDS_PKG_NAME@_IS_HEADER_ONLY)
find_package_handle_standard_args(@_RAPIDS_PKG_NAME@
FOUND_VAR @_RAPIDS_PKG_NAME@_FOUND
REQUIRED_VARS @_RAPIDS_PKG_NAME@_INCLUDE_DIR
VERSION_VAR @_RAPIDS_VERSION@)
else()
find_package_handle_standard_args(@_RAPIDS_PKG_NAME@
FOUND_VAR @_RAPIDS_PKG_NAME@_FOUND
REQUIRED_VARS @_RAPIDS_PKG_NAME@_LIBRARY @_RAPIDS_PKG_NAME@_INCLUDE_DIR
VERSION_VAR @_RAPIDS_VERSION@)
endif()
Expand Down
7 changes: 7 additions & 0 deletions testing/find/find_generate_module-build/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@ rapids_find_generate_module( RapidsTest

find_package(RapidsTest REQUIRED)

if(NOT RapidsTest_FOUND)
message(FATAL_ERROR "RapidsTest_FOUND should be set to TRUE")
endif()
if(NOT RAPIDSTEST_FOUND)
message(FATAL_ERROR "RAPIDSTEST_FOUND should be set to TRUE")
endif()

if(NOT TARGET RapidsTest::RapidsTest)
message(FATAL_ERROR "RapidsTest target should be generated")
endif()
Expand Down
7 changes: 7 additions & 0 deletions testing/find/find_generate_module-header-only/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ rapids_find_generate_module( RapidsTest

find_package(RapidsTest REQUIRED)

if(NOT RapidsTest_FOUND)
message(FATAL_ERROR "RapidsTest_FOUND should be set to TRUE")
endif()
if(NOT RAPIDSTEST_FOUND)
message(FATAL_ERROR "RAPIDSTEST_FOUND should be set to TRUE")
endif()

if(NOT TARGET RapidsTest::RapidsTest)
message(FATAL_ERROR "RapidsTest target should be generated")
endif()
Expand Down
7 changes: 7 additions & 0 deletions testing/find/find_generate_module-install/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ rapids_find_generate_module( RapidsTest

find_package(RapidsTest REQUIRED)

if(NOT RapidsTest_FOUND)
message(FATAL_ERROR "RapidsTest_FOUND should be set to TRUE")
endif()
if(NOT RAPIDSTEST_FOUND)
message(FATAL_ERROR "RAPIDSTEST_FOUND should be set to TRUE")
endif()

if(NOT TARGET RapidsTest::RapidsTest)
message(FATAL_ERROR "RapidsTest target should be generated")
endif()
Expand Down

0 comments on commit 06cb278

Please sign in to comment.