On Wed, 2010-06-30 at 17:51 +0200, Alexander Neundorf wrote: > On Wednesday 30 June 2010, Marcel Loose wrote: > > Hi all, > > > > Is there a way to unset a cache variable, i.e. make it undefined, > > *without* using unset(). > > > > My reason for asking is that my CMake scripts need to be backward > > compatible with every 2.6 version. Unfortunately, unset() was added in a > > patch release (2.6.3 if I recall correctly), so I cannot use it. > > > > The problem is that, though 'set(FOO)' will make FOO undefined, this > > doesn't seem to work for 'set(FOO CACHE INTERNAL "Foo")'. > > Does it really have to be unset or would empty or "FALSE" also do ? > Before 2.6.3 there is no way to get something removed from the cache. > > Alex
I think I could live with using an empty string and then use 'if(VAR MATCHES "^$")', instead of 'if(DEFINED VAR)'. I was just wondering whether I overlooked another way of doing this. Also because setting a non-cached variable to nothing (i.e. set(VAR)), does make VAR undefined. Thanks, Marcel Loose. _______________________________________________ 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
