Add comparison operator for boolean values
Sometimes it happens that Boolean values come from different sources. Since these are not defined uniformly in CMake, i.e. whether e.g. FALSE
or OFF
, it comes to issues if one wants to compare two Boolean values on equality, like:
set(varOff ON)
set(varFALSE TRUE)
if(varOff EQUAL varFALSE)
message("Equal")
else()
message("Not equal")
endif()
Since neither EQUAL
nor STREQUAL
are suitable for this and one would have to write currently always sth. like this:
if((varOff AND varFALSE) OR (NOT varOff AND NOT varFALSE))
message("Equal")
else()
message("Not equal")
endif()
it would be nice, when there would be sth. like BOOL_EQUAL
.
External issue this is related to: microsoft/vcpkg#31209