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

Restructure CMakeLists.txt to be suitable for CPM.cmake #111

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

plevold
Copy link

@plevold plevold commented May 4, 2022

First of all, thanks for making this library!

I'm using CMake Package Manager (CPM.cmake) to add libraries like this one to CMake projects. CPM.cmake makes adding external libraries easy when the library has a CMake build system that works
well when added as a subdirectory.

This pull request makes a minor change to the CMake build system so that tests and installation logic are not included when the project is not the root project (i.e. added using add_subdirectory). The advantage of doing this is that projects using this library will not accidentally build and run tests or install files defined by this project.

I'm open to feedback if this doesn't work well with existing CMake workflows.

Don't include tests and installation logic when for example CMake
Package Manager (CPM.cmake) is used to add the project as a
subdirectory.
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