Cmake没有在Generators列表中找到Visual Studios 2012

时间:2013-11-11 19:01:05

标签: visual-studio cmake

我正试图通过Firebreath tutorial,但我不能让Cmake工作。 Cmake没有在Generators列表下注册任何版本的Visual Studios。这是运行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(Express和Professional版本),甚至将.NET 4.0卸载并重新安装到4.5(from here)。它在我的个人计算机上工作正常,因为我在第一次运行它。但是,我的笔记本电脑只是没有注册Visual Studios。

我在Windows 7 Enterprise SP1上运行它。任何帮助表示赞赏。

以下是我得到的确切错误:

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

1 个答案:

答案 0 :(得分:10)

问题是你正在使用cygwin中包含的cmake而不是cmake的windows版本。看来当前的cygwin版本是在没有Visual Studio生成器的情况下编译的,而windows版本则是这样。

在你的情况下,一个简单的方法让Windows使用Windows版本的cmake是卸载cygwin cmake,因为它似乎不需要你。

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