Just another FYI, if you are using CMake to build a Fortran project that uses submodules and you are using Makefiles as the generator, the build will fail.
Cray introduced a problem and the CMake people haven’t dealt with it. Building with FPM works well, if you don’t have FPM you can use “Ninja” as the backend and it works. I.e. cmake -G “Ninja” ../ and poof, it works well.
More details would be helpful. What version of CMake is the problem? Does the problem occur only with the Cray compiler? I use submodules ubiquitously and collaborated with Kitware on much of their modern Fortran support (mostly by submitting bug reports and feature requests) for more than a decade up to around 2020. CMake handled submodules fine as of the last time I tried, but I haven’t tried it recently.
This is CMake Issue 18925. No one has contributed support for Cray Fortran submodules.
The initial build might work, but AFAIK the dynamically discovered dependencies refer to the wrong .[s]mod file paths so future ninja invocations will rebuild the modules and their consumers every time.