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


_______________________________________________
Powered by www.kitware.com

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

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

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

Reply via email to