-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Manually invoke install rules for components (#505)
CCCL's CMake is currently set up to exit early whenever it's added via `add_subdirectory`, which inadvertently prevents the install rules of its components (Thrust/CUB/libcudacxx) from being called. We don't currently have a way to tell CCCL not to do this because preventing that early exit leads to other undesirable outcomes (such as the CCCL::CCCL targets not being created correctly). Therefore, to work around this we must include the various install rule modules directly until this can be fixed upstream in CCCL. In addition, we require a couple of patches to CCCL's CMake so that 1) the correct config files are installed, and 2) so that multiple invocations of `find_package(CCCL)` will work. These patches have already been fixed on the latest CCCL, see NVIDIA/cccl#298 and NVIDIA/cccl#1157. Authors: - Vyas Ramasubramani (https://github.com/vyasr) Approvers: - Bradley Dice (https://github.com/bdice) URL: #505
- Loading branch information
Showing
3 changed files
with
84 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
diff --git a/cub/cmake/CubInstallRules.cmake b/cub/cmake/CubInstallRules.cmake | ||
index d26da438e..a8b3b1940 100644 | ||
--- a/cub/cmake/CubInstallRules.cmake | ||
+++ b/cub/cmake/CubInstallRules.cmake | ||
@@ -12,7 +12,7 @@ install(DIRECTORY "${CUB_SOURCE_DIR}/cub" | ||
|
||
install(DIRECTORY "${CUB_SOURCE_DIR}/cub/cmake/" | ||
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/cub" | ||
- PATTERN *.cmake.in EXCLUDE | ||
+ REGEX "(.*-header-search\.cmake|.*\.cmake\.in)" EXCLUDE | ||
) | ||
# Need to configure a file to store the infix specified in | ||
# CMAKE_INSTALL_INCLUDEDIR since it can be defined by the user | ||
diff --git a/lib/cmake/cccl/cccl-config.cmake b/lib/cmake/cccl/cccl-config.cmake | ||
index 9baebb1b5..d9eeeba50 100644 | ||
--- a/lib/cmake/cccl/cccl-config.cmake | ||
+++ b/lib/cmake/cccl/cccl-config.cmake | ||
@@ -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." | ||
diff --git a/libcudacxx/cmake/libcudacxxInstallRules.cmake b/libcudacxx/cmake/libcudacxxInstallRules.cmake | ||
index f99a5606f..1c1ed5cb0 100644 | ||
--- a/libcudacxx/cmake/libcudacxxInstallRules.cmake | ||
+++ b/libcudacxx/cmake/libcudacxxInstallRules.cmake | ||
@@ -22,7 +22,7 @@ install(DIRECTORY "${libcudacxx_SOURCE_DIR}/include/nv" | ||
# Libcudacxx cmake package | ||
install(DIRECTORY "${libcudacxx_SOURCE_DIR}/lib/cmake/libcudacxx" | ||
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake" | ||
- PATTERN *.cmake.in EXCLUDE | ||
+ REGEX "(.*-header-search\.cmake|.*\.cmake\.in)" EXCLUDE | ||
) | ||
|
||
# Need to configure a file to store CMAKE_INSTALL_INCLUDEDIR | ||
diff --git a/thrust/cmake/ThrustInstallRules.cmake b/thrust/cmake/ThrustInstallRules.cmake | ||
index 0898d3964..54b40e515 100644 | ||
--- a/thrust/cmake/ThrustInstallRules.cmake | ||
+++ b/thrust/cmake/ThrustInstallRules.cmake | ||
@@ -13,7 +13,7 @@ install(DIRECTORY "${Thrust_SOURCE_DIR}/thrust" | ||
|
||
install(DIRECTORY "${Thrust_SOURCE_DIR}/thrust/cmake/" | ||
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/thrust" | ||
- PATTERN *.cmake.in EXCLUDE | ||
+ REGEX "(.*-header-search\.cmake|.*\.cmake\.in)" EXCLUDE | ||
) | ||
# Need to configure a file to store the infix specified in | ||
# CMAKE_INSTALL_INCLUDEDIR since it can be defined by the user |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters