visual studio express 2012 and cmake

后端 未结 5 2220
名媛妹妹
名媛妹妹 2021-02-10 20:23

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

5条回答
  •  情书的邮戳
    2021-02-10 21:04

    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

提交回复
热议问题