On 03/20/2014 04:48 AM, Brian Lewis wrote: > On 2014.03.19, at 07:21, Micha Hergarden wrote: > > Hi, thanks for answering. Could you please elaborate a little? > >> ExternalProject_Add has a DEPENDS option. What you can do is let X >> depend on Y > DEPENDS seems to mean that the external project depends on something > else. If I wanted to make X depend on Y, wouldn't I use > ADD_DEPENDENCIES? > >> and use the CMAKE_CACHE_ARGS option to provide the include path > I don't think I understand how to use CMAKE_CACHE_ARGS. It seems to be a > way to pass information from the calling project to the external project > via a cache. But I need to send information the other way, from the > external project back to the caller. > >> or use the buildsystem in project X to find the headers itself. > I'm not sure how to do this. X would need to spelunk around in Y's > external dependencies, I think? Hello Brian,
Sorry, it seems I didn't understand your question correctly. I was talking about one external project depending on another external project. Say, I have project X which uses Y, and Y is dependant on Z. I could write someting like: ExternalProject_Add( llvm PREFIX ${CMAKE_CURRENT_BINARY_DIR} GIT_REPOSITORY http://llvm.org/git/llvm.git GIT_TAG origin/master DEPENDS clang compiler-rt CMAKE_CACHE_ARGS -DLLVM_INCLUDE_TOOLS:BOOL=ON -DLLVM_INSTALL_TOOLCHAIN_ONLY:BOOL=ON -DLLVM_TARGETS_TO_BUILD:STRING=X86;ARM -DLLVM_EXTERNAL_CLANG_SOURCE_DIR:PATH=${CLANG_SOURCE} -DLLVM_EXTERNAL_COMPILER_RT_SOURCE_DIR:PATH=${COMPILERRT_SOURCE} -DCMAKE_INSTALL_PREFIX:PATH=${TOOLING_DIR} ) Here I have project llvm, which depends on clang downloading first. So my project depends on llvm and clang, and this call makes sure llvm is build with clang. In this case llm does not have its own externalproject_add call to get clang. This may not be the case in your project. Perhaps you can let project y generate a cmake script to pass back to project x? Regards, Micha
signature.asc
Description: OpenPGP digital signature
-- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake