[CMake] IF(... MATCHES WIN32) weird behavior

Filipe Sousa filipe at ipb.pt
Tue May 31 11:48:35 EDT 2005


Why this matches

SET(arg "WIN32")
IF("${arg}" MATCHES "WIN32")
  MESSAGE(STATUS ":)")
ELSE("${arg}" MATCHES "WIN32")
  MESSAGE(STATUS ":(")
ENDIF("${arg}" MATCHES "WIN32")

C:\_builds\testes>cmake -G"NMake Makefiles" c:\_projects\testes
-- :(
-- Configuring done
-- Generating done
-- Build files have been written to: C:/_builds/testes

and this fails?

SET(arg "WIN3")
IF("${arg}" MATCHES "WIN3")
  MESSAGE(STATUS ":)")
ELSE("${arg}" MATCHES "WIN3")
  MESSAGE(STATUS ":(")
ENDIF("${arg}" MATCHES "WIN3")
                                
C:\_builds\testes>cmake -G"NMake Makefiles" c:\_projects\testes
-- :)                           
-- Configuring done             
-- Generating done              
-- Build files have been written to: C:/_builds/testes

C:\_builds\testes>cmake --version
cmake version 2.1-20050531

I don't see the problem under linux
-- 
Filipe Sousa
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://public.kitware.com/pipermail/cmake/attachments/20050531/4dc4a0ef/attachment.pgp


More information about the CMake mailing list