<div dir="ltr">I thought that CMake had Fortran submodule support as of 3.8 or 3.10. However, when compiling a single library target with submodules in parallel on macOS with GFortran trunk (or GFortran 7.3) I get:<div><br></div><div>    f951: Fatal Error: Module file 'mylib.smod' has not been generated, either because the module does not contain a MODULE PROCEDURE or there is an error in the module.</div><div>    Compilation terminated</div><div><br></div><div>   make[2]: *** [src/MyLib/CMakeFiles/MyLib.dir/MyLib_implementation.f90.o] Error 1</div><div><br></div><div>So it seems that CMake is not generating a Makefile in such a way that it requires MyLib_interface.f90 containing the interface top level module mylib.mod to be processed/compiled *before* MyLib_interface.f90. Because of this, there is no mylib.mod file generated from MyLib_interface.f90 before MyLib_implementation.f90 is compiled.</div><div><br></div><div>Am I missing something? Is there a way to express this dependency in such a way that CMake will generate a make file that ensures the source files are processed in the correct order, even with `make -j`?</div><div><br></div><div>Thanks,</div><div>Zaak</div><div><br></div><div><div dir="ltr"><div dir="ltr"><div dir="ltr">Izaak "Zaak" Beekman<br><br>------------------------------------------------------------------------------- <br>HPC Scientist<br><a href="http://www.paratools.com/" target="_blank">ParaTools Inc.</a><div dir="ltr">1509 16th St, NW</div><div dir="ltr">Washington, DC 20036</div>mobile: <a href="tel:(917)%20797-3239" value="+19177973239" target="_blank">(917) 797-3239</a><br>-------------------------------------------------------------------------------</div></div></div></div></div>