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

Juan E. Sanchez juan.e.sanchez at gmail.com
Wed Feb 6 00:16:46 EST 2019


It has been several months since I looked at this.  I seem to remember 
setting dependencies between libraries containing modules, using 
something like target_link_libraries.  I think that cmake was capable of 
detecting dependencies between files in the same library.  I think it 
relied on the use of the USE statement.

I think

Regards,

Juan


On 2/5/19 8:29 PM, Petr Penzin wrote:
> 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.
>>
>>
> 



More information about the CMake mailing list