From fbc9281a9972a626636aae8465c59897c942d8a0 Mon Sep 17 00:00:00 2001 From: Felix Wang Date: Fri, 16 Feb 2024 10:44:44 +0800 Subject: [PATCH 1/3] Use GNUInstallDirs; Fix install location of CMake config files; include CMakeFindDependencyMacro module --- CMakeLists.txt | 10 +++++----- cmake/spectra-config.cmake.in | 1 + 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2dcae13..ac4bde0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -64,16 +64,16 @@ include(GNUInstallDirs) install( TARGETS Spectra EXPORT Spectra-targets - INCLUDES DESTINATION include + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} ) -install(DIRECTORY ${PROJECT_SOURCE_DIR}/include/ DESTINATION include) +install(DIRECTORY ${PROJECT_SOURCE_DIR}/include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) install( EXPORT Spectra-targets FILE Spectra-targets.cmake NAMESPACE Spectra:: - DESTINATION share/spectra/cmake + DESTINATION ${CMAKE_INSTALL_DATADIR}/cmake/Spectra ) # Configure package @@ -83,7 +83,7 @@ include(CMakePackageConfigHelpers) configure_package_config_file( ${PROJECT_SOURCE_DIR}/cmake/spectra-config.cmake.in ${CMAKE_BINARY_DIR}/cmake/spectra-config.cmake - INSTALL_DESTINATION share/spectra/cmake + INSTALL_DESTINATION ${CMAKE_INSTALL_DATADIR}/cmake/Spectra ) write_basic_package_version_file( @@ -96,7 +96,7 @@ install( FILES ${CMAKE_BINARY_DIR}/cmake/spectra-config.cmake ${CMAKE_BINARY_DIR}/cmake/spectra-config-version.cmake - DESTINATION share/spectra/cmake + DESTINATION ${CMAKE_INSTALL_DATADIR}/cmake/Spectra ) find_package(CLANG_FORMAT 9) diff --git a/cmake/spectra-config.cmake.in b/cmake/spectra-config.cmake.in index 10e6725..6cd267a 100644 --- a/cmake/spectra-config.cmake.in +++ b/cmake/spectra-config.cmake.in @@ -1,5 +1,6 @@ @PACKAGE_INIT@ +include(CMakeFindDependencyMacro) find_dependency (Eigen3 CONFIG) if(NOT TARGET Spectra::Spectra) From ec86b782977c8db3483a78b75efe019516e58400 Mon Sep 17 00:00:00 2001 From: Felix Wang Date: Fri, 16 Feb 2024 10:46:28 +0800 Subject: [PATCH 2/3] Use GNUInstallDirs; Fix install location of CMake config files --- cmake/spectra-config.cmake.in | 1 - 1 file changed, 1 deletion(-) diff --git a/cmake/spectra-config.cmake.in b/cmake/spectra-config.cmake.in index 6cd267a..10e6725 100644 --- a/cmake/spectra-config.cmake.in +++ b/cmake/spectra-config.cmake.in @@ -1,6 +1,5 @@ @PACKAGE_INIT@ -include(CMakeFindDependencyMacro) find_dependency (Eigen3 CONFIG) if(NOT TARGET Spectra::Spectra) From fd72b5aff4ddf4981d94b3ce7178a7c2eb36905e Mon Sep 17 00:00:00 2001 From: Felix Wang Date: Fri, 16 Feb 2024 10:47:21 +0800 Subject: [PATCH 3/3] include CMakeFindDependencyMacro module --- cmake/spectra-config.cmake.in | 1 + 1 file changed, 1 insertion(+) diff --git a/cmake/spectra-config.cmake.in b/cmake/spectra-config.cmake.in index 10e6725..6cd267a 100644 --- a/cmake/spectra-config.cmake.in +++ b/cmake/spectra-config.cmake.in @@ -1,5 +1,6 @@ @PACKAGE_INIT@ +include(CMakeFindDependencyMacro) find_dependency (Eigen3 CONFIG) if(NOT TARGET Spectra::Spectra)