[CMake] Weird STREQUAL result

Dirk Thomas dthomas at osrfoundation.org
Sat Aug 30 14:13:19 EDT 2014


I ran into weird behavior with STREQUAL and boiled it down to the
following simple example:

    cmake_minimum_required(VERSION 2.8)
    if("f" STREQUAL "")
        # happens with CMake version 2.8.12.2
        message(FATAL_ERROR "This should not be TRUE: 'f' STREQUAL '' ")
    endif()

I would expect that the condition evaluates to FALSE since the two
strings are obviously not equal.
But in my case (using CMake 2.8.12.2 on Ubuntu 14.04) the condition
evaluates to TRUE.

Is this a known bug, should I fill a ticket for it or is that
"expected" behavior?
If it is the latter could someone please describe why that is the case?

Thank you,
- Dirk


More information about the CMake mailing list