简体   繁体   中英

visual studio express 2012 and cmake

I am looking for a way to compile some libraries which come ready to be used through cmake, the problem is that I would like to use VC++ express 2012 (the first express version to allow x64 development) however when I run cmake I keep getting this:

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!

I found that this path is the path to devenv.exe but this brand new vc doesn't have this program. Any ideas for a workaround?

So, in the file CMakeVS11FindMake.cmake I had to change all references of the registry key

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

to the key

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

(just adding them as an extra hint will work)

Visual Studio 2012 Express Edition is not currently supported in any released version of CMake (2.8.9). However CMake developers have just today checked in code to fix the problem . The fix should be in CMake 2.8.10 whenever it's released.

If you really need it sooner you should be able to grab a nightly CMake installer , but you may need to way until the 20120919 installers are posted since I'm not sure whether this fix made it into the 20120918 installers.

(To test it out today, I checked out the source code from their git repository , switched to branch "next", configured with an old CMake, built myself a fresh CMake, and confirmed that it works fine VS 2012 Express.)

我仍然需要将Sambatyon的修复应用于CMakeVS11FindMake.cmake,我正在使用CMake 2.8.10.2。

The other solutions don't work anymore; with the latest (express 2012 for desktop as of writing) you may need to modify:

C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeVS12FindMake.cmake

To read something like:

#=============================================================================
# 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)

This is for cmake 2.8.11.2

Edit: Note specifically this is with regard to the VS2012 bundle, not the VS2013 release candidate, or future version of VS2013, where the correct ToolsVersions is \\12.0

My work around: generate for 2010, "Reload All" in VS2012 and then "Update VC++ Projects" on the solution in solution explorer.

However: My install comprises active VS 2010, expired VS 2012 trial, active VS 2012 Express.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM