Enable install in non-top-level projects via NAMESPACE_INSTALL#22
Merged
Conversation
Installation is now enabled if either building as a top-level project or if the `${NAMESPACE}_INSTALL` variable is set to ON. Updated documentation to explain how to enable installation in non-top-level projects, improving support for package managers and advanced workflows.
Introduces a CMake option `${NAMESPACE}_INSTALL` (defaulting to `PROJECT_IS_TOP_LEVEL`) to explicitly enable or disable installation of the library. Updates documentation and refactors install logic to use this option, allowing more flexible control for both top-level and subproject builds.
- Updated doctest dependency version from 2.4.12 to 2.5.2 in cpp-library.cmake. - Improved README.md with additional setup instructions for CPM.cmake and local usage examples. - Refined CI workflow configuration in ci.yml and ci.yml.in to utilize defined action variables for better maintainability. - Updated Doxygen theme dependency version from 2.4.1 to 2.4.2 in cpp-library-docs.cmake. - Added new graph options in Doxyfile.in to control documentation output.
- Updated the condition in the CI workflow configuration to correctly check for Windows OS using `matrix.os` instead of `matrix.config.os`, ensuring proper execution of the MSVC development command.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit cd3d29e. Configure here.
- Updated documentation to specify that installation is controlled by the ${NAMESPACE}_INSTALL variable instead of PROJECT_IS_TOP_LEVEL.
- Removed the TOP_LEVEL argument from the cpp_library_setup function to streamline the setup process.
- Adjusted comments in _cpp_library_setup_core to reflect the new installation logic.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Installation is now enabled if either building as a top-level project or if the ${NAMESPACE}_INSTALL variable is set to ON. Updated documentation to explain how to enable installation in non-top-level projects, improving support for package managers and advanced workflows.
Note
Medium Risk
Changes default installation behavior for downstream/embedded builds by introducing a new
${NAMESPACE}_INSTALLoption, which could affect packaging or consumers expecting prior install rules. Also updates CI/workflow generation and dependency pins, which may cause CI-only regressions if action SHAs/versions are wrong.Overview
Installation is now explicitly controllable via a new
${NAMESPACE}_INSTALLoption (defaulting toPROJECT_IS_TOP_LEVEL)._cpp_library_setup_core()always wires install setup, while_cpp_library_setup_install()early-returns when installation is disabled, enabling installs for non-top-level builds when opted in.CI and dependency hygiene updates: workflow templates now source GitHub Action refs from
cmake/cpp-library-ci.cmake(including Windows MSVC environment setup), README documents CPM installation and the new install toggle, and toolchain deps are bumped (doctestto2.5.2,doxygen-awesome-cssto2.4.2). Doxygen template disables graph generation to reduce output/requirements.Reviewed by Cursor Bugbot for commit 9be8569. Bugbot is set up for automated code reviews on this repo. Configure here.