Different escaping in macros and functions?
Hi,
Here's a sample project.
cmake_minimum_required(VERSION 3.15)
project(test_quoting_macro_and_function)
function(my_func)
message("func ARGV: ${ARGV}")
endfunction()
macro(my_macro)
message("macro ARGV: ${ARGV}")
endmacro()
my_func (LIBS_SUFFIX="\\\\"_${CMAKE_SYSTEM_PROCESSOR}.so\\\\"")
my_macro(LIBS_SUFFIX="\\\\"_${CMAKE_SYSTEM_PROCESSOR}.so\\\\"")
The output is:
func ARGV: LIBS_SUFFIX="\\"_x86_64.so\\""
macro ARGV: LIBS_SUFFIX="\"_x86_64.so\""
Is this expected behavior? Why does the macro eat a slash? Is there a way to keep the value as is when using a macro?