我正在尝试从洞察工具包(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>
当我尝试生成项目时,它因以下错误而失败:
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
如何配置对 cmakexbuild 的调用?我在 CMake 配置菜单中没有找到相应的条目。
我从其他项目的其他用户那里发现了类似的问题,所以我认为这是 CMake 配置的问题。
我在 Mac OS X Lion 10.7.3 上使用 Xcode 4.3 和 CMake 2.8.7。
谢谢你的帮助,
保罗
最佳答案
这是一个 CMake 错误,它似乎已在开发版本中修复:
http://public.kitware.com/Bug/view.php?id=12621
关于xcode - CMake Xcode 生成器使用不再受支持的选项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9759548/