Skip to content

Commit

Permalink
cmake: Make installable package relocatable
Browse files Browse the repository at this point in the history
  • Loading branch information
stotko committed May 29, 2020
1 parent 4fd45e4 commit 4598872
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ add_subdirectory(doc)
# Install exported targets and cmake files
install(EXPORT stdgpu-targets
NAMESPACE stdgpu::
DESTINATION "${CMAKE_INSTALL_PREFIX}/${STDGPU_CMAKE_INSTALL_DIR}"
DESTINATION "${STDGPU_CMAKE_INSTALL_DIR}"
COMPONENT stdgpu)

include(CMakePackageConfigHelpers)
Expand All @@ -116,7 +116,7 @@ write_basic_package_version_file("${CMAKE_CURRENT_BINARY_DIR}/stdgpu-config-vers

install(FILES "${CMAKE_CURRENT_BINARY_DIR}/stdgpu-config.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/stdgpu-config-version.cmake"
DESTINATION "${CMAKE_INSTALL_PREFIX}/${STDGPU_CMAKE_INSTALL_DIR}"
DESTINATION "${STDGPU_CMAKE_INSTALL_DIR}"
COMPONENT stdgpu)


Expand Down
8 changes: 4 additions & 4 deletions src/stdgpu/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ add_subdirectory(${STDGPU_BACKEND_DIRECTORY})
# Export targets and install header files
install(TARGETS stdgpu
EXPORT stdgpu-targets
DESTINATION "${CMAKE_INSTALL_PREFIX}/${STDGPU_LIB_INSTALL_DIR}"
DESTINATION "${STDGPU_LIB_INSTALL_DIR}"
COMPONENT stdgpu)

install(DIRECTORY "${STDGPU_INCLUDE_LOCAL_DIR}/" "${STDGPU_BUILD_INCLUDE_DIR}/"
DESTINATION ${CMAKE_INSTALL_PREFIX}/${STDGPU_INCLUDE_INSTALL_DIR}
DESTINATION "${STDGPU_INCLUDE_INSTALL_DIR}"
COMPONENT stdgpu
FILES_MATCHING
PATTERN "*.h"
Expand All @@ -89,9 +89,9 @@ configure_file("${stdgpu_SOURCE_DIR}/cmake/stdgpu-dependencies.cmake.in"
@ONLY)

install(FILES "${STDGPU_BUILD_CMAKE_DIR}/stdgpu-dependencies.cmake"
DESTINATION "${CMAKE_INSTALL_PREFIX}/${STDGPU_CMAKE_INSTALL_DIR}"
DESTINATION "${STDGPU_CMAKE_INSTALL_DIR}"
COMPONENT stdgpu)

install(FILES "${stdgpu_SOURCE_DIR}/cmake/Findthrust.cmake"
DESTINATION "${CMAKE_INSTALL_PREFIX}/${STDGPU_CMAKE_INSTALL_DIR}"
DESTINATION "${STDGPU_CMAKE_INSTALL_DIR}"
COMPONENT stdgpu)
2 changes: 1 addition & 1 deletion src/stdgpu/cuda/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ target_link_libraries(stdgpu PUBLIC CUDA::cudart)

# Install custom CUDA module
install(FILES "${stdgpu_SOURCE_DIR}/cmake/${STDGPU_BACKEND_DIRECTORY}/FindCUDAToolkit.cmake"
DESTINATION "${CMAKE_INSTALL_PREFIX}/${STDGPU_CMAKE_INSTALL_DIR}/${STDGPU_BACKEND_DIRECTORY}"
DESTINATION "${STDGPU_CMAKE_INSTALL_DIR}/${STDGPU_BACKEND_DIRECTORY}"
COMPONENT stdgpu)
2 changes: 1 addition & 1 deletion src/stdgpu/hip/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ target_link_options(stdgpu PUBLIC ${STDGPU_DEVICE_LINK_FLAGS})

# Install custom thrust module
install(FILES "${stdgpu_SOURCE_DIR}/cmake/${STDGPU_BACKEND_DIRECTORY}/Findthrust.cmake"
DESTINATION "${CMAKE_INSTALL_PREFIX}/${STDGPU_CMAKE_INSTALL_DIR}/${STDGPU_BACKEND_DIRECTORY}"
DESTINATION "${STDGPU_CMAKE_INSTALL_DIR}/${STDGPU_BACKEND_DIRECTORY}"
COMPONENT stdgpu)

0 comments on commit 4598872

Please sign in to comment.