1 2 3 4 5
include(CMakeDependentOption) set(FOO "lower") cmake_dependent_option(USE_FOO "Use Foo" ON "FOO MATCHES (UPPER|lower)" OFF) message(STATUS "USE_FOO='${USE_FOO}'")