Tutorial by Examples

macro(set_my_variable _INPUT) if("${_INPUT}" STREQUAL "Foo") set(my_output_variable "foo") else() set(my_output_variable "bar") endif() endmacro(set_my_variable) Use the macro: set_my_variable("Foo") message(STATUS ${my_outpu...
macro(set_custom_variable _OUT_VAR) set(${_OUT_VAR} "Foo") endmacro(set_custom_variable) Use it with set_custom_variable(my_foo) message(STATUS ${my_foo}) which will print -- Foo

Page 1 of 1