[cmake-developers] Exclusive Or operator

Robert Dailey rcdailey.lists at gmail.com
Thu Sep 13 09:14:10 EDT 2012


Derp. Thanks, this does seem to work. I overcomplicated the problem in
my head. Well, I guess there's not much of a need for it at all.

On Thu, Sep 13, 2012 at 4:58 AM, Stephen Kelly <steveire at gmail.com> wrote:
> Robert Dailey wrote:
>
>> if( var1 AND var2 )
>> message( "Feature is ON" )
>> elseif( var1 XOR var2 )
>> message( SEND_ERROR "Both variables must be specified" )
>> endif()
>
> Can't you do this? :
>
> if( var1 AND var2 )
>     message( "Feature is ON" )
> elseif( var1 OR var2 )
>     message( SEND_ERROR "Both variables must be specified" )
> else()
>     message( "Feature is OFF" )
> endif()
>
> You don't need XOR if you've just used AND.
>
> Thanks,
>
> Steve.
>
>
> --
>
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers



More information about the cmake-developers mailing list