On 6. Jul, 2010, at 10:06 , Diablo 666 wrote:

> 
> Hi,
> 
> say I create a list in the top level CMakeLists.txt and call a subdirectory. 
> The subdirectory should add some entries to the list, then the top level 
> should use the full list. How can I accomplish this?
> 
> Best regards,
> Andreas

Either use the PARENT_SCOPE option of the SET() command or, IMHO preferably, 
use a global property like this:

CMakeLists.txt:
###############
set_property(GLOBAL PROPERTY some_super_property val1 val2 val3)
add_subdirectory(subdir)
get_property(some_super_list GLOBAL PROPERTY some_super_property)
message(STATUS "some_super_list = ${some_super_list}")

subdir/CMakeLists.txt:
######################
set_property(GLOBAL APPEND PROPERTY some_super_property val4 val5 val6)


HTH

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