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
25# set(IOS_ARCH i386)
26# set(IOS_ARCH x86_64)
27set(IOS_ARCH i386;x86_64)
28
29set(CMAKE_OSX_ARCHITECTURES ${IOS_ARCH} CACHE STRING "Build architecture for iOS Simulator")
30
31if(NOT DEFINED ENABLE_BITCODE)
32    # enable bitcode support by default
33    set(ENABLE_BITCODE TRUE CACHE BOOL "enable bitcode")
34endif()
35
36if(ENABLE_BITCODE)
37    # enable bitcode
38    set(CMAKE_C_FLAGS "-fembed-bitcode ${CMAKE_C_FLAGS}")
39    set(CMAKE_CXX_FLAGS "-fembed-bitcode ${CMAKE_CXX_FLAGS}")
40endif()
41
42# Set the find root to the iOS developer roots and to user defined paths
43set(CMAKE_FIND_ROOT_PATH ${CMAKE_IOS_DEVELOPER_ROOT} ${CMAKE_IOS_SDK_ROOT} ${CMAKE_PREFIX_PATH} CACHE STRING "iOS Simulator find search path root")
44
45# searching for frameworks only
46set(CMAKE_FIND_FRAMEWORK FIRST)
47
48# set up the default search directories for frameworks
49set(CMAKE_SYSTEM_FRAMEWORK_PATH
50    ${CMAKE_IOS_SDK_ROOT}/System/Library/Frameworks
51)
52