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



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.



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/... (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.


Powered by

Please keep messages on-topic and check the CMake FAQ at:

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support:
CMake Consulting:
CMake Training Courses:

Visit other Kitware open-source projects at

Follow this link to subscribe/unsubscribe:

Reply via email to