It seems that the Fortran_PREPROCESS property is not functioning properly on Linux. The default behavior of CMake on Linux is that source files are not preprocssed and Fortran_PREPROCESS doesn seem to affect this.
I attach a minimal example. Building this on Linux fails because source.f90 has not been preprocessed. I tried setting both the source file version and the target version of Fortran_PREPROCESS to ON but neither works. I also tried it for both Intel Fortran and GNU Fortran.
On Windows using Intel Fortran with Visual Studio it works fine. Here the default behavior is that source files are preprocessed, but I can change that using the Fortran_PREPROCESS property.
I see now that on Linux/UNIX the convention is that source files that must be preprocessed have the extension .F90. Still, I would say it’s undesirable that an explicit instruction to preprocess a source file (i.e. using Fortran_PREPROCESS) is silently ignored because of the extension of the file.
I faced with this issue with “Unix Makefiles” generator. Ninja generator preprocess sources by default,
We’d not to change build generator for this reason only.
Also we’d not rename legacy files for this reason.
It’s wierd that it’s impossible to force preprocessor run with Makefiles generator.
Still no solution?