[CMake] Fortran 90 modules not rebuilt
K. Noel Belcourt
kbelco at sandia.gov
Wed Nov 17 14:08:49 EST 2010
On Nov 17, 2010, at 11:18 AM, Brad King wrote:
> On 11/17/2010 12:15 PM, K. Noel Belcourt wrote:
>> On Nov 17, 2010, at 10:02 AM, Brad King wrote:
>>> This tells CMake to print some verbose target dependency
>>> information. I bet it will report "modules" in a non-trivial
>>> connected component with a bunch of other libraries. Please
>>> send me the output.
>>
> The key output is this:
[ snipped a very clear and concise explanation of the problem ]
> The problem is that nothing has told CMake about these
> module-induced dependencies. CMake's Fortran dep scanning
> does not occur until build time which is too late to affect the
> target build order (also it only orders files, not targets).
> The solution is to add a line like
>
> add_dependencies(mylib modules)
>
> for all the libraries whose source files depend on any modules.
> This can probably just be done for all the libraries.
Indeed adding explicit dependencies and updating to 2.8.3 makes it
work even better than I expected. A simple make in a clean project
now builds all modules first, then builds everything else.
Thanks a bunch for the help Brad, you're amazing!
-- Noel
More information about the CMake
mailing list