[CMake] Re: Avoiding convenience libs
Bill Hoffman
bill.hoffman at kitware.com
Thu Apr 19 09:02:37 EDT 2007
Kishore, Jonnalagadda (IE10) wrote:
>> -----Original Message-----
>> From: cmake-bounces+kishore.jonnalagadda=honeywell.com at cmake.org
>> [mailto:cmake-bounces+kishore.jonnalagadda=honeywell.com at cmake.org] On
>> Behalf Of Pascal Fleury
>> Sent: Wednesday, April 18, 2007 3:45 AM
>> To: cmake at cmake.org
>> Subject: Re: [CMake] Re: Avoiding convenience libs
>>
>> On Tuesday 17 April 2007 23:55:44 Matthew Woehlke wrote:
>>
>>> WAG: variables only propogate to children, not siblings (i.e. 'not
>>>
> to
>
>>> later CMakeLists.txt's that are not children)? IOW, try moving your
>>> SET() up to a common parent.
>>>
>> Well, zes, that is what I noticed. But as other things in cmake are
>> clearly "script-like" with a well-defined control flow (including
>>
> dirs,
>
>> if/else, loops, etc), it seems bizarre that the scoping of such
>>
> variables
>
>> is
>> depending on the file hierarchy not the call-tree. Is there a way to
>>
> have
>
>> this vars be visible between siblings ?
>>
>
> Place the variables in CACHE. You could try:
>
> SET(utils_SRCS a.cpp b.cpp CACHE INTERNAL "" FORCE)
>
# GET_DIRECTORY_PROPERTY: Get a property of the directory.
GET_DIRECTORY_PROPERTY(VAR [DIRECTORY dir] property)
Get a property from the Directory. The value of the property is stored
in the variable VAR. If the property is not found, CMake will report an
error. The properties include: VARIABLES, CACHE_VARIABLES, COMMANDS,
MACROS, INCLUDE_DIRECTORIES, LINK_DIRECTORIES, DEFINITIONS,
INCLUDE_REGULAR_EXPRESSION, LISTFILE_STACK, PARENT_DIRECTORY, and
DEFINITION varname. If the DIRECTORY argument is provided then the
property of the provided directory will be retrieved instead of the
current directory. You can only get properties of a directory during or
after it has been traversed by cmake.
-Bill
More information about the CMake
mailing list