wrf-model / WRF

The official repository for the Weather Research and Forecasting (WRF) model
Other
1.18k stars 658 forks source link

Change internal flag organization in CMake build to not be global #2053

Open islas opened 1 month ago

islas commented 1 month ago

TYPE: enhancement

KEYWORDS: cmake, flags, compilation

SOURCE: internal

DESCRIPTION OF CHANGES: Problem: The current iteration of the cmake build places all configuration flags in the global properties of the project. While this works when just building WRF, integration with other projects' cmake builds if placed under WRF pollutes their respective build flags.

Solution: Adjust the layout of the flags to instead carry them in a variable, and prefer using target_* calls for flag usage.

LIST OF MODIFIED FILES: M CMakeLists.txt M chem/CMakeLists.txt M external/CMakeLists.txt M external/io_adios2/CMakeLists.txt M external/io_netcdf/CMakeLists.txt M external/io_netcdfpar/CMakeLists.txt M external/io_pnetcdf/CMakeLists.txt M frame/CMakeLists.txt M main/CMakeLists.txt M phys/CMakeLists.txt M tools/CMakeLists.txt

RELEASE NOTE: Change internal flag organization in CMake build to not be global