CMake Xcode 生成器使用不再受支持的选项

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/9759548/
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-14 23:41:32  来源:igfitidea点击:

CMake Xcode generator uses no longer supported options

xcodecmakegeneratorxcodebuilditk

提问by Paul

I'm trying to make a Xcode project from the Insight Toolkit (ITK, itk.org). I issued the following command into the terminal:

我正在尝试从洞察工具包(ITK,itk.org)制作一个 Xcode 项目。我向终端发出以下命令:

ccmake -DCMAKE_C_COMPILER=/Applications/Xcode.app/Contents/Developer/usr/bin/gcc -DCMAKE_CXX_COMPILER=/Applications/Xcode.app/Contents/Developer/usr/bin/g++ -GXcode /<path to source>

When I try to generate the project it fails with this error:

当我尝试生成项目时,它因以下错误而失败:

CMake Error at /Applications/CMake 2.8-7.app/Contents/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:52 (MESSAGE):

The C compiler "/Applications/Xcode.app/Contents/Developer/usr/bin/gcc" is not able to compile a simple test program.

It fails with the following output:

Change Dir: /<path to destination folder>/CMakeFiles/CMakeTmp

Run Build Command:/Applications/CMake\ 2.8-7.app/Contents/bin/cmakexbuild -project CMAKE_TRY_COMPILE.xcode build -target cmTryCompileExec -buildstyle Development

xcodebuild: error: option '-buildstyle' is no longer supported

How can I configure the call to cmakexbuild? I haven't found a respective entry in the CMake configuration menu.

如何配置对 cmakexbuild 的调用?我在 CMake 配置菜单中没有找到相应的条目。

I have found similar problems from other users with other projects so I assume it's a problem with the CMake configuration.

我从其他项目的其他用户那里发现了类似的问题,所以我认为这是 CMake 配置的问题。

I'm using Xcode 4.3 and CMake 2.8.7 on Mac OS X Lion 10.7.3.

我在 Mac OS X Lion 10.7.3 上使用 Xcode 4.3 和 CMake 2.8.7。

Thanks for your help,

谢谢你的帮助,

Paul

保罗

采纳答案by arrowd

It's a CMake bug and it seem to be been fixed in development version:

这是一个 CMake 错误,它似乎已在开发版本中修复:

http://public.kitware.com/Bug/view.php?id=12621

http://public.kitware.com/Bug/view.php?id=12621

回答by Nick

You can fix this by telling OSX which version of Xcode you want to use. If you installed 4.3, it has moved to the Apps folder, along with all the tools. Previously they were all in /Developer. Do the following and try again.

您可以通过告诉 OSX 您要使用哪个版本的 Xcode 来解决此问题。如果您安装了 4.3,它已与所有工具一起移至 Apps 文件夹。以前他们都在/Developer. 执行以下操作并重试。

sudo /usr/bin/xcode-select -switch /Applications/Xcode.app/Contents/Developer

You may also have to install the command-line tools. I already installed these so I don't know what will happen without them.

您可能还需要安装命令行工具。我已经安装了这些,所以我不知道没有它们会发生什么。

回答by Nick

cmake 2.8.8 rc1 is out now. Perhaps try that. I thinkit has solved my problem. :)

cmake 2.8.8 rc1 现已发布。也许试试那个。我认为它已经解决了我的问题。:)