[CMake] Can't open module file *.mod

Petr Penzin penzin.dev at gmail.com
Tue Feb 5 21:29:38 EST 2019


When I ran into the same issue, my workaround was to use file properties 
to set dependencies between files, but I don't think it is very robust 
solution. Would be curious to hear if there is a better way to do it.

Best,

Petr


On 2/5/19 2:55 PM, Guido Giuntoli wrote:
> Hi I have a Fortran project with the following order
>
> src/module_1.f90     (Fortran Modules)
> src/module_2.f90
> src/... (more files)
>
> file(GLOB SOURCES src/*.f90)
> add_executable(MyExec SOURCES)
>
> module_1 depends on module_2 and when is compiling module_1.f90 I get 
> the dependency error :
>
> Fatal Error: Can't open module file ‘module_2.mod’ :for reading at 
> (1):  No existe el fichero o el directorio (*The file does not exist*).
>
> Thanks, Guido.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cmake.org/pipermail/cmake/attachments/20190205/dc200748/attachment.html>


More information about the CMake mailing list