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_output_variable})
will print
-- foo
while
set_my_variable("something else")
message(STATUS ${my_output_variable})
will print
-- bar