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.
54 lines
1.2 KiB
54 lines
1.2 KiB
10 years ago
|
set(FOO BAR)
|
||
|
|
||
|
cmake_policy(SET CMP0054 NEW)
|
||
|
|
||
|
function(function_defined_new_called_old)
|
||
|
if(NOT FOO STREQUAL BAR)
|
||
|
message(FATAL_ERROR "The variable should match the string")
|
||
|
endif()
|
||
|
|
||
|
if("FOO" STREQUAL BAR)
|
||
|
message(FATAL_ERROR "The strings should not match")
|
||
|
endif()
|
||
|
endfunction()
|
||
|
|
||
|
macro(macro_defined_new_called_old)
|
||
|
if(NOT FOO STREQUAL BAR)
|
||
|
message(FATAL_ERROR "The variable should match the string")
|
||
|
endif()
|
||
|
|
||
|
if("FOO" STREQUAL BAR)
|
||
|
message(FATAL_ERROR "The strings should not match")
|
||
|
endif()
|
||
|
endmacro()
|
||
|
|
||
|
cmake_policy(SET CMP0054 OLD)
|
||
|
|
||
|
function_defined_new_called_old()
|
||
|
macro_defined_new_called_old()
|
||
|
|
||
|
function(function_defined_old_called_new)
|
||
|
if(NOT FOO STREQUAL BAR)
|
||
|
message(FATAL_ERROR "The variable should match the string")
|
||
|
endif()
|
||
|
|
||
|
if(NOT "FOO" STREQUAL BAR)
|
||
|
message(FATAL_ERROR "The quoted variable should match the string")
|
||
|
endif()
|
||
|
endfunction()
|
||
|
|
||
|
macro(macro_defined_old_called_new)
|
||
|
if(NOT FOO STREQUAL BAR)
|
||
|
message(FATAL_ERROR "The variable should match the string")
|
||
|
endif()
|
||
|
|
||
|
if(NOT "FOO" STREQUAL BAR)
|
||
|
message(FATAL_ERROR "The quoted variable should match the string")
|
||
|
endif()
|
||
|
endmacro()
|
||
|
|
||
|
cmake_policy(SET CMP0054 NEW)
|
||
|
|
||
|
function_defined_old_called_new()
|
||
|
macro_defined_old_called_new()
|