From 985053d945c0be661dfc08756570714b2c98ce8b Mon Sep 17 00:00:00 2001 From: Robert Maynard Date: Fri, 17 Dec 2021 12:09:47 -0500 Subject: [PATCH] Support user defined CMAKE_INSTALL_INCLUDEDIR values --- cmake/CubInstallRules.cmake | 5 ++--- cub/cmake/cub-header-search.cmake.in | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/cmake/CubInstallRules.cmake b/cmake/CubInstallRules.cmake index 2425ce4467..917724dc10 100644 --- a/cmake/CubInstallRules.cmake +++ b/cmake/CubInstallRules.cmake @@ -11,8 +11,7 @@ include(GNUInstallDirs) set(CMAKE_SKIP_INSTALL_ALL_DEPENDENCY TRUE) install(DIRECTORY "${CUB_SOURCE_DIR}/cub" - TYPE INCLUDE - DESTINATION include/${CUB_INSTALL_HEADER_INFIX} + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} FILES_MATCHING PATTERN "*.cuh" ) @@ -24,5 +23,5 @@ install(DIRECTORY "${CUB_SOURCE_DIR}/cub/cmake/" configure_file("${CUB_SOURCE_DIR}/cub/cmake/cub-header-search.cmake.in" "${CUB_BINARY_DIR}/cub/cmake/cub-header-search.cmake" @ONLY) -install(FILE "${CUB_BINARY_DIR}/cub/cmake/cub-header-search.cmake" +install(FILES "${CUB_BINARY_DIR}/cub/cmake/cub-header-search.cmake" DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/cub") diff --git a/cub/cmake/cub-header-search.cmake.in b/cub/cmake/cub-header-search.cmake.in index d99cd7dd36..148586740d 100644 --- a/cub/cmake/cub-header-search.cmake.in +++ b/cub/cmake/cub-header-search.cmake.in @@ -3,6 +3,6 @@ unset(_CUB_VERSION_INCLUDE_DIR CACHE) # Clear old result to force search find_path(_CUB_VERSION_INCLUDE_DIR cub/version.cuh NO_DEFAULT_PATH # Only search explicit paths below: PATHS - ${CMAKE_CURRENT_LIST_DIR}/../../../include/@CUB_INSTALL_HEADER_INFIX@ # Install tree + ${CMAKE_CURRENT_LIST_DIR}/../../../@CMAKE_INSTALL_INCLUDEDIR@ # Install tree ) -set_property(CACHE _CUB_VERSION_INCLUDE_DIR PROPERTY TYPE INTERNAL) \ No newline at end of file +set_property(CACHE _CUB_VERSION_INCLUDE_DIR PROPERTY TYPE INTERNAL)