1# Standard settings 2# set(UNIX True) 3# set(Darwin True) 4# set(IOS True) 5set (CMAKE_SYSTEM_NAME Darwin) 6set (CMAKE_SYSTEM_VERSION 1) 7set (UNIX True) 8set (APPLE True) 9set (IOS True) 10 11# suppress -rdynamic 12# set(CMAKE_SYSTEM_NAME Generic) 13 14set(CMAKE_C_COMPILER i386-apple-darwin11-clang) 15set(CMAKE_CXX_COMPILER i386-apple-darwin11-clang++) 16 17set(_CMAKE_TOOLCHAIN_PREFIX i386-apple-darwin11-) 18 19set(CMAKE_IOS_SDK_ROOT "/home/nihui/osd/cctools-port/usage_examples/ios_toolchain/target-sim/SDK/iPhoneSimulator10.2.sdk") 20 21# Set the sysroot default to the most recent SDK 22set(CMAKE_OSX_SYSROOT ${CMAKE_IOS_SDK_ROOT} CACHE PATH "Sysroot used for iOS Simulator support") 23 24# set the architecture for iOS 25set(IOS_ARCH x86_64) 26 27set(CMAKE_OSX_ARCHITECTURES ${IOS_ARCH} CACHE STRING "Build architecture for iOS Simulator") 28 29if(NOT DEFINED ENABLE_BITCODE) 30 # enable bitcode support by default 31 set(ENABLE_BITCODE TRUE CACHE BOOL "enable bitcode") 32endif() 33 34if(ENABLE_BITCODE) 35 # enable bitcode 36 set(CMAKE_C_FLAGS "-fembed-bitcode ${CMAKE_C_FLAGS}") 37 set(CMAKE_CXX_FLAGS "-fembed-bitcode ${CMAKE_CXX_FLAGS}") 38endif() 39 40# Set the find root to the iOS developer roots and to user defined paths 41set(CMAKE_FIND_ROOT_PATH ${CMAKE_IOS_DEVELOPER_ROOT} ${CMAKE_IOS_SDK_ROOT} ${CMAKE_PREFIX_PATH} CACHE STRING "iOS Simulator find search path root") 42 43# searching for frameworks only 44set(CMAKE_FIND_FRAMEWORK FIRST) 45 46# set up the default search directories for frameworks 47set(CMAKE_SYSTEM_FRAMEWORK_PATH 48 ${CMAKE_IOS_SDK_ROOT}/System/Library/Frameworks 49) 50