2016-09-28 22:20:42 +03:00
|
|
|
function(TEST variable)
|
|
|
|
if(ARGC GREATER 2)
|
|
|
|
set(i 0)
|
|
|
|
foreach(value IN LISTS ${variable})
|
|
|
|
math(EXPR j "${i} + 1")
|
|
|
|
set(${variable}[${i}] "${value}")
|
|
|
|
TEST(${variable}[${i}] "${ARGV${j}}")
|
|
|
|
set(i ${j})
|
|
|
|
endforeach()
|
2015-12-05 20:57:41 +03:00
|
|
|
else()
|
2016-09-28 22:20:42 +03:00
|
|
|
set(expected "${ARGN}")
|
|
|
|
if("${expected}" STREQUAL "UNDEFINED")
|
|
|
|
if(DEFINED ${variable})
|
|
|
|
message(FATAL_ERROR "'${variable}' shall be undefined but has value '${${variable}}'")
|
|
|
|
endif()
|
|
|
|
elseif("${expected}" STREQUAL "FALSE")
|
|
|
|
if(NOT ${variable} STREQUAL "FALSE")
|
|
|
|
message(FATAL_ERROR "'${variable}' shall be FALSE")
|
|
|
|
endif()
|
|
|
|
elseif("${expected}" STREQUAL "TRUE")
|
|
|
|
if(NOT ${variable} STREQUAL "TRUE")
|
|
|
|
message(FATAL_ERROR "'${variable}' shall be TRUE")
|
|
|
|
endif()
|
|
|
|
else()
|
|
|
|
if(NOT ${variable} STREQUAL "${expected}")
|
|
|
|
message(FATAL_ERROR "'${variable}' shall be '${expected}'")
|
|
|
|
endif()
|
2015-12-05 20:57:41 +03:00
|
|
|
endif()
|
|
|
|
endif()
|
2016-09-28 22:20:42 +03:00
|
|
|
endfunction()
|