The manual says "If you need to make your own CMake target depend on an external project use the CMake ADD_DEPENDENCIES command. The target name will be the first argument and the external project <name> will be the second argument."
But it seems kind of lame; it leaves external projects as second-class citizens that need two statements to reference instead of one. Isn't there a way to say "any project that uses ${CMAKE_BINARY_DIR}/prefix/lib/libblort.a dependes on Blort"? More context: I'm happily using ExternalProject_Add to compile something: include(ExternalProject) ExternalProject_Add( Blort SOURCE_DIR ${CMAKE_SOURCE_DIR}/blort INSTALL_DIR ${CMAKE_BINARY_DIR}/prefix CONFIGURE_COMMAND ${CMAKE_SOURCE_DIR}/blort/configure -C --prefix=${CMAKE_BINARY_DIR}/prefix "CFLAGS=-g -O2 -fPIC" ) SET(Blort_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/blort) SET(Blort_LIBRARIES ${CMAKE_BINARY_DIR}/prefix/lib/libblort.a) Works fine... except that doing a "make -j9" with ccache just now, a build failed because libblort.a wasn't made in time. Looks like the code above doesn't end up adding the right dependencies. (Is this related to http://www.cmake.org/Bug/view.php?id=10395 ?) - Dan -- 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