Skip to content

Commit

Permalink
Merge branch 'yixuan:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
lformaggia authored Aug 17, 2024
2 parents ecea75d + 931af5c commit c853f87
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ An optional CMake installation is supported, if you have CMake with at least v3.
```bash
mkdir build && cd build
cmake .. -DCMAKE_INSTALL_PREFIX='intended installation directory' -DCMAKE_PREFIX_PATH='path where the installation of Eigen3 can be found' -DBUILD_TESTS=TRUE
make all && make tests && make install
make all && make test && make install
```

By installing **Spectra** in this way, you also create a CMake target `Spectra::Spectra` that can be used in subsequent build procedures for other programs.
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 c853f87

Please sign in to comment.