The split technique should be able to help in this scenario as well, because for the second project, which builds the code downloaded by the first project, you can specify a different SOURCE_DIR value... (A sub directory of the first project's source dir, for example.)<br><br>It would be nice if EP stuff were more compose-able. If you have any good ideas for making it so, this and the dev list are the right places to mention them.<br><br><br>D<div><br>On Friday, July 17, 2015, Klaim - Joël Lamotte <<a href="mailto:mjklaim@gmail.com">mjklaim@gmail.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On 17 July 2015 at 20:06, Bradley Lowekamp <span dir="ltr"><<a href="javascript:_e(%7B%7D,'cvml','blowekamp@mail.nih.gov');" target="_blank">blowekamp@mail.nih.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">Hello,<div><br></div><div>David Cole just said the solution in another post.</div><div><br></div><div>You can split the project into two, with the first one being just the download step, the second is the configuration and build. This should allow you to configure the paths for your project correctly.</div><div><br></div></div></blockquote><div><br></div><div>I am not 100% sure that the split can solve this problem too, but I will try it.</div><div><br></div><div>Now that I have the split trick in mind, it seems to match my initial assumption that ExternalProjects should have a "download only" function/macro</div><div>separated from the other steps, so that it is possible to compose complex setup in easier ways than hacking ExternalProjects_Add parametters and using clunky patches.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div></div><div>I need to do this for my project too. Thanks for the question to get me paying attention here, and finding the answer is another post :)</div><div><br></div><div>Brad</div><div><br><div><div><div><div>On Jul 14, 2015, at 5:14 PM, Klaim - Joël Lamotte <<a href="javascript:_e(%7B%7D,'cvml','mjklaim@gmail.com');" target="_blank">mjklaim@gmail.com</a>> wrote:</div><br></div></div><blockquote type="cite"><div><div><div dir="ltr">I am attempting to use ExternalDependencies_Add with the last Protobuf version (v3.0.0) which is in alpha3 (I'm using the master branch actually)[1].<div>If you don't already know: contrary to previous Protobuf version, v3.x provides</div><div>cmake scripts (and also makes CMake's FindProtobuf module unusuable if you build Protobuf using CMake BTW).</div><div><br></div><div>I am having trouble figuring out how to ExternalProject_add work in this case:</div><div>the CMakeFiles.txt is not in the root directory of Protobuf sources, it is in ./cmake/ [2]</div><div>So at build time, after download, I obviously get:</div><div><br></div><div>>CUSTOMBUILD : CMake error : The source directory "blahblah/install_protobuf" does not appear to contain CMakeLists.txt.<br></div><div><br></div><div>I tried several approaches using this as a base:</div><div><div><br></div><div><div>ExternalProject_Add( install_protobuf</div><div>    PREFIX ${NETRUSH_DEPENDENCIES_DIR}/protobuf</div><div>    GIT_REPOSITORY <a href="https://github.com/google/protobuf.git" target="_blank">https://github.com/google/protobuf.git</a></div><div>    GIT_TAG master</div><div>   </div><div>    CMAKE_CACHE_ARGS</div><div>        -DBUILD_TESTING:bool=FALSE</div><div>)</div></div><div><br></div><div><br></div></div><div>I tried setting SOURCE_DIR but failed to make it work mainly because I'm</div><div>not sure what value to set exactly, and </div><div><br></div><div>   SOURCE_DIR cmake</div><div><br></div><div>Does not seem to work.</div><div><br></div><div>I was wondering if there is some args I could pass to CMake using CMAKE_ARGS</div><div>but from the cmake[3] page in the doc I don't see anything that match exactly, or </div><div>I might be misunderstanding something.</div><div><br></div><div>I found this recommandation from Miklos Espak from 8th February 2015:</div><div>"Specify a patch command that creates a toplevel cmake list with one 'add_subdirectory(A)'  line."</div><div><br></div><div>It seems to work, but it also means that the repository is modified, which is something</div><div>I want to avoid. Also it's really a hack for passing the right working directory to cmake.</div><div><br></div><div>Is there a simpler way to do it that I missed?</div><div><br></div><div>Thanks for your time.</div><div><br></div><div>Joël Lamotte</div><div><br></div><div><br></div><div>[1] <a href="https://github.com/google/protobuf" target="_blank">https://github.com/google/protobuf</a></div><div>[2] <a href="https://github.com/google/protobuf/tree/master/cmake" target="_blank">https://github.com/google/protobuf/tree/master/cmake</a></div><div>[3] <a href="http://www.cmake.org/cmake/help/v3.3/manual/cmake.1.html#manual:cmake(1)" target="_blank">http://www.cmake.org/cmake/help/v3.3/manual/cmake.1.html#manual:cmake(1)</a></div></div></div></div>
-- <br><br>Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br><br>Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br><br>Kitware offers various services to support the CMake community. For more information on each offering, please visit:<br><br>CMake Support: <a href="http://cmake.org/cmake/help/support.html" target="_blank">http://cmake.org/cmake/help/support.html</a><br>CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" target="_blank">http://cmake.org/cmake/help/consulting.html</a><br>CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" target="_blank">http://cmake.org/cmake/help/training.html</a><br><br>Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br><br>Follow this link to subscribe/unsubscribe:<br><a href="http://public.kitware.com/mailman/listinfo/cmake" target="_blank">http://public.kitware.com/mailman/listinfo/cmake</a></blockquote></div><br></div></div></blockquote></div><br></div></div>
</blockquote></div>