CMake 错误:无法创建命名生成器 XCode

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/24278599/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 05:06:37  来源:igfitidea点击:

CMake Error: Could not create named generator XCode

xcodecmakeclangllvm

提问by 4ntoine

i have checked out llvm/clang/compiler-rt sources from official git repositories, but i'm having:

我已经从官方 git 存储库中查看了 llvm/clang/compiler-rt 源,但我有:

MBA-Anton:llvm_34_xcode_build asmirnov$ cmake -G XCode ../llvm_34
CMake Error: Could not create named generator XCode

LLVM sources:

LLVM 来源:

MBA-Anton:llvm_34_xcode_build asmirnov$ ls ../llvm_34
CMakeLists.txt      Makefile.common     cmake           llvm.spec.in
CODE_OWNERS.TXT     Makefile.config.in  configure       projects
CREDITS.TXT     Makefile.rules      docs            test
LICENSE.TXT     README.txt      examples        tools
LLVMBuild.txt       autoconf        include         unittests
Makefile        bindings        lib         utils

Cmake version:

Cmake版本:

MBA-Anton:llvm_34_xcode_build asmirnov$ cmake -version
cmake version 2.8.11.1

Xcode generator should be supported for this cmake version according to docand output:

根据文档和输出,此 cmake 版本应支持 Xcode 生成器:

MBA-Anton:llvm_34_xcode_build asmirnov$ cmake --help
...

Generators

The following generators are available on this platform:
  Unix Makefiles              = Generates standard UNIX makefiles.
  Ninja                       = Generates build.ninja files (experimental).
  Xcode                       = Generate Xcode project files.
  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.

采纳答案by trojanfoe

I've never used CMake, but from what I've seen from your question it's just a question of case-sensitivity.

我从未使用过 CMake,但从我从您的问题中看到的情况来看,这只是区分大小写的问题。

The generator is called Xcodeand not XCode.

生成器被调用Xcode而不是XCode

回答by lbsweek

I also met this problem, it was resolved after I renamed Xcode-beta to Xcode

我也遇到过这个问题,我把Xcode-beta改名为Xcode后解决了