-
Notifications
You must be signed in to change notification settings - Fork 757
Update install rules to install cmake into lib directory #1323
Conversation
I was going to suggest something like this, so I like it ;) I think, however, there may be an issue with how thrust is packaged, including, I suspect, internally at Nvidia. That is, the directory structure of this repo is such that one can just copy I do strongly support having the installed cmake files in a standard location where they'll be found. I just can't see a way of achieving this without getting inconsistencies between the installed and uninstalled version of thrust. Maybe a somewhat less confusing way would be to move the |
Our internal CTK packaging scripts don't pick these files up at all at the moment (#1294), so this won't break anything there. I agree that this is the way to go -- leave them where they are in the source tree to have some measure of support for the legacy "just copy the I'll give this a try sometime this week and hopefully get it into 1.11.0 if all goes well. |
dc8759f
to
dfbbd4f
Compare
@kkraus14 @germasch I've updated this (and NVIDIA/cub#217) to work for both source tree and install tree, and added a test to validate the install tree package. If you get a chance to try this out, please let me know if you find any issues. |
@allisonvacanti: This PR works for me, thanks! I kinda like it better to have the config files in diff --git a/cmake/ThrustInstallRules.cmake b/cmake/ThrustInstallRules.cmake
index 31db9142..a69ec78d 100644
--- a/cmake/ThrustInstallRules.cmake
+++ b/cmake/ThrustInstallRules.cmake
@@ -8,13 +8,8 @@ install(DIRECTORY "${Thrust_SOURCE_DIR}/thrust"
PATTERN "*.inl"
)
-# Unfortunately this creates a ton of empty directories, see issue:
-# https://gitlab.kitware.com/cmake/cmake/-/issues/19189
-install(DIRECTORY "${Thrust_SOURCE_DIR}/thrust"
- TYPE LIB
- FILES_MATCHING
- PATTERN "cmake/*.cmake"
- PATTERN "cmake/*.md"
+install(DIRECTORY "${Thrust_SOURCE_DIR}/thrust/cmake/"
+ DESTINATION "lib/cmake/thrust"
)
# Depending on how Thrust is configured, CUB's CMake scripts may or may not be
@@ -29,11 +24,7 @@ if (THRUST_INSTALL_CUB_HEADERS)
PATTERN "*.cuh"
)
- # Unfortunately this creates a ton of empty directories, see issue:
- # https://gitlab.kitware.com/cmake/cmake/-/issues/19189
- install(DIRECTORY "${Thrust_SOURCE_DIR}/dependencies/cub/cub"
- TYPE LIB
- FILES_MATCHING
- PATTERN "cmake/*.cmake"
+ install(DIRECTORY "${Thrust_SOURCE_DIR}/dependencies/cub/cub/cmake/"
+ DESTINATION "lib/cmake/cub"
)
endif() |
That sounds fine to me. I avoided that the first time around because it was clunky to make work with the It looks like CMake also provides the target library path as part of the I'll make the suggested change with the addition of the I agree that switching the |
That sounds great. I was thinking to use GNUInstallDirs to not hardcode the |
dfbbd4f
to
316d791
Compare
It took a bit of refactoring to meet the |
Needed to move some bits around to be able to include GNUInstallDirs, and along the way all of the compiler hacks got moved into their own file.
316d791
to
0cc70ab
Compare
Last push just adjusts the new submodule SHA. All set! |
Fixes #1292
Updates the cmake install rules to install in
lib/thrust/cmake
instead ofinclude/thrust/cmake
as the include folder is not searched in a normalfind_package(Thrust)
call.