Fortran modules: source/config-specific flags are not using for resolving dependency graphs with Makefiles
In our project, for some sources specific flags are.
set_source_files_properties(SOURCE.F90 PROPERTIES COMPILE_DEFINITIONS FLAG)
This flag is used for choosing which module will be used in the code. Unfortunately, COMPILE_DEFINITIONS
flags are not used when the source code is parsed.
I looked at cmDependFortran.cxx
and noticed that only flags, defined in CMAKE_TARGET_DEFINITIONS_Fortran
are applying. It seems to me, that the following code:
should be repeated in cmDependsFortran::WriteDependencies
before parser
initialization for applying additional flags to each source file separately.