I want to use cmake with the Xcode generator in OSX.
Xcode 3.1 is installed (OSX 10.5.7) and building the project with the default makefile generator works fine. But if I add the flag -G Xcode to the cmake command I get the following error:

Temp $ cmake -G Xcode CMakeLists.txt
-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- broken
CMake Error at /usr/local/share/cmake-2.6/Modules/ CMakeTestCCompiler.cmake:32 (MESSAGE): The C compiler "/usr/bin/cc" is not able to compile a simple test program.

  It fails with the following output:

   Change Dir: /Users/pim/Temp/CMakeFiles/CMakeTmp



  Run Build Command:/usr/local/bin/cmakexbuild -project
CMAKE_TRY_COMPILE.xcodeproj build -target cmTryCompileExec - configuration
  Debug

2009-05-17 15:00:37.495 xcodebuild[13191:4617] Warning: Couldn't discover the 'cc' compiler's built-in search paths and preprocessor definitions for
  language dialect 'c'.  This may lead to indexing issues.

  Compiler: /Developer/Library/Xcode/Plug-ins/GCC
  4.0.xcplugin/Contents/Resources/cc

  Reason: sh: /Developer/Library/Xcode/Plug-ins/GCC
  4.0.xcplugin/Contents/Resources/cc: No such file or directory



  ** BUILD FAILED **



  The following build commands failed:

  cmTryCompileExec:

        CompileC
CMAKE_TRY_COMPILE.build/Debug/cmTryCompileExec.build/Objects-normal/ i386/testCCompiler.o
  /Users/pim/Temp/CMakeFiles/CMakeTmp/testCCompiler.c normal i386 c
  com.apple.compilers.gcc.4_0

  (1 failure)



=== BUILDING NATIVE TARGET cmTryCompileExec OF PROJECT CMAKE_TRY_COMPILE
  WITH CONFIGURATION Debug ===



  Checking Dependencies...



  PhaseScriptExecution
/Users/pim/Temp/CMakeFiles/CMakeTmp/CMAKE_TRY_COMPILE.build/Debug/ cmTryCompileExec.build/Script-687250687250687250000000.sh


      cd /Users/pim/Temp/CMakeFiles/CMakeTmp
/bin/sh -c /Users/pim/Temp/CMakeFiles/CMakeTmp/ CMAKE_TRY_COMPILE.build/Debug/cmTryCompileExec.build/ Script-687250687250687250000000.sh

  make: `CMakeFiles/cmake.check_cache' is up to date.



  CompileC
CMAKE_TRY_COMPILE.build/Debug/cmTryCompileExec.build/Objects-normal/ i386/testCCompiler.o
  /Users/pim/Temp/CMakeFiles/CMakeTmp/testCCompiler.c normal i386 c
  com.apple.compilers.gcc.4_0

      cd /Users/pim/Temp/CMakeFiles/CMakeTmp
"/Developer/Library/Xcode/Plug-ins/GCC 4.0.xcplugin/Contents/ Resources/cc" -x c -arch i386 -fmessage-length=0 -pipe -Wno-trigraphs - fpascal-strings -fasm-blocks -O0 -mdynamic-no-pic - DCMAKE_INTDIR="Debug" -gdwarf-2 -Wmost -Wno-four-char-constants -Wno- unknown-pragmas -F/Users/pim/Temp/CMakeFiles/CMakeTmp/Debug -I/Users/ pim/Temp/CMakeFiles/CMakeTmp/Debug/include -I/Users/pim/Temp/ CMakeFiles/CMakeTmp/CMAKE_TRY_COMPILE.build/Debug/ cmTryCompileExec.build/DerivedSources -c /Users/pim/Temp/CMakeFiles/ CMakeTmp/testCCompiler.c -o /Users/pim/Temp/CMakeFiles/CMakeTmp/ CMAKE_TRY_COMPILE.build/Debug/cmTryCompileExec.build/Objects-normal/ i386/testCCompiler.o

  error: can't exec '/Developer/Library/Xcode/Plug-ins/GCC
  4.0.xcplugin/Contents/Resources/cc' (No such file or directory)



  PhaseScriptExecution
/Users/pim/Temp/CMakeFiles/CMakeTmp/CMAKE_TRY_COMPILE.build/Debug/ cmTryCompileExec.build/Script-687900687900687900000000.sh


      cd /Users/pim/Temp/CMakeFiles/CMakeTmp
/bin/sh -c /Users/pim/Temp/CMakeFiles/CMakeTmp/ CMAKE_TRY_COMPILE.build/Debug/cmTryCompileExec.build/ Script-687900687900687900000000.sh

  echo "Depend check for xcode"

  Depend check for xcode

  cd /Users/pim/Temp/CMakeFiles/CMakeTmp && make -C
  /Users/pim/Temp/CMakeFiles/CMakeTmp -f
/Users/pim/Temp/CMakeFiles/CMakeTmp/CMakeScripts/ XCODE_DEPEND_HELPER.make
  all.Debug

  /bin/rm -f /Users/pim/Temp/CMakeFiles/CMakeTmp/Debug/cmTryCompileExec





  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:1 (project)


-- Configuring incomplete, errors occurred!

##########################################################

The output I get if I use the default makefile generator is:

Temp $ cmake CMakeLists.txt
-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/pim/Temp

Does anyone know what is wrong here?

Kind regards,

Pim Schellart

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to