On Dec 14, 2007 7:43 AM, Rodolfo Lima <[EMAIL PROTECTED]> wrote:
>
> I think there is... another proof:
>
> if(${CMAKE_CXX_FLAGS} STREQUAL " ")
> MESSAGE("equal!")
> else(${CMAKE_CXX_FLAGS} STREQUAL " ")
> MESSAGE("not equal!")
> endif(${CMAKE_CXX_FLAGS} STREQUAL " ")
>
> This returns "equal!" in my system...
If CMAKE_CXX_FLAGS is actually null, then your script should terminate
with an error. Correct syntax is either plain CMAKE_CXX_FLAGS or
"${CMAKE_CXX_FLAGS}". What you've written would work only if the
variable evaluates to a single variable name, or a single string
constant.
A cmake -P script has no cache. On my Windows Vista machine, your
code gives me:
C:\devel\moz>cmake -P flags.cmake
CMake Error: Error in cmake code at
C:/devel/moz/flags.cmake:1:
if had incorrect arguments: ${CMAKE_CXX_FLAGS} STREQUAL " " (Unknown arguments s
pecified).
Called from: [1] C:/devel/moz/flags.cmake
Cheers,
Brandon Van Every
_______________________________________________
CMake mailing list
[email protected]
http://www.cmake.org/mailman/listinfo/cmake