[CMake] Using the Microsoft compiler with "Unix Makefiles"

William R. Otte wotte at dre.vanderbilt.edu
Tue Jun 19 01:05:29 EDT 2012


Hi Brendan - 

On Jun 18, 2012, at 11:49 PM, Braden McDaniel wrote:

> Is it possible to use the Microsoft compiler (cl) with "Unix Makefiles"?
> 
> I found some older list postings that suggested it could work; however, setting CC, CXX, and CMAKE_CXX_COMPILER to "cl" doesn't do the trick. (It appears that the compiler doesn't like some of the flags used in the makefiles.)  Can this be made to work with modern CMake (2.8.7), or am I barking up the wrong tree?

Speaking not as a cmake expert (I am not), but as someone who has been involved with many cross platform projects:

If your goal is to compile from the command line, you have two options:  Either generate regular visual studio projects, then use devenv.exe to compile from the command line (http://msdn.microsoft.com/en-US/library/b20w810z(v=vs.80)) or use cmake to generate nmake makefiles, then you can compile using nmake.exe.

hth,
/-Will




More information about the CMake mailing list