[CMake] How does cmake "discover" Visual Studio C++ compilers?

Eric Erhardt Eric.Erhardt at microsoft.com
Mon Feb 15 23:23:24 EST 2016


I am trying to get our continuous integration system working in a Windows Docker container.

We use CMake along with the Visual C++ compilers shipped with VS 2015.

I have installed cmake-3.4.3-win32-x86 on the windows container, and also VS 2015 community with just the '/InstallSelectableItems', 'NativeLanguageSupport_VC', so just the C++ tools are installed.

However, when I run cmake -G "Visual Studio 14 2015 Win64", I first get:

The C compiler identification is unknown
The CXX compiler identification is unknown


But then I try running it again, and then the compiler is picked up.

I know the recommendation is "run cmake in a VS developer command prompt", but I'm in a Docker container, so I can't pick my command prompt.

I've tried running vcvarsall.bat in the container during the build before calling cmake -G, but it doesn't fix the issue.

So my question is:  exactly what does cmake look for to pick up the VS compilers?  Does "cl.exe" need to be on the PATH?  Does a certain environment variable need to be set?  Or a registry setting?

Thanks in advance,
Eric Erhardt
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20160216/c3f72fbc/attachment.html>


More information about the CMake mailing list