From 837d8ada7c6ad8438887807b4faf66b02fe3a26b Mon Sep 17 00:00:00 2001 From: Robert Maynard Date: Tue, 1 Jun 2021 11:06:58 -0400 Subject: [PATCH] Install only the same Thrust files that Thrust itself installs Fixes #8397 Recreate thrust's install rules so we don't install extra directories such as `.git`. We can't leverage thrust's install rules as that would break our layout as the cmake files would need to go into something like `lib/cmake/cudf/thirdparty?/lib/cmake/thrust`. This weird path is required as cudf packages a modified version of Thrust and we don't want that to be installed into a default system path. --- cpp/CMakeLists.txt | 10 ---------- cpp/cmake/thirdparty/CUDF_GetThrust.cmake | 18 +++++++++++++++++- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index 015c856d272..131143a4c8d 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -597,16 +597,6 @@ install(DIRECTORY ${CUDF_GENERATED_INCLUDE_DIR}/include/libcudacxx DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/libcudf) -install(DIRECTORY ${Thrust_SOURCE_DIR}/ - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/libcudf/Thrust - PATTERN "*.py" EXCLUDE - PATTERN "benchmark" EXCLUDE - PATTERN "build" EXCLUDE - PATTERN "doc" EXCLUDE - PATTERN "examples" EXCLUDE - PATTERN "test" EXCLUDE - PATTERN "testing" EXCLUDE) - include(CMakePackageConfigHelpers) configure_package_config_file(cmake/cudf-config.cmake.in "${CUDF_BINARY_DIR}/cmake/cudf-config.cmake" diff --git a/cpp/cmake/thirdparty/CUDF_GetThrust.cmake b/cpp/cmake/thirdparty/CUDF_GetThrust.cmake index 343ade8664d..701adaaff9f 100644 --- a/cpp/cmake/thirdparty/CUDF_GetThrust.cmake +++ b/cpp/cmake/thirdparty/CUDF_GetThrust.cmake @@ -35,7 +35,23 @@ function(find_and_configure_thrust VERSION) thrust_create_target(cudf::Thrust FROM_OPTIONS) set(THRUST_LIBRARY "cudf::Thrust" PARENT_SCOPE) - set(Thrust_SOURCE_DIR "${Thrust_SOURCE_DIR}" PARENT_SCOPE) + + include(GNUInstallDirs) + install(DIRECTORY "${Thrust_SOURCE_DIR}/thrust" + DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/libcudf/Thrust/" + FILES_MATCHING + PATTERN "*.h" + PATTERN "*.inl") + install(DIRECTORY "${Thrust_SOURCE_DIR}/dependencies/cub/cub" + DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/libcudf/Thrust/" + FILES_MATCHING + PATTERN "*.cuh") + + install(DIRECTORY "${Thrust_SOURCE_DIR}/thrust/cmake" + DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/libcudf/Thrust/thrust/") + install(DIRECTORY "${Thrust_SOURCE_DIR}/dependencies/cub/cub/cmake" + DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/libcudf/Thrust/cub/") + endfunction() set(CUDF_MIN_VERSION_Thrust 1.12.0)