[CMake] get_directory_property and get_property

James Bigler jamesbigler at gmail.com
Thu Apr 17 19:06:48 EDT 2014


Thanks Petr.

I wonder what the point of get_property(foo VARIABLE PROPERTY bar) is if it
is equivalent to set(foo ${bar}).  It just seems like the weirdest feature
to add.


On Thu, Apr 17, 2014 at 2:10 AM, Petr Kmoch <petr.kmoch at gmail.com> wrote:

> Hi James.
>
> Quoting the docs at http://www.cmake.org/cmake/help/v2.8.12/cmake.html:
>
> """
>
> get_property(<variable>
>
>                <GLOBAL             |
>                 DIRECTORY [dir]    |
> ...
>
> DIRECTORY scope defaults to the current directory but another directory
> (already processed by CMake) may be named by full or relative path.
>
> ...
>
> VARIABLE scope is unique and does not accept a name.
>
> """
>
>
> When you pass VARIABLE as the argument, it will query the value/setness/definedness of the variable specified by 'PROPERTY name'.
>
>  So in effect:
>
> get_property(foo VARIABLE PROPERTY bar)
>
> is equivalent to
>
>
> set(foo ${bar})
>
> Hope this helps.
>
> Petr
>
>
>
> On Wed, Apr 16, 2014 at 9:35 PM, James Bigler <jamesbigler at gmail.com>wrote:
>
>> I see that I can get the value of a variable from a directory using:
>>
>> get_directory_property(sub1_val1 DIRECTORY sub1 DEFINITION val1)
>>
>> Can I do the same thing with get_property?
>>
>> I see a VARIABLE entry, but I can't use that with the DIRECTORY
>> indication.
>>
>> By the way what are the properties on VARIABLE that can be queried?  I
>> don't see any documentation for this question.
>>
>> get_property(... VARIABLE PROPERTY ???)
>>
>> Thanks,
>> James
>>
>> --
>>
>> Powered by www.kitware.com
>>
>> Please keep messages on-topic and check the CMake FAQ at:
>> http://www.cmake.org/Wiki/CMake_FAQ
>>
>> Kitware offers various services to support the CMake community. For more
>> information on each offering, please visit:
>>
>> CMake Support: http://cmake.org/cmake/help/support.html
>> CMake Consulting: http://cmake.org/cmake/help/consulting.html
>> CMake Training Courses: http://cmake.org/cmake/help/training.html
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Follow this link to subscribe/unsubscribe:
>> http://www.cmake.org/mailman/listinfo/cmake
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20140417/546fe43f/attachment.html>


More information about the CMake mailing list