[Cmake] Determining host compiler/OS from CMake

Sebastien BARRE sebastien.barre at kitware.com
Thu Feb 28 14:55:57 EST 2002


At 2/28/2002 02:37 PM, Parag Chandra wrote:
>Thanks, I forgot that, but I still get parse errors (different than ones
>from before):
>
>Here's a snippet from my CmakeLists.txt:
>
>IF (CMAKE_CXX_COMPILER MATCHES "VC*60")
>         ADD_DEFINITIONS (-D__FOO)
>ELSE (CMAKE_CXX_COMPILER MATCHES "VC*60")
>         ADD_DEFINITIONS (-D__BAR)
>ENDIF (CMAKE_CXX_COMPILER MATCHES "VC*60")

This code looks valid to me (except that the regexp is wrong, in that case 
it would be MATCHES "^VC\\+\\+60$" since '+' is a meta char that has to be 
escaped by '\' (thus the double '\' it's also an escape char in CMake :)).
I've just tested it. Some errors elsewhere.

If you are using CMake >= 1.2, be aware that CMAKE_CXX_COMPILER is now "cl" 
for Visual C++ 6.0 (both in MSDEV Studio and Nmake mode).


--
Sebastien Barre




More information about the CMake mailing list