Consider the following CMake code:
if(VAR_1 STREQUAL VAR_2)
set(VAR_3 ON)
else()
set(VAR_3 OFF)
endif()
I want to write the same thing, but as a one-liner. I don't particularly care which boolean representation VAR_3 ends up using. So what I need is to set it to the result of the evaluation of a boolean expression.
Now, this doesn't work:
set(VAR_3 (VAR_1 STREQUAL VAR_2) )
nor does this:
set(VAR_3 (${VAR_1} STREQUAL ${VAR_2}) )
Rather, they get me something like ;ValueOfVar1Here;STREQUAL;ValueOfVar2Here; - which isn't what I want.
Can I get the evaluation I want somehow?