Skip to content

Commit

Permalink
Merge pull request #169 from topazus/fix-cmake
Browse files Browse the repository at this point in the history
Use GNUInstallDirs; Fix install location of CMake config files; include CMakeFindDependencyMacro module
  • Loading branch information
yixuan authored Jul 27, 2024
2 parents 5d77867 + fd72b5a commit 931af5c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
10 changes: 5 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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(
Expand All @@ -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)
Expand Down
1 change: 1 addition & 0 deletions cmake/spectra-config.cmake.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
@PACKAGE_INIT@

include(CMakeFindDependencyMacro)
find_dependency (Eigen3 CONFIG)

if(NOT TARGET Spectra::Spectra)
Expand Down

0 comments on commit 931af5c

Please sign in to comment.