EQUAL is meant for exact numeric equal comparison (i.e. -- works with
numbers only, not meant to work with booleans)
One possibility is:
if(_COMPILE_RESULT)
set(_COMPILE_RESULT 1)
else()
set(_COMPILE_RESULT 0)
endif()
if(SHOULD_COMPILE)
set(SHOULD_COMPILE 1)
else()
set(SHOULD_COMPILE 0)
I have 2 variables that hold boolean values. One is the result of a
try_compile() and the other has the expected outcome. Now I want to check if
the expectation is correct, so I tried:
if (_COMPILE_RESULT EQUAL SHOULD_COMPILE)
Which works if both are true or different, but the result is "false"