2012-09-15 271 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

相關問題