[CMake] Checking for empty string

Rolf Eike Beer eike at sf-mail.de
Tue Oct 25 06:31:42 EDT 2011


> hi there,
>
> how do I test if a string is empty ("") or not ?
> IF( ${test} STREQUAL "" )
> gives the wrong number of arguments if ${test} is ""

if ("${test}" STREQUAL "")
if (NOT test)

What does not work (in 2.8.5) but should work according to the documentation:

if (test STREQUAL "")

Eike


More information about the CMake mailing list