From 8d850803cb12cf92662d21c7946901bb3abe0af8 Mon Sep 17 00:00:00 2001 From: Nils Wentzell Date: Fri, 1 Mar 2024 13:55:33 -0500 Subject: [PATCH 1/2] [cmake] Only use GNUInstallDirs for LIBDIR --- c++/app4triqs/CMakeLists.txt | 2 +- doc/CMakeLists.txt | 2 +- share/CMakeLists.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/c++/app4triqs/CMakeLists.txt b/c++/app4triqs/CMakeLists.txt index 0986bcc..4d12e77 100644 --- a/c++/app4triqs/CMakeLists.txt +++ b/c++/app4triqs/CMakeLists.txt @@ -22,7 +22,7 @@ target_compile_definitions(${PROJECT_NAME}_c PUBLIC # Install library and headers install(TARGETS ${PROJECT_NAME}_c EXPORT ${PROJECT_NAME}-targets DESTINATION ${CMAKE_INSTALL_LIBDIR}) -install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} FILES_MATCHING PATTERN "*.hpp" PATTERN "*.h") +install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} DESTINATION include FILES_MATCHING PATTERN "*.hpp" PATTERN "*.h") # ========= Static Analyzer Checks ========== diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index 77eb64e..40eb49c 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 ${CMAKE_INSTALL_DATAROOTDIR}/doc/${PROJECT_NAME} +install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html/ COMPONENT documentation DESTINATION share/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 4a76a47..8d258a5 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 ${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME} + DESTINATION share/${PROJECT_NAME} ) message(STATUS "*********************************************************************************") From 7bac90fdcba8ab7f7a72a9b198873f1a0b16c564 Mon Sep 17 00:00:00 2001 From: Nils Wentzell Date: Fri, 1 Mar 2024 13:55:40 -0500 Subject: [PATCH 2/2] [cmake] Correct target file inclusion PATH to be absolute --- share/cmake/app4triqs-config.cmake.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/cmake/app4triqs-config.cmake.in b/share/cmake/app4triqs-config.cmake.in index b349060..b6bb5bb 100644 --- a/share/cmake/app4triqs-config.cmake.in +++ b/share/cmake/app4triqs-config.cmake.in @@ -24,7 +24,7 @@ set(@PROJECT_NAME@_ROOT @CMAKE_INSTALL_PREFIX@ CACHE STRING "@PROJECT_NAME@ root #find_dep(depname 1.0) # Include the exported targets of this project -include(@CMAKE_INSTALL_LIBDIR@/cmake/@PROJECT_NAME@/@PROJECT_NAME@-targets.cmake) +include(@CMAKE_INSTALL_FULL_LIBDIR@/cmake/@PROJECT_NAME@/@PROJECT_NAME@-targets.cmake) message(STATUS "Found @PROJECT_NAME@-config.cmake with version @PROJECT_VERSION@, hash = @PROJECT_GIT_HASH@, root = @CMAKE_INSTALL_PREFIX@")