CMake Visual Studio 2015 C compiler is unknown
<p>I am trying to use cmake for the first time to compile an old c project with Visual Studio 2015 however I keep getting c compiler is unknown.  The error from cmake is as following;</p>

<pre><code>Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
Compiler:  
Build flags: 
Id flags: 

The output was:
1
Microsoft (R) Build Engine version 14.0.25123.0
Copyright (C) Microsoft Corporation. All rights reserved.

Build started 23/06/2016 14:46:48.
Project "D:\Modules\cmake-test\build\CMakeFiles\3.6.0-    rc3\CompilerIdC\CompilerIdC.vcxproj" on node 1 (default targets).
PrepareForBuild:
Creating directory "Debug\".
Creating directory "Debug\CompilerIdC.tlog\".
InitializeBuildStatus:
Creating "Debug\CompilerIdC.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
ClCompile:
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\CL.exe /c /nologo /W0 /WX- /Od /Oy- /D _MBCS /Gm- /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /Fo"Debug\\" /Fd"Debug\vc140.pdb" /Gd /TC /analyze- /errorReport:queue CMakeCCompilerId.c
CMakeCCompilerId.c
Link:
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\link.exe /ERRORREPORT:QUEUE /OUT:".\CompilerIdC.exe" /INCREMENTAL:NO /NOLOGO kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /MANIFEST /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /manifest:embed /PDB:".\CompilerIdC.pdb" /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:".\CompilerIdC.lib" /MACHINE:X86 /SAFESEH Debug\CMakeCCompilerId.obj
LINK : fatal error LNK1158: cannot run 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\rc.exe' [D:\Modules\cmake-test\build\CMakeFiles\3.6.0-rc3\CompilerIdC\CompilerIdC.vcxproj]
Done Building Project "D:\Modules\cmake-test\build\CMakeFiles\3.6.0-rc3\CompilerIdC\CompilerIdC.vcxproj" (default targets) -- FAILED.

Build FAILED.

"D:\Modules\cmake-test\build\CMakeFiles\3.6.0-rc3\CompilerIdC\CompilerIdC.vcxproj" (default target) (1) -&gt;
(Link target) -&gt; 
LINK : fatal error LNK1158: cannot run 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\rc.exe' [D:\Modules\cmake-test\build\CMakeFiles\3.6.0-rc3\CompilerIdC\CompilerIdC.vcxproj]

   0 Warning(s)
   1 Error(s)

Time Elapsed 00:00:00.39
</code></pre>

<p>I have looked at these answers but not found a working solution.</p>

<p><a href="https://stackoverflow.com/questions/37089187/cmake-visual-studio-2015-identification-unknown">Cmake Visual Studio 2015 Identification Unknown</a></p>

<p><a href="https://stackoverflow.com/questions/32909628/cmake-cannot-identify-c-compiler-from-installed-visual-studio-2015">CMake cannot identify C compiler from installed Visual Studio 2015</a></p>

<p><a href="https://stackoverflow.com/questions/31619296/cmake-does-not-find-visual-c-compiler">CMake does not find Visual C++ compiler</a></p>

<p><a href="https://stackoverflow.com/questions/25941858/c-compiler-identification-is-unknown-despite-setting-cc-and-cxx-variables">C compiler identification is unknown despite setting CC and CXX variables</a></p>

<p>The command I am using is </p>

<pre><code>cmake -G "Visual Studio 14 2015" .
</code></pre>

<p>I have tried both 3.6.0-rc3 and 3.5.2 versions of cmake.</p>

<p>I got rc.exe on my path by following instructions from this question.</p>

<p><a href="https://stackoverflow.com/questions/14372706/visual-studio-cant-build-due-to-rc-exe">Visual Studio can&#39;t build due to rc.exe</a></p>

<p>Any help would be greatly appreciated!</p>