<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<pre>I did see those links on the bug report for Fortran 90 module dependency in subdirectories,
but I am having some kind of XML schema error preventing me from viewing them in Firefox.
If I understand you correctly, you are saying that to generate the module dependencies in my example case,
I would need to do:
/topdir/dir1/src/CMakeLists.txt
add_library(dir1src foo1.f90)
target_link_libraries(dir1src dir2mod)
/topdir/dir2/mod/CMakeLists.txt
add_library(dir2mod foo2.f90)
but this seems odd to me so I am not sure if I am interpreting it correctly. Also, this seems
to suggest that for my same directory dependency generation error I would need to do:
add_library(thefoo foo.f90 foo2.f90 foo3.f90)
target_link_libraries(thefoo thefoo)
which also seems awkward and has not fixed my error in same directory Fortran 90 module dependency checks.
On 3/1/2012 11:21 AM, Matthew Schuchard wrote:
>><i> In particular, I have noticed that CMake cannot do module dependency scanning outside of the current directory/subdirectories.
</i>>><i>
</i>>><i> For example, if /topdir/dir1/src/ has a Fortran file with a dependency on a module built in /topdir/dir2/mod/, CMake will not instruct the module in /dir2/mod/ to be built before the Fortran file in /dir1/src/. This is not necessarily an issue as I can simply instruct CMake to build the /dir2/mod
</i>>><i> directory before the /dir1/src/ directory via add_subdirectory ordering.
</i>
> When scanning dependencies of sources in a given target CMake
> looks at targets to which that target links to find possible
> module providers. If a target uses a module provided by
> another target but does not link to it then the link will
> fail.
>
> It does not matter whether the targets are in the same
> directory or different directories so long as they are
> all handled during a single CMake configuration. The
> case is even covered in the test suite:
>
<a href="http://cmake.org/gitweb?p=cmake.git;a=blob;f=Tests/Fortran/Library/CMakeLists.txt;hb=v2.8.7">> http://cmake.org/gitweb?p=cmake.git;a=blob;f=Tests/Fortran/Library/CMakeLists.txt;hb=v2.8.7</a>
<a href="http://cmake.org/gitweb?p=cmake.git;a=blob;f=Tests/Fortran/Library/a.f90;hb=v2.8.7">> http://cmake.org/gitweb?p=cmake.git;a=blob;f=Tests/Fortran/Library/a.f90;hb=v2.8.7</a>
<a href="http://cmake.org/gitweb?p=cmake.git;a=blob;f=Tests/Fortran/Library/b.f90;hb=v2.8.7">> http://cmake.org/gitweb?p=cmake.git;a=blob;f=Tests/Fortran/Library/b.f90;hb=v2.8.7</a>
<a href="http://cmake.org/gitweb?p=cmake.git;a=blob;f=Tests/Fortran/Executable/CMakeLists.txt;hb=v2.8.7">> http://cmake.org/gitweb?p=cmake.git;a=blob;f=Tests/Fortran/Executable/CMakeLists.txt;hb=v2.8.7</a>
<a href="http://cmake.org/gitweb?p=cmake.git;a=blob;f=Tests/Fortran/Executable/main.f90;hb=v2.8.7">> http://cmake.org/gitweb?p=cmake.git;a=blob;f=Tests/Fortran/Executable/main.f90;hb=v2.8.7</a>
>
> -Brad
</pre>
</body>
</html>