<snip><br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="gmail_quote"><div class="im"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div>
> There will never be an easy way to pull external projects directly into a<br>
> calling project because the external things are not even guaranteed to be on<br>
> disk yet at configure time of said calling project.<br>
<br>
<br>
</div>Yeah, kind of a chicken-egg problem...<br></blockquote><div><br></div></div>
<div>Exactly. That's why we didn't try to solve that problem. If you have a chicken-egg problem to solve, you have to choose starting with a chicken or an egg, thereby alienating approximately 50% of your audience, even if you have good reasons for your choice.</div>
</div></blockquote><div><snip><br><br>I like cake. I like eating it too. Mmmm cake! Cmake may not *know where the third party is when it configures*, but it *knows where it will be*. The build will/could take care of the rest. Correct? The 50% rule is how Bush won the election (alienating half the audience - through Karl Rove tactics)... we all know how that turned out :-) (this is a joke - and is meant as such - don't read too much into it but has a half/50% serious part)<br>
<br> <snip></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="gmail_quote"><div></div><div>So: there is one approach that's sort of a hybrid here, that I'll mention because it might be useful to consider.</div>
<div><br></div><div>You could have a cmake option in your project that builds your project one of two ways: "as usual" or as the final link in a chain of ExternalProject_Add calls. I've done this and I know it works, but it's proprietary and I cannot point you to the source code. This technique, however, does make things hard to think about at times...</div>
<div><br></div><div>Something like this in CMakeLists.txt:</div><div>==================================================</div><div>option(MYPROJ_UBERBUILD "If ON, build all prereqs first, then build me..." ON)</div>
<div>if(uberbuild)</div><div> include(BuildAllViaExternalProject.cmake)</div><div>else()</div><div> include(BuildJustMe.cmake)</div><div>endif()</div><div><br></div><div>And as the last thing inside BuildAllViaExternalProject.cmake:<br>
</div><div>==================================================</div><div>ExternalProject_Add(</div><div> DOWNLOAD_COMMAND ""</div><div> CMAKE_ARGS</div><div> -DMYPROJ_UBERBUILD:BOOL=OFF</div><div> SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}</div>
<div> ...</div><div>)</div><div><br></div><div><br></div><div>The net effect is that a project can build itself as an ExternalProject with the "clever (?)" use of a CMake option....</div><br>
</div></blockquote></div><snip><br><br>Thank you,I will be looking into ExternalProject_Add and will keep this in mind while creating my build tree. <br><br>Brian<br>