I am trying to use the macro() command for a context-insensitive string replacement, but this:
cmake_minimum_required(VERSION 2.8)
MACRO(TestMacro mystring)
message(mystring)
endmacro()
TestMacro("hello world")
message("hello world")
outputs:
mystring
hello world
rather than
hello world
hello world
as I would expect. Can anyone see what I’m doing wrong?
Try dereferencing the macro parameter:
Also see the Syntax Introduction.