MantisBT - CMake
View Issue Details
0015455CMakeCMakepublic2015-03-18 11:402015-11-02 09:13
qklxtlx 
 
normalmajoralways
closedno change required 
Apple MacOS X10.4.10
CMake 3.2.1 
 
0015455: Xcode 6.2 cannot be detected
After upgrading to Xcode 6.2 with corresponding command line tools, I cannot generate xcodeproj any more. Unix Makefile works correctly though.
A simple CMakeLists.txt:
    project(HELLO)
    set(SRC_LIST main.c)
    add_executable(hello ${SRC_LIST})

This is the error log with `cmake -G "Xcode" .`

➜ /Users/anthony/Downloads/test >cmake -G "Xcode" .
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
-- Check for working C compiler using: Xcode
-- Check for working C compiler using: Xcode -- broken
CMake Error at /usr/local/Cellar/cmake/3.2.1/share/cmake/Modules/CMakeTestCCompiler.cmake:61 (message):
  The C compiler
  "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang"
  is not able to compile a simple test program.

  It fails with the following output:

   Change Dir: /Users/anthony/Downloads/test/CMakeFiles/CMakeTmp



  Run Build
  Command:"/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild"
  "-project" "CMAKE_TRY_COMPILE.xcodeproj" "build" "-target"
  "cmTryCompileExec1075155225" "-configuration" "Debug"

  === BUILD TARGET cmTryCompileExec1075155225 OF PROJECT CMAKE_TRY_COMPILE
  WITH CONFIGURATION Debug ===



  Check dependencies



  Write auxiliary files

  /bin/mkdir -p
  /Users/anthony/Downloads/test/CMakeFiles/CMakeTmp/CMAKE_TRY_COMPILE.build/Debug/cmTryCompileExec1075155225.build/Objects-normal/x86_64


  write-file
  /Users/anthony/Downloads/test/CMakeFiles/CMakeTmp/CMAKE_TRY_COMPILE.build/Debug/cmTryCompileExec1075155225.build/Objects-normal/x86_64/cmTryCompileExec1075155225.LinkFileList




  CompileC
  CMAKE_TRY_COMPILE.build/Debug/cmTryCompileExec1075155225.build/Objects-normal/x86_64/testCCompiler.o
  testCCompiler.c normal x86_64 c com.apple.compilers.llvm.clang.1_0.compiler

      cd /Users/anthony/Downloads/test/CMakeFiles/CMakeTmp
      export LANG=en_US.US-ASCII
      /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x c -arch x86_64 -fmessage-length=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -Wno-trigraphs -fpascal-strings -O0 -Wno-missing-field-initializers -Wno-missing-prototypes -Wno-return-type -Wno-missing-braces -Wparentheses -Wswitch -Wno-unused-function -Wno-unused-label -Wno-unused-parameter -Wno-unused-variable -Wunused-value -Wno-empty-body -Wno-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wno-constant-conversion -Wno-int-conversion -Wno-bool-conversion -Wno-enum-conversion -Wno-shorten-64-to-32 -Wpointer-sign -Wno-newline-eof -DCMAKE_INTDIR=\"Debug\" -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk -fasm-blocks -fstrict-aliasing -Wdeprecated-declarations -mmacosx-version-min=10.10 -Wno-sign-conversion -I/Users/anthony/Downloads/test/CMakeFiles/CMakeTmp/Debug/include -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -I/Users/anthony/Downloads/test/CMakeFiles/CMakeTmp/CMAKE_TRY_COMPILE.build/Debug/cmTryCompileExec1075155225.build/DerivedSources/x86_64 -I/Users/anthony/Downloads/test/CMakeFiles/CMakeTmp/CMAKE_TRY_COMPILE.build/Debug/cmTryCompileExec1075155225.build/DerivedSources -Wmost -Wno-four-char-constants -Wno-unknown-pragmas -F/Users/anthony/Downloads/test/CMakeFiles/CMakeTmp/Debug -MMD -MT dependencies -MF /Users/anthony/Downloads/test/CMakeFiles/CMakeTmp/CMAKE_TRY_COMPILE.build/Debug/cmTryCompileExec1075155225.build/Objects-normal/x86_64/testCCompiler.d --serialize-diagnostics /Users/anthony/Downloads/test/CMakeFiles/CMakeTmp/CMAKE_TRY_COMPILE.build/Debug/cmTryCompileExec1075155225.build/Objects-normal/x86_64/testCCompiler.dia -c /Users/anthony/Downloads/test/CMakeFiles/CMakeTmp/testCCompiler.c -o /Users/anthony/Downloads/test/CMakeFiles/CMakeTmp/CMAKE_TRY_COMPILE.build/Debug/cmTryCompileExec1075155225.build/Objects-normal/x86_64/testCCompiler.o



  Ld Debug/cmTryCompileExec1075155225 normal x86_64

      cd /Users/anthony/Downloads/test/CMakeFiles/CMakeTmp
      export MACOSX_DEPLOYMENT_TARGET=10.10
      /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk -L/Users/anthony/Downloads/test/CMakeFiles/CMakeTmp/Debug -F/Users/anthony/Downloads/test/CMakeFiles/CMakeTmp/Debug -filelist /Users/anthony/Downloads/test/CMakeFiles/CMakeTmp/CMAKE_TRY_COMPILE.build/Debug/cmTryCompileExec1075155225.build/Objects-normal/x86_64/cmTryCompileExec1075155225.LinkFileList -mmacosx-version-min=10.10 -Wl,-search_paths_first -Wl,-headerpad_max_install_names -force_load /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/CoreService.framework/CoreService -Xlinker -dependency_info -Xlinker /Users/anthony/Downloads/test/CMakeFiles/CMakeTmp/CMAKE_TRY_COMPILE.build/Debug/cmTryCompileExec1075155225.build/Objects-normal/x86_64/cmTryCompileExec1075155225_dependency_info.dat -o /Users/anthony/Downloads/test/CMakeFiles/CMakeTmp/Debug/cmTryCompileExec1075155225

  ld: warning: ObjC object file
  (/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/CoreService.framework/CoreService)
  was compiled for iOS Simulator, but linking for MacOSX

  ld: framework not found CoreImage for architecture x86_64

  clang: error: linker command failed with exit code 1 (use -v to see
  invocation)



  ** BUILD FAILED **





  The following build commands failed:

      Ld Debug/cmTryCompileExec1075155225 normal x86_64

  (1 failure)





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


-- Configuring incomplete, errors occurred!
See also "/Users/anthony/Downloads/test/CMakeFiles/CMakeOutput.log".
See also "/Users/anthony/Downloads/test/CMakeFiles/CMakeError.log".
Xcode
log CMakeError.log (32,800) 2015-03-19 07:46
https://public.kitware.com/Bug/file/5406/CMakeError.log
log CMakeOutput.log (40) 2015-03-19 07:46
https://public.kitware.com/Bug/file/5407/CMakeOutput.log
? project.pbxproj (2,740) 2015-03-19 08:55
https://public.kitware.com/Bug/file/5408/project.pbxproj
Issue History
2015-03-18 11:40qklxtlxNew Issue
2015-03-18 11:41qklxtlxTag Attached: Xcode
2015-03-18 15:23Brad KingNote Added: 0038243
2015-03-19 07:46qklxtlxFile Added: CMakeError.log
2015-03-19 07:46qklxtlxFile Added: CMakeOutput.log
2015-03-19 07:47qklxtlxNote Added: 0038256
2015-03-19 08:37Brad KingNote Added: 0038257
2015-03-19 08:55qklxtlxFile Added: project.pbxproj
2015-03-19 08:57qklxtlxNote Added: 0038258
2015-03-19 12:34qklxtlxNote Added: 0038260
2015-03-19 23:13qklxtlxNote Added: 0038261
2015-03-20 08:55Brad KingNote Added: 0038262
2015-03-20 08:55Brad KingStatusnew => resolved
2015-03-20 08:55Brad KingResolutionopen => no change required
2015-11-02 09:13Robert MaynardNote Added: 0039738
2015-11-02 09:13Robert MaynardStatusresolved => closed

Notes
(0038243)
Brad King   
2015-03-18 15:23   
I cannot reproduce this. I installed Xcode 6.2 and the CMake 3.2.1 Xcode generator works for me.

Look in the log files mentioned at the end of the output to see if there is more information.
(0038256)
qklxtlx   
2015-03-19 07:47   
I've posted two log files. It seems try_compile links iPhone SDK.
But I'm wondering why AppleClang is not recognised.
(0038257)
Brad King   
2015-03-19 08:37   
Re 0015455:0038256: Thanks. The logged Ld command for the compiler id is identical to mine except that yours has an extra flag:

  -force_load /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/CoreService.framework/CoreService

I don't think CMake is generating anything for that, but you can check the compiler id project file in

 CMakeFiles/3.2.1/CompilerIdC/CompilerIdC.xcodeproj/project.pbxproj

Please attach that file here.

I found a post about a similar problem here:

 http://stackoverflow.com/questions/29059858/xcode-6-2-force-load-ios-frameworks-in-osx-projects [^]
(0038258)
qklxtlx   
2015-03-19 08:57   
The SO post looks the same. I've upload project.pbxproj.
Also, I've double checked Xcode 6.2 and command line for xcode 6.2 & osx 10.10 are installed correctly.
(0038260)
qklxtlx   
2015-03-19 12:34   
Wooops, It seems xcode 6.2 is buggy :(

I recreate a new command line project and it fails with the same reason.
(0038261)
qklxtlx   
2015-03-19 23:13   
Finally I down grade to Xcode 6.1.1 and everything works.
How could I close this issue?

Thanks for your help!
(0038262)
Brad King   
2015-03-20 08:55   
Okay, thanks for reporting back.
(0039738)
Robert Maynard   
2015-11-02 09:13   
Closing resolved issues that have not been updated in more than 4 months.