Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 498
Paul Avatar asked Mar 18 '12 15:03

Paul


2 Answers

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

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

like image 118
arrowd Avatar answered Sep 22 '22 07:09

arrowd


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.

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.

like image 29
Nick Avatar answered Sep 20 '22 07:09

Nick