Search code examples
xcodecmakegeneratorxcodebuilditk

CMake Xcode generator uses no longer supported options


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

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.

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

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

Thanks for your help,

Paul


Solution

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

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