【问题标题】:visual studio express 2012 and cmakeVisual Studio Express 2012 和 cmake
【发布时间】:2012-09-15 05:09:46
【问题描述】:

我正在寻找一种方法来编译一些准备好通过 cmake 使用的库,问题是我想使用 VC++ express 2012(第一个允许 x64 开发的 express 版本)但是当我运行 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没有这个程序。任何解决方法的想法?

【问题讨论】:

  • 是的,我看到了,但是他们没有提供解决方法
  • 你不能让cmake为VS2012或VC Express 2010左右生成一个vcxproj文件,然后手动构建(使用devenv或msbuild或IDE)?
  • 在付费的 Visual Studio 应用程序中,CMAKE_MAKE_PROGRAM 是 devenv.com 或 MSbuild.exe。我相信 MSBuild.exe 不适用于快速版本,因此如果这导致构建停止,您可能需要等待修复。

标签: visual-studio cmake visual-studio-2012


【解决方案1】:

因此,在文件CMakeVS11FindMake.cmake 中,我不得不更改注册表项的所有引用

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

到关键

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

(只需将它们添加为额外提示即可)

【讨论】:

    【解决方案2】:

    任何已发布的 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 中检查了源代码,切换到分支“next”,配置了旧的 CMake,自己构建了一个新的 CMake,并确认它可以正常工作 VS 2012 Express .)

    【讨论】:

    • 它是否也支持为 ARM 构建?
    【解决方案3】:

    我仍然需要将上面 Sambatyon 的修复应用到 CMakeVS11FindMake.cmake,而且我使用的是 CMake 2.8.10.2。

    【讨论】:

      【解决方案4】:

      其他解决方案不再起作用;使用最新的(截至写作时为桌面版 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

      【讨论】:

        【解决方案5】:

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

        但是:我的安装包括有效的 VS 2010、过期的 VS 2012 试用版、有效的 VS 2012 Express。

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多