Skip to content

Include Spectra as a subdirectory in a CMake build#138

Open
cbritopacheco wants to merge 3 commits into
yixuan:masterfrom
cbritopacheco:master
Open

Include Spectra as a subdirectory in a CMake build#138
cbritopacheco wants to merge 3 commits into
yixuan:masterfrom
cbritopacheco:master

Conversation

@cbritopacheco

@cbritopacheco cbritopacheco commented Apr 10, 2022

Copy link
Copy Markdown

Summary

This PR adds support to include Spectra as a subdirectory project via the add_subdirectory call in CMake. For example, the following should add the Spectra::Spectra target to the build tree so it can be linked to further down the line without the need for installation:

# ...
add_subdirectory(third-party/spectra)
find_package (Spectra 1.0.1 REQUIRED)
add_library(MyProject main.cpp)
target_link_libraries(MyProject PUBLIC Spectra::Spectra)

assuming spectra is in the directory third-party/. This should enable Spectra to be utilized as a git submodule.

Notes

The installation behaviour should have remained unchanged. I also added some stuff to the .gitignore.

This commit makes the separation of build-tree and install-tree
explicit. This enables to retain the same installation functionality,
  while adding the functionality for including Spectra as a CMake
  subproject via add_subdirectory.
@cbritopacheco cbritopacheco changed the base branch from develop to master April 10, 2022 17:39
@cbritopacheco cbritopacheco marked this pull request as ready for review April 10, 2022 17:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant