所以我昨天安装了Visual Studio 2017.我还安装了支持VS 2017的CMake 3.7.2.
我的VS安装与Game development with C++工作流程+一些其他组件:

我还添加了CMake的东西(但我认为我甚至不需要它 - 因为我使用CMake作为独立工具来生成VS解决方案)和MSBuild(我msbuild.exe甚至在添加该组件之前 - 所以没有确定该附加组件究竟做了什么).
使用VS 2015,我能够cmake .从正常的命令提示符运行以获得解决方案.
随着VS 2017工作流程的变化 - 我已经阅读了微软的这篇文章.
所以我尝试了以下方法:
Developer Command Prompt for VS 2017,从那里跑了cmake . -G "NMake Makefiles".然后cmake --build .正确运行编译的一切.当我在提示中尝试以下操作时:cmake . -G "Visual Studio 15 2017 Win64"强制创建解决方案时出现以下错误:
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
CMake Error at CMakeLists.txt:3 (project):
No CMAKE_C_COMPILER could …Run Code Online (Sandbox Code Playgroud)我们在使用Visual Studio 2012在Windows 7 64Bit下使用CMake(v2.8.12)编译项目时遇到问题.CMake给出了以下错误.我们已经尝试使用管理员权限从Visual Studio命令行启动Cmake.在CMake 2.8.11中似乎存在类似的错误:http://www.cmake.org/Bug/view.php?id = 14440
CMake Error at C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeDetermineCompilerId.cmake:446 (execute_process):
execute_process given COMMAND argument with no value.
Call Stack (most recent call first):
C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeDetermineCompilerId.cmake:48 (CMAKE_DETERMINE_COMPILER_ID_VENDOR)
C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeDetermineCCompiler.cmake:131 (CMAKE_DETERMINE_COMPILER_ID)
CMakeLists.txt:2 (project)
The C compiler identification is unknown
CMake Error at C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeDetermineCompilerId.cmake:446 (execute_process):
execute_process given COMMAND argument with no value.
Call Stack (most recent call first):
C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeDetermineCompilerId.cmake:48 (CMAKE_DETERMINE_COMPILER_ID_VENDOR)
C:/Program Files (x86)/CMake …Run Code Online (Sandbox Code Playgroud) 我安装了VS2017,安装了VS2017(v141)和VS2015.3(v140)工具集.我需要用CMake生成一个解决方案,我希望CMake被"愚弄",好像安装了VS2015,所以我可以使用v140工具集构建项目.
我知道这个问题可能与以下内容重复:
cmake如何为Visual Studio 2015项目指定"Platform Toolset"?
但它提供的解决方案对我没有帮助.
错误消息是:
Selecting Windows SDK version 10.0.14393.0 to target Windows 10.0.15063.
The C compiler identification is unknown
The CXX compiler identification is unknown
CMake Error at CMakeLists.txt:18 (project):
No CMAKE_C_COMPILER could be found.
Run Code Online (Sandbox Code Playgroud)
我尝试安装VS2017和VS2015.3(IDE),但VS2015.3拒绝创建一个简单的控制台程序.
有没有其他方法可以使用v140工具集生成解决方案?
(PS不要告诉我,我应该首先使用v141工具集生成并修改Visual Studio中的工具集选项.这会产生很大的不同.)