CMake Xcode Generator Uses Discontinued Parameters

I am trying to create an Xcode project from the Insight Toolkit (ITK, itk.org). I entered 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 a project, it does not work 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 to configure cmakexbuild call? I did not find the corresponding entry in the CMake configuration menu.

I found similar problems with other users with other projects, so I assume this is a CMake configuration problem.

I am using Xcode 4.3 and CMake 2.8.7 for Mac OS X Lion 10.7.3.

Thanks for your help,

Floor

+6
source share
3 answers

This is a CMake bug and seems to be fixed in the development version:

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

+5
source

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

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

You may also need to install command line tools. I already installed them, so I don’t know what would happen without them.

+2
source

cmake 2.8.8 rc1 is missing. Perhaps try this. I think this solved my problem. :)

0
source

Source: https://habr.com/ru/post/911035/


All Articles