[CMake] Any way to make/fake subdirectories depending on ExternalProject?

kent williams nkwmailinglists at gmail.com
Thu Jan 20 15:19:43 EST 2011


I kinda know the simple answer is 'no.'  I hope there's a creative
*couch*sneaky*cough* way to do this.

I'm trying to build CableSwig as a external project as part of ITK.  I
have this working for a single-process build.  It works in that case
because the ExternalProject_add happens textually before all the
add_subdirectory clauses at the bottom of ITK's top level
CMakeLists.txt file.

If you run a parallel build, CableSwig gets downloaded and built in
parallel with subdirectories that need CableSwig to build, so the
compile fails, obviously.

The problem is that subdirectories aren't targets, and can't depend on
CableSwig.  What I need is a trick to fake out CMake such that it
guarantees the CableSwig subproject get built completely before moving
on into subdirectories.

Any ideas?  Or am I just abusing the very spirit of CMake?


More information about the CMake mailing list