[CMake] XCode iPhone-3.2 and CMake fail

j j at dynamica.org
Tue Jul 27 16:45:22 EDT 2010


Hi there,

I have a CMakeLists.txt that succesfully describes a project
that can be built for XCode MACOSX10.6.sdk and Microsoft Visual
studio. So far so good. Now I'm trying to generate an XCode project
for the iPhone-3.2.sdk which doesn't seem to work.
I have the following toolchain file which seems ok to me, all paths
exist and the compilers are there, but when runfrom the CMake GUI, the
error shown below the toolchain file is presented, and I can't begin to
think where I should look.

Hence my mail. Thanks to anyone who can shed some light on this.

Jochem

---------------------------------------
# Michael Aaron Safyan (michaelsafyan at gmail.com). Copyright (C) 2009-2010.
Simplified BSD License.
SET (CMAKE_SYSTEM_NAME Generic)
SET (CMAKE_SYSTEM_VERSION 1)
SET (CMAKE_SYSTEM_PROCESSOR arm)
SET_PROPERTY(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS TRUE)

SET (SDKVER "3.2")
SET (DEVROOT "/Developer/Platforms/iPhoneOS.platform/Developer")
SET (SDKROOT "${DEVROOT}/SDKs/iPhoneOS${SDKVER}.sdk")
SET (CMAKE_OSX_SYSROOT "${SDKROOT}")
SET (CMAKE_OSX_ARCHITECTURES "armv6" "armv7")

SET (CMAKE_C_COMPILER "${DEVROOT}/usr/bin/gcc-4.2")
SET (CMAKE_CXX_COMPILER "${DEVROOT}/usr/bin/g++-4.2")

SET (CMAKE_C_COMPILER "${DEVROOT}/usr/bin/gcc-4.2")
SET (CMAKE_CXX_COMPILER "${DEVROOT}/usr/bin/g++-4.2")

SET (CMAKE_C_FLAGS "-std=c99" "-x objective-c")
SET (CMAKE_C_FLAGS_DEBUG ${CMAKE_C_FLAGS} "-DDEBUG=1" "-ggdb")
SET (CMAKE_C_FLAGS_RELEASE ${CMAKE_C_FLAGS} "-DNDEBUG=1")
SET (CMAKE_C_FLAGS_RELWITHDEBINFO ${CMAKE_C_FLAGS} "-DNDEBUG=1" "-ggdb")

SET (CMAKE_CXX_FLAGS "-x objective-c++")
SET (CMAKE_CXX_FLAGS_DEBUG ${CMAKE_CXX_FLAGS} "-DDEBUG=1" "-ggdb")
SET (CMAKE_CXX_FLAGS_RELEASE ${CMAKE_CXX_FLAGS} "-DNDEBUG=1")
SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO ${CMAKE_CXX_FLAGS} "-DNDEBUG=1"
"-ggdb")

ADD_DEFINITIONS("-arch armv6")
ADD_DEFINITIONS("-arch armv7")
ADD_DEFINITIONS("-pipe")
ADD_DEFINITIONS("-no-cpp-precomp")
ADD_DEFINITIONS("--sysroot=${SDKROOT}")
ADD_DEFINITIONS("-miphoneos-version-min=${SDKVER}")

INCLUDE_DIRECTORIES(SYSTEM "${SDKROOT}/usr/include")
INCLUDE_DIRECTORIES(SYSTEM "${SDKROOT}/opt/iphone-${SDKVER}/include")
INCLUDE_DIRECTORIES(SYSTEM
"${SDKROOT}/usr/local/iphone-${SDKVER}/include")

LINK_DIRECTORIES("${SDKROOT}/usr/lib")
LINK_DIRECTORIES("${SDKROOT}/opt/iphone-${SDKVER}/lib")
LINK_DIRECTORIES("${SDKROOT}/usr/local/iphone-${SDKVER}/lib")

SET (CMAKE_FIND_ROOT_PATH "${SDKROOT}" "/opt/iphone-${SDKVER}/"
"/usr/local/iphone-${SDKVER}/")
SET (CMAKE_FIND_ROOT_PATH_MODE_PROGRAM BOTH)
SET (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

SET (iPhone 1)
SET (iPhoneOS 1)
SET (iPhoneOS_VERSION ${SDKVER})

----------------------------

The C compiler identification is GNU
The CXX compiler identification is GNU
Check for working C compiler using: Xcode
Check for working C compiler using: Xcode -- broken
CMake Error at /Applications/CMake
2.8-2.app/Contents/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:52
(MESSAGE):
   The C compiler
   "/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc-4.2" is
not
   able to compile a simple test program.

   It fails with the following output:

    Change Dir:
/Volumes/DATA/development/iNeen/build/iphone-3.2/CMakeFiles/CMakeTmp



   Run Build Command:/Applications/CMake\
2.8-2.app/Contents/bin/cmakexbuild
   -project CMAKE_TRY_COMPILE.xcodeproj build -target cmTryCompileExec
   -configuration Debug

   ** BUILD FAILED **





   === BUILD NATIVE TARGET cmTryCompileExec 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

   target specifies product type 'com.apple.product-type.tool', but there's
no
   such product type for the 'iphoneos' platform





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

-------------------------------------







More information about the CMake mailing list