[CMake] CMake 2.4.6 and Xcode 4.2 on Mac OS X 10.7

Daniel Dekkers d.dekkers at cthrough.nl
Thu Nov 10 09:58:25 EST 2011


>> In reality, the Xcode generator only works 100% reliably well when you
>> do not try to specify the compiler, and let Xcode use the one it wants
>> to use by default.

Hm…

But we still want to build for iOS. There isn't really a problem with that in Xcode 4.2/Lion/iOS5.0/CMake2.8-6 in my experience.
We now have this as "toolchain" (but actually, just included):

...
IF ( RT_IOS)
	SET (CMAKE_SYSTEM_NAME Generic)
	SET (CMAKE_SYSTEM_VERSION 1)
	SET (CMAKE_SYSTEM_PROCESSOR arm)

	SET (RT_SDKVER "5.0" CACHE PATH "iOS SDK version" )
	SET (DEVROOT "/Developer/Platforms/iPhoneOS.platform/Developer")
	SET (SDKROOT "${DEVROOT}/SDKs/iPhoneOS${RT_SDKVER}.sdk")

	SET (CMAKE_OSX_SYSROOT "${SDKROOT}")
	SET (CMAKE_OSX_ARCHITECTURES "$(ARCHS_UNIVERSAL_IPHONE_OS)") # Either "$(ARCHS_UNIVERSAL_IPHONE_OS)" or "arm6" "arm7"

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

	# SET (CMAKE_FIND_ROOT_PATH "${DEVELOPMENT_ROOT}" "/opt/iphone-${RT_SDKVER}/" "/usr/local/iphone-${RT_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)
ENDIF()
…

So you propose we skip specifying the compiler altogether? Remove:

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

Wasn't sure if this worked anyway. 
I see now Xcode is just using the default compiler (Apple LLVM Compiler (3.0)) instead of LLVM GCC 3.0.

Thanks,
Daniel



More information about the CMake mailing list