Skip to content

Commit

Permalink
Fix errors when find_package(CCCL) is called twice. (#1157) (#1298)
Browse files Browse the repository at this point in the history
Fixes #1156.

Co-authored-by: Allison Vacanti <[email protected]>
Co-authored-by: Jake Hemstad <[email protected]>
  • Loading branch information
3 people authored Jan 22, 2024
1 parent b354791 commit da0e1f2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/cmake/cccl/cccl-config.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ foreach(component IN LISTS components)
"${cccl_cmake_dir}/.." # Install layout
)

if (TARGET Thrust::Thrust AND NOT CCCL::Thrust)
if (TARGET Thrust::Thrust AND NOT TARGET CCCL::Thrust)
# By default, configure a CCCL::Thrust target with host=cpp device=cuda
option(CCCL_ENABLE_DEFAULT_THRUST_TARGET
"Create a CCCL::Thrust target using CCCL_THRUST_[HOST|DEVICE]_SYSTEM."
Expand Down
2 changes: 2 additions & 0 deletions test/cmake/test_export/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ function(do_find_package pkg_name pkg_prefix)
if (NOT ${pkg_name}_FOUND)
message(FATAL_ERROR "Failed: find_package(${pkg_name} ${arg_str})")
endif()
# Re-execute find_package to ensure that repeated calls don't break:
find_package(${pkg_name} ${arg_list})
endfunction()

# Run find package with the requested configuration:
Expand Down

0 comments on commit da0e1f2

Please sign in to comment.