If I have a CMakeLists.txt file:
cmake_minimum_required(VERSION 2.8)
OPTION(FOO "Foo Option" OFF)
MESSAGE("FOO? " ${FOO})
And then I call cmake on it, I get the following output:
FOO? ON
Why is this? Haven't I specified the default for FOO is to be OFF?
Delete CMakeCache.txt from build directory and reload project. This happens because CMake is caching global variables
Try this:
SET(FOO OFF CACHE BOOL "Foo Option")
or
SET(FOO OFF CACHE BOOL "Foo Option" FORCE)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With