CMake cannot locate rc.exe when setting CMAKE_SYSTEM_VERSION=10.0 on Windows Server 2012
My team's build server is running on Windows Server 2012 and we are attempting to build our product against the Windows 10 SDK libraries. After searching online as to why our product was actually being built against the Windows 8.1 SDK, we tried setting CMAKE_SYSTEM_VERSION=10.0 so that CMake would find the Windows 10 SDK and compile using that instead. However, setting CMAKE_SYSTEM_VERSION to 10.0 results in CMake telling us that no CMAKE_C_COMPILER or CMAKE_CXX_COMPILER could be found. Looking at the error log, this appears to be due to the following: LINK : fatal error LNK1158: cannot run 'rc.exe' [...\build\CMakeFiles\3.9.0\CompilerIdC\CompilerIdC.vcxproj]
We are using -G "Visual Studio 14 2015". rc.exe is here: D:\Program Files (x86)\Windows Kits\10\bin\10.0.15063.0\x86\rc.exe If we use the same variables on a Windows 10 PC, everything works fine. I'm not sure why the older OS can't find the Windows 10 SDK and unfortunately we aren't in a position to upgrade it right now.