Add EXTRA_<LANG>FLAGS to CMAKE_<LANG>_FLAGS if the former are not an empty string.
Why?
Strings starting with one (or more) empty spaces are not cached correctly by CMake.
CMAKE_Fortran_FLAGS is (at least on my machine) empty to start with and appending an empty EXTRA_FCFLAGS caused some head-scratching when trying to augment the list of basic flags and caching inside a foreach loop.
Add
EXTRA_<LANG>FLAGS
toCMAKE_<LANG>_FLAGS
if the former are not an empty string.Why? Strings starting with one (or more) empty spaces are not cached correctly by CMake.
CMAKE_Fortran_FLAGS
is (at least on my machine) empty to start with and appending an emptyEXTRA_FCFLAGS
caused some head-scratching when trying to augment the list of basic flags and caching inside aforeach
loop.