Skip to content

Commit

Permalink
Fix errors when find_package(CCCL) is called twice. (NVIDIA#1157)
Browse files Browse the repository at this point in the history
  • Loading branch information
alliepiper authored and miscco committed Jan 18, 2024
1 parent 1d3279e commit 6cfc621
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 6cfc621

Please sign in to comment.