On 26. Jul, 2010, at 19:09 , Clifford Yapp wrote:

> Michael,
> 
> Thanks for an interesting reply.  How do you decide what value to put
> in XXX_LIBRARIES?  Is that pulled from the child CMakeLists.txt file
> back into the parent?
> 
> CY
> 
> On Mon, Jul 26, 2010 at 12:46 PM, Michael Wild <[email protected]> wrote:
> 
>> Where build_thirdparty() is a macro that builds the named package (in my 
>> case through ExternalProject_Add) and sets compatibility variables (i.e. the 
>> XXX_INCLUDE_DIR and XXX_LIBRARIES variables). This is possible since you can 
>> always override the cached values of a variable (the reverse is undefined, 
>> however. so be careful). Above code is intentionally a macro, since 
>> otherwise it would be cumbersome to propagate the variables XXX_INCLUDE_DIR 
>> and XXX_LIBRARIES (and similar ones) to the caller scope.
>> 
>> 
>> HTH
>> 
>> Michael


The build_thirdparty macro calls itself other macros, e.g. build_zlib. That one 
"guesses" the output location of the zlib libraries, creates an IMPORTED 
library target and sets XXX_LIBRARIES accordingly.

The problem of finding the output location of external projects has been 
discussed quite a few times, and there is only one really clean, although 
complex and confusing solution: There is one "master" project which only makes 
calls to ExternalProject_Add, even the main project is build as such an 
external project.

Michael
_______________________________________________
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

Reply via email to