checking a variable for being DEFINED is not considered using it
cmake_minimum_required(VERSION 3.10)
project(foo NONE)
if (NOT DEFINED FOOBAR)
message(STATUS "not foobar")
else ()
message(STATUS "foobar!")
endif ()
cmake -D FOOBAR=baz .
-- foobar!
-- Configuring done
-- Generating done
CMake Warning:
Manually-specified variables were not used by the project:
FOOBAR
-- Build files have been written to: /tmp/