Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include Spectra as a subdirectory in a CMake build #138

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

cbritopacheco
Copy link

@cbritopacheco cbritopacheco commented Apr 10, 2022

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.

None yet

1 participant