From 3e1a77116ef07512ed8e7555531d1af6d6f03fea Mon Sep 17 00:00:00 2001 From: Nils Wentzell Date: Tue, 27 Feb 2024 12:06:45 -0500 Subject: [PATCH] [cmake] Consistently use GNUInstallDirs for install commands --- doc/CMakeLists.txt | 2 +- share/CMakeLists.txt | 2 +- share/cmake/CMakeLists.txt | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index 40eb49c..77eb64e 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -74,7 +74,7 @@ endif() # --------------------------------- # Install # --------------------------------- -install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html/ COMPONENT documentation DESTINATION share/doc/${PROJECT_NAME} +install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html/ COMPONENT documentation DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/doc/${PROJECT_NAME} FILES_MATCHING REGEX "\\.(html|pdf|png|gif|jpg|svg|ico|js|xsl|css|py|txt|inv|bib|ttf|woff2|eot|sh)$" PATTERN "_*" diff --git a/share/CMakeLists.txt b/share/CMakeLists.txt index 8d258a5..4a76a47 100644 --- a/share/CMakeLists.txt +++ b/share/CMakeLists.txt @@ -18,7 +18,7 @@ if(NOT IS_SUBPROJECT FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.modulefile ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}vars.sh - DESTINATION share/${PROJECT_NAME} + DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME} ) message(STATUS "*********************************************************************************") diff --git a/share/cmake/CMakeLists.txt b/share/cmake/CMakeLists.txt index dad532b..c845b7b 100644 --- a/share/cmake/CMakeLists.txt +++ b/share/cmake/CMakeLists.txt @@ -4,7 +4,7 @@ install( FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config.cmake ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config-version.cmake - DESTINATION lib/cmake/${PROJECT_NAME} + DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME} ) -install(EXPORT ${PROJECT_NAME}-targets NAMESPACE ${PROJECT_NAME}:: DESTINATION lib/cmake/${PROJECT_NAME}) +install(EXPORT ${PROJECT_NAME}-targets NAMESPACE ${PROJECT_NAME}:: DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME})