You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
cmake/Tests/RunCMake/option/CMP0077-SECOND-PASS.cmake

15 lines
514 B

#Verify that when both a cache and local version of a value exist that CMake
#doesn't produce a CMP0077 warning and that we get the expected values.
option(OPT_LOCAL_VAR "TEST_VAR" ON)
set(OPT_LOCAL_VAR FALSE)
option(OPT_LOCAL_VAR "TEST_VAR" ON)
if(OPT_LOCAL_VAR)
message(FATAL_ERROR "option improperly set a cache variable that already exists")
endif()
get_property(_exists_in_cache CACHE OPT_LOCAL_VAR PROPERTY VALUE SET)
if(NOT _exists_in_cache)
message(FATAL_ERROR "value should exist in cache")
endif()