2011/5/19 J.S. van Bethlehem <j.s.van.bethle...@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 the > current directory > (well, one could use the PARENT_SCOPE option to set() in the sub-directory, > but then I won't be able to test that sub-directory seperately because then > 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 ...]]> [APPEND] 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. ... -- Erk Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org _______________________________________________ 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