"ExtSubProj" is the name of a custom CMake target. You should be able to: add_dependencies(mylib1 ExtSubProj) add_dependencies(mylib2 ExtSubProj)
And get ExtSubProj should build first before mylib1 and mylib2. (Assuming mylib1 and mylib2 are add_library targets.) Also works with add_executable targets, or other custom targets. HTH, David On Tue, Oct 27, 2009 at 5:56 PM, Dixon, Shane <shane.di...@atmel.com> wrote: > I've created this as an external project: > > ExternalProject_Add( ExtSubProj > URL "${CMAKE_CURRENT_SOURCE_DIR}/MySubProj" > CMAKE_GENERATOR "NMake Makefiles" > CMAKE_ARGS -DEMUL=ON > INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR} ) > > I presume that I can go back later and also configure the project with > CMAKE_GENERATOR "MinGW makefiles" or something that uses gcc when building > in REAL mode. > > Now the only part that I'm not quite sure how to handle is how to make > other targets depend on this one. This should build first before any other > target runs, but I'm not quite sure how to do that. > > > -- > Shane Dixon > Linux Engineer > Atmel Corporation > > > -----Original Message----- > From: cmake-boun...@cmake.org [mailto:cmake-boun...@cmake.org] On Behalf > Of Dixon, Shane > Sent: Tuesday, October 27, 2009 11:39 AM > To: cmake@cmake.org > Subject: [CMake] Strange build environments (MSVC and GCC both) > > I'm trying to work with a vendor's strange build environment that uses > gnumake and several (very annoying) Makefiles. Part of the problem is that > when the environment builds an emulator, it uses the MSVC toolchain. Once > you actually build the real module, it uses gcc so that the object can be > deployed to a linux workstation. > > * How would be the best way to handle this in CMake? > > * Should the two options be two different external projects that I include > in some top-level project? > > * I suppose I could also do something like add execute_process() commands > that build using their toolchain, but how then do I make those commands > become targets? > > > -- > Shane Dixon > Linux Engineer > Atmel Corporation > > _______________________________________________ > 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 > _______________________________________________ > 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 >
_______________________________________________ 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