On 11/22/2011 02:14 PM, t m wrote:
>> Use the cache only if the values need to be persistent. Otherwise I
>> recommend using a GLOBAL property. See set_property() and get_property().
>>
>> Michael
> 
> Thank you Michael. Looks good. So let me summarize. The workflow
> should looks like follow:
> 
> 1. Top Level  CMakeLists.txt:
> add_subdirectory( foo )
> 
> 2. Level 2 foo/CMakeLists.txt
> set_property ( GLOBAL P_A PROPERTY "some value")

that should read:

set_property(GLOBAL PROPERTY P_A "some value")

> 
> 3. Level 1 CMakeLists.txt
> get_property ( VAR_A GLOBAL PROPERY P_A)
> message (STATUS "VAR_A=${VAR_A})
> 
> is that's right?


Yes, that's about right.

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