2012/10/26 Vyacheslav Karamov <ubuntul...@yandex.ru>:

>
>>> How to handle this situation in a proper way?
>>
>> Define it at the scope it ought to be ?
>> or use
>>   set (snd_lib "sndlib" PARENT_SCOPE)
>>
>> but again I think your problems comes from the fact
>> your defined your var after add_subdirectory.
>>
> PARENT_SCOPE variable is visible only in a parent scope, not in a current
> one. But I need it in current scope, parent scope and scope above parent.

Then I guess you should try to use a global property or cached var.
Some example attached.

As you'll see both mechanism may achieve what you with varying bevahior.
If you want to learn the differences:

cmake --help-command get_property
cmake --help-command set_property
cmake --help-command set
-- 
Erk
Le gouvernement représentatif n'est pas la démocratie --
http://www.le-message.org

Attachment: multi-scope-var-or-props.tgz
Description: GNU Zip compressed data

--

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