1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
|
# Bring in CMAKE_INSTALL_DATADIR
include(GNUInstallDirs)
# Thrust is a header library; no need to build anything before installing:
set(CMAKE_SKIP_INSTALL_ALL_DEPENDENCY TRUE)
install(DIRECTORY "${Thrust_SOURCE_DIR}/thrust"
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
FILES_MATCHING
PATTERN "*.h"
PATTERN "*.inl"
)
install(DIRECTORY "${Thrust_SOURCE_DIR}/thrust/cmake/"
DESTINATION "${CMAKE_INSTALL_DATADIR}/cmake/thrust"
REGEX .*header-search.cmake.* EXCLUDE
)
# Need to configure a file to store the infix specified in
# CMAKE_INSTALL_INCLUDEDIR since it can be defined by the user
set(install_location "${CMAKE_INSTALL_DATADIR}/cmake/thrust")
configure_file("${Thrust_SOURCE_DIR}/thrust/cmake/thrust-header-search.cmake.in"
"${Thrust_BINARY_DIR}/thrust/cmake/thrust-header-search.cmake"
@ONLY)
install(FILES "${Thrust_BINARY_DIR}/thrust/cmake/thrust-header-search.cmake"
DESTINATION "${install_location}")
|