Cmake在发电机列表中找不到Visual Studio 2012 [英] Cmake not finding Visual Studios 2012 in Generators list

查看:540
本文介绍了Cmake在发电机列表中找不到Visual Studio 2012的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图通过 Firebreath教程 a>,但我不能让Cmake工作。 Cmake不会在 Generators 列表中注册任何版本的Visual Studio。这是运行 cmake --help 时的列表:

I'm trying to run through the Firebreath tutorial, but I cannot get Cmake to work. Cmake does not register any version of Visual Studios under the Generators list. This is the list when running cmake --help:

Generators

The following generators are available on this platform:
  Unix Makefiles              = Generates standard UNIX makefiles.
  Ninja                       = Generates build.ninja files (experimental).
  CodeBlocks - Ninja          = Generates CodeBlocks project files.
  CodeBlocks - Unix Makefiles = Generates CodeBlocks project files.
  Eclipse CDT4 - Ninja        = Generates Eclipse CDT 4.0 project files.
  Eclipse CDT4 - Unix Makefiles
                              = Generates Eclipse CDT 4.0 project files.
  KDevelop3                   = Generates KDevelop 3 project files.
  KDevelop3 - Unix Makefiles  = Generates KDevelop 3 project files.
  Sublime Text 2 - Ninja      = Generates Sublime Text 2 project files.
  Sublime Text 2 - Unix Makefiles
                              = Generates Sublime Text 2 project files.

我重新安装了CMake,安装Visual Studios 2010和2012(快速和专业版)甚至卸载并重新安装.NET 4.0到4.5(从这里)。它在我的个人电脑上工作正常,因为我得到它运行在第一次。但是,我的工作笔记本电脑只是没有注册Visual Studios。

I have re-installed CMake, installing Visual Studios 2010 and 2012 (Express and Professional editions), and even uninstalled and re-installed .NET 4.0 to 4.5 (from here). It works fine on my personal computer, as I got it running on the first go. However, my work laptop is just not registering Visual Studios.

我在Windows 7企业版SP1上运行它。

I'm running it both on Windows 7 Enterprise SP1. Any help is appreciated.

这是我得到的确切错误:

Here is the exact error I am getting:

C:\code\tutorial2\TutorialTestPlugin>firebreath\prep2012.cmd . build
A subdirectory or file build already exists.
Using projects in: "C:\code\tutorial2\TutorialTestPlugin"
Generating build files in: "C:\code\tutorial2\TutorialTestPlugin\build"
NOTE: The build files in "C:\code\tutorial2\TutorialTestPlugin\build" should *NE
VER* be modified directly.
When needed, make project changes in cmake files and re-run this script.
  Project-specific cmake files are found in [plugin dir]\CMakeLists.txt and
  [plugin dir]\Win\projectDef.cmake.
Note that parameters for cmake should be enclosed in double quotes, e.g. "-DVERB
OSE=1"
CMAKE parameters:

C:\code\tutorial2\TutorialTestPlugin\build>cmake -G "Visual Studio 11" -DFB_PROJ
ECTS_DIR="C:\code\tutorial2\TutorialTestPlugin"  "C:\code\tutorial2\TutorialTest
Plugin\firebreath"
CMake Error: Could not create named generator Visual Studio 11
cygwin warning:
  MS-DOS style path detected: C:\code\tutorial2\TutorialTestPlugin\firebreath
  Preferred POSIX equivalent is: /cygdrive/c/code/tutorial2/TutorialTestPlugin/f
irebreath
  CYGWIN environment variable option "nodosfilewarning" turns off this warning.
  Consult the user's guide for more details about POSIX paths:
    http://cygwin.com/cygwin-ug-net/using.html#using-pathnames


推荐答案

问题是你使用的是包含在cygwin中的cmake,而不是windows版本的cmake。看来,当前的cygwin版本是编译没有为Visual Studio的生成器,而Windows版本有这些。

The problem is you are using the cmake that is included in cygwin instead of the windows version of cmake. It appears that the current cygwin version is compiled without the generators for Visual Studio while the windows version has these.

在你的情况下,一个简单的方法来获取windows使用windows版本的cmake是卸载cygwin cmake,因为它似乎没有你需要的反正。

In your case a simple way to get windows to use the windows version of cmake is to uninstall the cygwin cmake since it does not appear that you need that anyways.

另一种方法是调整您的系统路径,使c:\cygwin\bin位于C:\Program Files(x86)\CMake 2.8之后\bin。

An alternate method would have been adjusting your system path so that c:\cygwin\bin is after C:\Program Files (x86)\CMake 2.8\bin.

这篇关于Cmake在发电机列表中找不到Visual Studio 2012的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆