Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmake: make install path configurable #1174

Merged
merged 5 commits into from
Oct 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 15 additions & 12 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.30.0)
cmake_policy(SET CMP0167 OLD)
endif()

# use gnu standard install directories
include(GNUInstallDirs)

find_package(Kokkos 4.3 REQUIRED CONFIG)
message(STATUS "Found Kokkos: ${Kokkos_DIR} (version \"${Kokkos_VERSION}\")")

Expand Down Expand Up @@ -79,12 +82,12 @@ target_include_directories(ArborX INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src/interpolation>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src/spatial>
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include>
$<INSTALL_INTERFACE:include/ArborX>
$<INSTALL_INTERFACE:include/ArborX/geometry>
$<INSTALL_INTERFACE:include/ArborX/cluster>
$<INSTALL_INTERFACE:include/ArborX/distributed>
$<INSTALL_INTERFACE:include/ArborX/interpolation>
$<INSTALL_INTERFACE:include/ArborX/spatial>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/ArborX>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/ArborX/geometry>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/ArborX/cluster>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/ArborX/distributed>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/ArborX/interpolation>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/ArborX/spatial>
junghans marked this conversation as resolved.
Show resolved Hide resolved
)

install(TARGETS ArborX
Expand All @@ -94,7 +97,7 @@ install(TARGETS ArborX

install(EXPORT ArborXTargets
NAMESPACE ArborX::
DESTINATION lib/cmake/ArborX
DESTINATION ${CMAKE_INSTALL_DATADIR}/cmake/ArborX
)

set(ARBORX_VERSION_STRING "2.0 (dev)")
Expand Down Expand Up @@ -129,7 +132,7 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/ArborXSettings.cmake.in
include(CMakePackageConfigHelpers)
configure_package_config_file(cmake/ArborXConfig.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/ArborXConfig.cmake
INSTALL_DESTINATION lib/cmake/ArborX
INSTALL_DESTINATION ${CMAKE_INSTALL_DATADIR}/cmake/ArborX
)
write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/ArborXConfigVersion.cmake
VERSION ${ARBORX_VERSION_STRING}
Expand All @@ -139,17 +142,17 @@ install(FILES
${CMAKE_CURRENT_BINARY_DIR}/ArborXConfig.cmake
${CMAKE_CURRENT_BINARY_DIR}/ArborXConfigVersion.cmake
${CMAKE_CURRENT_BINARY_DIR}/ArborXSettings.cmake
DESTINATION lib/cmake/ArborX )
DESTINATION ${CMAKE_INSTALL_DATADIR}/cmake/ArborX )

if(ARBORX_ENABLE_MPI)
install(DIRECTORY ${PROJECT_SOURCE_DIR}/src/ DESTINATION include/ArborX
install(DIRECTORY ${PROJECT_SOURCE_DIR}/src/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/ArborX
FILES_MATCHING PATTERN "*.hpp")
else()
install(DIRECTORY ${PROJECT_SOURCE_DIR}/src/ DESTINATION include/ArborX
install(DIRECTORY ${PROJECT_SOURCE_DIR}/src/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/ArborX
FILES_MATCHING PATTERN "*.hpp"
PATTERN "*Distribut*" EXCLUDE)
endif()
install(DIRECTORY ${PROJECT_BINARY_DIR}/include/ DESTINATION include/ArborX
install(DIRECTORY ${PROJECT_BINARY_DIR}/include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/ArborX
FILES_MATCHING PATTERN "*.hpp")

if(NOT CMAKE_BUILD_TYPE)
Expand Down
Loading