cmake_minimum_required(VERSION 2.6) macro(print var) message(STATUS "${var} = \"${${var}}\"") endmacro(print) set(FOO foo) print(FOO) # gives "foo" find_program(FOO ls) # this line doesn't affect the result at all print(FOO) mark_as_advanced(FOO) # without this line FOO is still "foo" after the next find_program() # with this line it is empty print(FOO) # gives "foo" find_program(FOO ls) # does nothing, since FOO is already valid print(FOO) # gives ""