[CMake] Build only what you need in third party libs

Michael Wild themiwi at gmail.com
Tue Dec 22 11:37:14 EST 2009


On 22. Dec, 2009, at 17:29 , Brian Davis wrote:

> <snip>
> 
>>> There will never be an easy way to pull external projects directly into a
>>>> calling project because the external things are not even guaranteed to
>>> be on
>>>> disk yet at configure time of said calling project.
>>> 
>>> 
>>> Yeah, kind of a chicken-egg problem...
>>> 
>> 
>> 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.
>> 
> <snip>
> 
> 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)

<snip>

No, it can't. When you run the cmake executable (either cmake-gui, cmake or ccmake), CMake does NOT know anything about the external project except what YOU declared. The project hasn't been downloaded, extracted, patched and configured so far, so CMake can't possibly find out which targets that project is going to build. Of course, CMake could do all these steps at configure-time, but that doesn't work nicely either, because every time the user changes the cache, this might re-trigger all of these steps. And it would slow down the configure step considerably.


Michael


More information about the CMake mailing list