CMake fails to generate iOS Xcode project (tried both Xcode 7 and 8)
cmake -G Xcode -DCMAKE_OSX_SYSROOT=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.3.sdk ../
Fails with:
-- The C compiler identification is AppleClang 7.3.0.7030031
-- The CXX compiler identification is AppleClang 7.3.0.7030031
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -- broken
CMake Error at /Applications/CMake.app/Contents/share/cmake-3.6/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/Administrator/projects/dlib/build/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/xcodebuild" "-project"
"CMAKE_TRY_COMPILE.xcodeproj" "build" "-target" "cmTC_a198d"
"-configuration" "Debug"
=== BUILD TARGET cmTC_a198d OF PROJECT CMAKE_TRY_COMPILE WITH CONFIGURATION
Debug ===
Check dependencies
target specifies product type 'com.apple.product-type.tool', but there's no
such product type for the 'iphoneos' platform
** BUILD FAILED **
The following build commands failed:
Check dependencies
(1 failure)
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt
CMakeError.log: http://pastebin.com/raw/EaAF3pj4 CMakeOutput.log: http://pastebin.com/raw/at8rANWJ