CMake: make FORCES build configuration target-centered and stop exporting OpenMP
This MR cleans up the FORCES CMake configuration so build options are owned by FORCES itself instead of a shared global helper, updates the vendored cmake/ helper subtree to cmake-fortran-scripts v3.0, aligns CI and documentation with the new option model, and makes OpenMP a private implementation detail of forces.
No Fortran API is changed. The user-visible changes are in CMake configuration and target usage requirements.
What Changed
- Move build configuration to top-level FORCES-owned cache options such as:
FORCES_BUILD_TESTINGFORCES_WITH_COVERAGEFORCES_WITH_NETCDFFORCES_WITH_MPIFORCES_WITH_OpenMPFORCES_WITH_OPTIMIZATIONFORCES_ENABLE_NATIVE
- Remove the old
cmake/compileoptions.cmakeindirection and resolve optional dependencies where they are actually used. - Make testing opt-in through
FORCES_BUILD_TESTINGinstead of relying on genericBUILD_TESTINGhandling. - Keep pFUnit discovery non-fatal and quiet when tests are enabled but
PFUNITis not installed. - Switch coverage setup to target-scoped coverage flags and keep GNU-only validation at configure time.
- Update the vendored
cmake/subtree tocmake-fortran-scriptsv3.0, including newer:CPM.cmakeversion.cmakefortranpreprocessor.cmakeCodeCoverage.cmakeFindYAC.cmakeFindESMF.cmakeFindNetCDF.cmake
- Update
README.md,cmake/README.md, and.gitlab-ci.ymlto document and use the newFORCES_*options. - Change the OpenMP link on
forcesfromPUBLICtoPRIVATE.- This keeps OpenMP available for final link closure of static consumers.
- It stops downstream targets from implicitly inheriting OpenMP compile flags.
- Leave MPI visibility unchanged in this MR.
Impact
- Existing configure commands must use the new
FORCES_*cache variables instead of the old genericCMAKE_*ones. - Tests are no longer configured unless
FORCES_BUILD_TESTING=ON. - Downstream projects linking against
forceswill no longer compile with OpenMP unless they explicitly enable it themselves.