Change internal flag organization in CMake build to not be global (#2053)
commitcd8e5453fce6942fb24170b2c65bd9d70b432e7a
authorAnthony Islas <128631809+islas@users.noreply.github.com>
Mon, 14 Oct 2024 20:40:49 +0000 (14 13:40 -0700)
committerGitHub <noreply@github.com>
Mon, 14 Oct 2024 20:40:49 +0000 (14 13:40 -0700)
tree0f54b9e271f01dc253927fdb1597be0e7ebe4440
parent5ffa840b98f523a020de5a2377d7b2893188007f
Change internal flag organization in CMake build to not be global (#2053)

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
12 files changed:
CMakeLists.txt
chem/CMakeLists.txt
external/CMakeLists.txt
external/io_adios2/CMakeLists.txt
external/io_netcdf/CMakeLists.txt
external/io_netcdfpar/CMakeLists.txt
external/io_pnetcdf/CMakeLists.txt
frame/CMakeLists.txt
hydro/CMakeLists.txt
main/CMakeLists.txt
phys/CMakeLists.txt
tools/CMakeLists.txt