Summary
Prevent the JSON module from unexpectedly changing global CMake variables in parent projects and umbrella builds.
Current behavior
The module sets global variables such as:
CMAKE_CXX_STANDARD;
CMAKE_CXX_STANDARD_REQUIRED;
CMAKE_POSITION_INDEPENDENT_CODE;
CMAKE_RUNTIME_OUTPUT_DIRECTORY.
A submodule should generally express requirements through its targets rather than altering unrelated parent targets.
Expected behavior
The JSON module should use target-scoped configuration wherever possible.
Standalone build defaults may still be configured without polluting umbrella consumers.
Scope
Suggested files
modules/json/CMakeLists.txt
modules/json/examples/CMakeLists.txt
modules/json/tests/CMakeLists.txt
modules/json/benchmarks/CMakeLists.txt
Acceptance criteria
Non-goals
This issue does not include:
- changing the required C++ language version;
- redesigning umbrella CMake;
- altering other modules;
- removing standalone support.
Summary
Prevent the JSON module from unexpectedly changing global CMake variables in parent projects and umbrella builds.
Current behavior
The module sets global variables such as:
CMAKE_CXX_STANDARD;CMAKE_CXX_STANDARD_REQUIRED;CMAKE_POSITION_INDEPENDENT_CODE;CMAKE_RUNTIME_OUTPUT_DIRECTORY.A submodule should generally express requirements through its targets rather than altering unrelated parent targets.
Expected behavior
The JSON module should use target-scoped configuration wherever possible.
Standalone build defaults may still be configured without polluting umbrella consumers.
Scope
target_compile_features()as the public requirement.Suggested files
modules/json/CMakeLists.txtmodules/json/examples/CMakeLists.txtmodules/json/tests/CMakeLists.txtmodules/json/benchmarks/CMakeLists.txtAcceptance criteria
vix::jsonstill requires C++20.Non-goals
This issue does not include: