[CMake] Howto unset cache variable without UNSET()

Marcel Loose loose at astron.nl
Wed Jun 30 04:38:43 EDT 2010


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")'.

Any ideas how to accomplish this?

Best regards,
Marcel Loose.






More information about the CMake mailing list