mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-09-25 04:09:36 +03:00
Preserve backslashes in arguments passed to macros by re-escaping them before substituting in the macro body, where they will be parsed again. Fixes: #19281, #22157, #23641, #25803, #27645, #20891
21 lines
600 B
CMake
21 lines
600 B
CMake
function(cmp0219_assert_equal actual expected)
|
|
if(NOT "${actual}" STREQUAL "${expected}")
|
|
message(FATAL_ERROR
|
|
"Assertion failed:\n"
|
|
" expected=[${expected}]\n"
|
|
" actual=[${actual}]")
|
|
endif()
|
|
endfunction()
|
|
|
|
function(cmp0219_assert_undefined variable_name)
|
|
if(DEFINED ${variable_name})
|
|
message(FATAL_ERROR
|
|
"Assertion failed:\n"
|
|
" ${variable_name} should be undefined\n"
|
|
" actual=[${${variable_name}}]")
|
|
endif()
|
|
endfunction()
|
|
|
|
set(cmp0219_path_fwd "C:/build_bot/new/temp/vendor")
|
|
string(REPLACE "/" "\\" cmp0219_path_native "${cmp0219_path_fwd}")
|