2012-09-15 189 views
4

我正在寻找一种方法来编译一些库,它们已经准备好通过cmake来使用,问题是我想用VC++ express 2012(第一个快速版本来允许x64开发)然而,当我运行cmake我不断收到这样的:visual studio express 2012和cmake

CMake Error: CMake was unable to find a build program corresponding to "Visual Studio 11". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool. 
CMake Error: Could not find cmake module file:C:/Users/Alexander Rojas/workspace/jthread-1.3.1/build/CMakeFiles/CMakeCCompiler.cmake 
CMake Error: Could not find cmake module file:C:/Users/Alexander Rojas/workspace/jthread-1.3.1/build/CMakeFiles/CMakeCXXCompiler.cmake 
Configuring incomplete, errors occurred! 

我发现,这条道路是devenv.exe的路径,但这个品牌新的VC没有这个计划。任何解决方法的想法?

+1

http://public.kitware.com/Bug/view.php?id = 13348 – stijn

+0

是的,我看到了,但是他们没有提供解决方法 – Sambatyon

+0

您不能让cmake为VS2012或VC Express 2010等生成vcxproj文件,然后手动构建它(使用devenv或msbuild或IDE)? – stijn

回答

8

因此,该文件CMakeVS11FindMake.cmake中我不得不更改注册表项

HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\11.0 

的关键

HKEY_CURRENT_USER\\Software\\Microsoft\\WDExpress\\11.0_Config 

(只是将其添加为一个额外的提示将工作)

的所有引用
5

CMake(2.8.9)的任何发行版都不支持Visual Studio 2012 Express Edition。然而CMake开发人员今天只有checked in code to fix the problem。无论何时释放,修复都应该在CMake 2.8.10中。

如果你真的需要它迟早你应该能够抓住a nightly CMake installer,但您可能需要晃到20120919个安装张贴,因为我不知道这是否修复使它到20120918个安装。 (为了今天测试,我检查了git repository的源代码,切换到“下一个”分支,配置了一个旧的CMake,为自己建立了一个新的CMake,并确认它可以正常工作VS 2012 Express。 )

+0

它是否也支持ARM构建? –

2

我仍然需要将Sambatyon的修复程序应用到CMakeVS11FindMake.cmake,我使用的是CMake 2.8.10.2。

-1

我的解决方案是:在2010年生成VS2012中的“重新加载全部”,然后在解决方案资源管理器中解决方案中的“更新VC++项目”。

但是:我的安装包括活动VS 2010,过期VS 2012试用,活跃VS 2012 Express。

0

其他解决方案不再工作;与最新的(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

相关问题