其他解决方案不再起作用;使用最新的(截至写作时为桌面版 Express 2012),您可能需要修改:
C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeVS12FindMake.cmake
阅读类似的内容:
#=============================================================================
# Copyright 2007-2013 Kitware, Inc.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# Always use MSBuild because:
# - devenv treats command-line builds as recently-loaded projects in the IDE
# - devenv does not appear to support non-standard platform toolsets
# If we need devenv for Intel Fortran in the future we should add
# a special case when Fortran is enabled.
find_program(CMAKE_MAKE_PROGRAM
NAMES MSBuild
HINTS "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\MSBuild\\ToolsVersions\\4.0;MSBuildToolsPath]" <--- Change this line.
)
message("Found: ${CMAKE_MAKE_PROGRAM}")
mark_as_advanced(CMAKE_MAKE_PROGRAM)
set(MSVC12 1)
set(MSVC_VERSION 1800)
这适用于 cmake 2.8.11.2
编辑:特别注意这是关于 VS2012 捆绑包,而不是 VS2013 候选版本或 VS2013 的未来版本,其中正确的 ToolsVersions 是 \12.0