build: modularize CMake configuration - #28
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f9dd1ddfe1
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| VERSION ${PROJECT_VERSION} | ||
| COMPATIBILITY SameMinorVersion | ||
| ) | ||
| if(CPP_REQUEST_ENABLE_INSTALL) |
There was a problem hiding this comment.
Skip the package test when install rules are disabled
When CPP_REQUEST_BUILD_TESTS=ON and CPP_REQUEST_ENABLE_INSTALL=OFF—including a subproject that enables tests while retaining the new default of disabled installs—tests/CMakeLists.txt still registers PackageConsumer.InstallAndUse. That test runs cmake --install, then its consumer fails at find_package(cpp_request) because this conditional generated neither the package configuration nor export rules. Guard the package-consumer test with CPP_REQUEST_ENABLE_INSTALL, or prevent this option combination.
Useful? React with 👍 / 👎.
Summary
Refactors the CMake build system into a modular, target-scoped structure while preserving library behavior and existing CI/package workflows.
Project identity
PROJECT_IS_TOP_LEVELis available0.1.0to0.9.0, matching the current development milestoneRoot orchestration
The root
CMakeLists.txtnow acts only as an orchestrator:Modular CMake layout
Adds/normalizes project modules for:
All project helper functions use the
cpp_request_prefix.Target cleanup
internaltocpp_requestcpp_request::cpp_requestas the public build/export targetcpp_request::internalas a compatibility aliasTests / benchmarks / examples
tests/CMakeLists.txtbecomes a test source inventory usingcpp_request_add_test()cpp_request_add_benchmark()cpp_request_add_example()for the upcoming v0.9 examplesBUILD_TESTING=OFFcompatibility by using an explicitly providedBUILD_TESTINGvalue as the default forCPP_REQUEST_BUILD_TESTSPackaging
cmake/modules/install.cmakecmake/templates/cpp_requestConfig.cmake.incpp_request::cpp_requestDeveloper tooling
cpp_request_format/cpp_request_format_checktargetscmake/templates/Doxyfile.inSource-tree hygiene
Normal CMake configure no longer has any path that generates or rewrites
vcpkg.jsonor other source-controlled files. The oldcmake/tools/vcpkg.cmakeand unused vcpkg template wiring are removed.Cleanup
Removes superseded global/legacy modules such as
output.cmake, singular warning/sanitizer/optimization modules, and the invalidcmake/templates/CMakeLists.txtwiring.A
cmake/README.mddocuments the new responsibility boundaries and supported project options.Scope
This is build-system refactoring only. It does not modify HTTP behavior, public C++ API semantics, response framing, networking, or benchmark definitions.