Skip to content

Enable install in non-top-level projects via NAMESPACE_INSTALL#22

Merged
sean-parent merged 5 commits into
mainfrom
sean-parent/force-install
May 21, 2026
Merged

Enable install in non-top-level projects via NAMESPACE_INSTALL#22
sean-parent merged 5 commits into
mainfrom
sean-parent/force-install

Conversation

@sean-parent
Copy link
Copy Markdown
Member

@sean-parent sean-parent commented May 20, 2026

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}_INSTALL option, 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}_INSTALL option (defaulting to PROJECT_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 (doctest to 2.5.2, doxygen-awesome-css to 2.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.

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.
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ 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.

Comment thread cmake/cpp-library-setup.cmake
- 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.
@sean-parent sean-parent merged commit a64f94d into main May 21, 2026
4 checks passed
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