[CMake] Which variable stores all (sub) directories added sofar?
glenn.coombs at gmail.com
Thu May 19 12:06:46 EDT 2011
I think that you can use an environment variable rather than a normal
variable to bypass the normal scoping rules. So:
will I think allow other CMakeFiles to read it using:
regardless of the sub-directory level. I haven't tried using this so it may
not work but I think it should do what you want.
On 19 May 2011 13:05, Eric Noulard <eric.noulard at gmail.com> wrote:
> 2011/5/19 J.S. van Bethlehem <j.s.van.bethlehem at astro.rug.nl>:
> > Hello Eike,
> > Thanks a lot for your reply. I have actually been thinking in the same
> > direction. I have one problem though: how can you make a truly global
> > variable in CMake? Whenever you do something to a variable in a directory
> > that is added using add_subdirectory(), those changes don't propagate to
> > current directory
> > (well, one could use the PARENT_SCOPE option to set() in the
> > but then I won't be able to test that sub-directory seperately because
> > CMake will err that there is no such scope)
> > How do you deal with this?
> I think, that's why Eike uses **property** and not variable.
> Property may be at "GLOBAL" scope:
> set_property(<GLOBAL |
> DIRECTORY [dir] |
> TARGET [target1 [target2 ...]] |
> SOURCE [src1 [src2 ...]] |
> TEST [test1 [test2 ...]] |
> CACHE [entry1 [entry2 ...]]>
> PROPERTY <name> [value1 [value2 ...]])
> Set one property on zero or more objects of a scope. The first
> argument determines the scope in which the property is set. It must
> be one of the following:
> GLOBAL scope is unique and does not accept a name.
> Membre de l'April - « promouvoir et défendre le logiciel libre » -
> Powered by www.kitware.com
> Visit other Kitware open-source projects at
> Please keep messages on-topic and check the CMake FAQ at:
> Follow this link to subscribe/unsubscribe:
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the CMake