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.




--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

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

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake

Reply via email to