[CMake] recommended way to test for msvc/cl ?

Alexander Neundorf a.neundorf-work at gmx.net
Sun Jan 29 11:33:44 EST 2006


Hi, 
 
what's the recommended way to test in a CMakeLists.txt, whether the 
current compiler is msvc/cl ? 
 
I found: 
UNIX 
APPLE 
WIN32 
CYGWIN 
MINGW 
BORLAND 
 
I can't test, but I guess e.g. WIN32 is true for CYGWIN, MINGW, BORLAND 
and msvc/cl. 
 
There is a variable CMAKE_COMPILER_IS_GNUCC, which is set for gcc. AFAIK 
there is no CMAKE_COMPILER_IS_MSVC.  
There are CMAKE_C_COMPILER and CMAKE_GENERATOR_CC, which are probably set 
to "cl" both for MSVC and nmake Makefiles ? 
 
So which test is recommended ? 
 
Or how about adding a "MSVC" to the list above ? 
 
Bye 
Alex 
 

-- 
Telefonieren Sie schon oder sparen Sie noch?
NEU: GMX Phone_Flat http://www.gmx.net/de/go/telefonie


More information about the CMake mailing list