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 arm-apple-darwin11-clang) 15set(CMAKE_CXX_COMPILER arm-apple-darwin11-clang++) 16 17set(_CMAKE_TOOLCHAIN_PREFIX arm-apple-darwin11-) 18 19set(CMAKE_IOS_SDK_ROOT "/home/nihui/osd/cctools-port/usage_examples/ios_toolchain/target/SDK/iPhoneOS10.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 support") 23 24# set the architecture for iOS 25# set(IOS_ARCH arm64) 26set(IOS_ARCH armv7;arm64) 27 28set(CMAKE_OSX_ARCHITECTURES ${IOS_ARCH} CACHE STRING "Build architecture for iOS") 29 30if(NOT DEFINED ENABLE_BITCODE) 31 # enable bitcode support by default 32 set(ENABLE_BITCODE TRUE CACHE BOOL "enable bitcode") 33endif() 34 35if(ENABLE_BITCODE) 36 # enable bitcode 37 set(CMAKE_C_FLAGS "-fembed-bitcode ${CMAKE_C_FLAGS}") 38 set(CMAKE_CXX_FLAGS "-fembed-bitcode ${CMAKE_CXX_FLAGS}") 39endif() 40 41# Set the find root to the iOS developer roots and to user defined paths 42set(CMAKE_FIND_ROOT_PATH ${CMAKE_IOS_DEVELOPER_ROOT} ${CMAKE_IOS_SDK_ROOT} ${CMAKE_PREFIX_PATH} CACHE STRING "iOS find search path root") 43 44# searching for frameworks only 45set(CMAKE_FIND_FRAMEWORK FIRST) 46 47# set up the default search directories for frameworks 48set(CMAKE_SYSTEM_FRAMEWORK_PATH 49 ${CMAKE_IOS_SDK_ROOT}/System/Library/Frameworks 50) 51