@ -1,270 +1,726 @@
# i O S . c m a k e
# T h i s f i l e i s p a r t o f t h e i o s - c m a k e p r o j e c t . I t w a s r e t r i e v e d f r o m
# h t t p s : / / g i t h u b . c o m / c r i s t e a b / i o s - c m a k e . g i t , w h i c h i s a f o r k o f
# h t t p s : / / c o d e . g o o g l e . c o m / p / i o s - c m a k e / . W h i c h i n t u r n i s b a s e d o f f o f
# t h e P l a t f o r m / D a r w i n . c m a k e a n d P l a t f o r m / U n i x P a t h s . c m a k e f i l e s w h i c h
# a r e i n c l u d e d w i t h C M a k e 2 . 8 . 4
#
# Copyright ( C ) 2 0 1 4 - 2 0 2 0 b y
# D a v i d T u r n e r , R o b e r t W i l h e l m , a n d W e r n e r L e m b e r g .
# T h e i o s - c m a k e p r o j e c t i s l i c e n s e d u n d e r t h e n e w B S D l i c e n s e .
#
# W r i t t e n b y D a v i d W i m s e y < d a v i d @ w i m s e y . u s >
# Copyright ( c ) 2 0 1 4 , B o g d a n C r i s t e a a n d L T E E n g i n e e r i n g S o f t w a r e ,
# K i t w a r e , I n c . , I n s i g h t S o f t w a r e C o n s o r t i u m . A l l r i g h t s r e s e r v e d .
# R e d i s t r i b u t i o n a n d u s e i n s o u r c e a n d b i n a r y f o r m s , w i t h o r w i t h o u t
# m o d i f i c a t i o n , a r e p e r m i t t e d p r o v i d e d t h a t t h e f o l l o w i n g c o n d i t i o n s
# a r e m e t :
# 1 . R e d i s t r i b u t i o n s o f s o u r c e c o d e m u s t r e t a i n t h e a b o v e c o p y r i g h t
# n o t i c e , t h i s l i s t o f c o n d i t i o n s a n d t h e f o l l o w i n g d i s c l a i m e r .
#
# T h i s f i l e i s p a r t o f t h e F r e e T y p e p r o j e c t , a n d m a y o n l y b e u s e d , m o d i f i e d ,
# a n d d i s t r i b u t e d u n d e r t h e t e r m s o f t h e F r e e T y p e p r o j e c t l i c e n s e ,
# L I C E N S E . T X T . B y c o n t i n u i n g t o u s e , m o d i f y , o r d i s t r i b u t e t h i s f i l e y o u
# i n d i c a t e t h a t y o u h a v e r e a d t h e l i c e n s e a n d u n d e r s t a n d a n d a c c e p t i t
# f u l l y .
# 2 . R e d i s t r i b u t i o n s i n b i n a r y f o r m m u s t r e p r o d u c e t h e a b o v e c o p y r i g h t
# n o t i c e , t h i s l i s t o f c o n d i t i o n s a n d t h e f o l l o w i n g d i s c l a i m e r i n t h e
# d o c u m e n t a t i o n a n d / o r o t h e r m a t e r i a l s p r o v i d e d w i t h t h e d i s t r i b u t i o n .
#
# 3 . N e i t h e r t h e n a m e o f t h e c o p y r i g h t h o l d e r n o r t h e n a m e s o f i t s
# c o n t r i b u t o r s m a y b e u s e d t o e n d o r s e o r p r o m o t e p r o d u c t s d e r i v e d f r o m
# t h i s s o f t w a r e w i t h o u t s p e c i f i c p r i o r w r i t t e n p e r m i s s i o n .
#
# T h i s f i l e i s d e r i v e d f r o m t h e f i l e s ` P l a t f o r m / D a r w i n . c m a k e ' a n d
# ` P l a t f o r m / U n i x P a t h s . c m a k e ' , w h i c h a r e p a r t o f C M a k e 2 . 8 . 4 . I t h a s b e e n
# a l t e r e d f o r i O S d e v e l o p m e n t .
# O p t i o n s
# - - - - - - -
# T H I S S O F T W A R E I S P R O V I D E D B Y T H E C O P Y R I G H T H O L D E R S A N D C O N T R I B U T O R S
# " A S I S " A N D A N Y E X P R E S S O R I M P L I E D W A R R A N T I E S , I N C L U D I N G , B U T N O T
# L I M I T E D T O , T H E I M P L I E D W A R R A N T I E S O F M E R C H A N T A B I L I T Y A N D F I T N E S S
# F O R A P A R T I C U L A R P U R P O S E A R E D I S C L A I M E D . I N N O E V E N T S H A L L T H E
# C O P Y R I G H T H O L D E R O R C O N T R I B U T O R S B E L I A B L E F O R A N Y D I R E C T , I N D I R E C T ,
# I N C I D E N T A L , S P E C I A L , E X E M P L A R Y , O R C O N S E Q U E N T I A L DAMAGES ( INCLUDING,
# B U T N O T L I M I T E D T O , P R O C U R E M E N T O F S U B S T I T U T E G O O D S O R S E R V I C E S ;
# L O S S O F U S E , D A T A , O R P R O F I T S ; O R B U S I N E S S I N T E R R U P T I O N ) H O W E V E R
# C A U S E D A N D O N A N Y T H E O R Y O F L I A B I L I T Y , W H E T H E R I N C O N T R A C T , S T R I C T
# L I A B I L I T Y , O R TORT ( INCLUDING NEGLIGENCE OR OTHERWISE ) A R I S I N G I N
# A N Y W A Y O U T O F T H E U S E O F T H I S S O F T W A R E , E V E N I F A D V I S E D O F T H E
# P O S S I B I L I T Y O F S U C H D A M A G E .
#
# T h i s f i l e i s b a s e d o f f o f t h e P l a t f o r m / D a r w i n . c m a k e a n d
# P l a t f o r m / U n i x P a t h s . c m a k e f i l e s w h i c h a r e i n c l u d e d w i t h C M a k e 2 . 8 . 4
# I t h a s b e e n a l t e r e d f o r i O S d e v e l o p m e n t .
#
# U p d a t e d b y A l e x Stewart ( alexs.mac@gmail.com )
#
# * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
# N o w m a i n t a i n e d b y A l e x a n d e r Widerberg ( widerbergaren [at] gmail.com )
# u n d e r t h e B S D - 3 - C l a u s e l i c e n s e
# h t t p s : / / g i t h u b . c o m / l e e t a l / i o s - c m a k e
# * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
#
# I N F O R M A T I O N / H E L P
#
# T h e f o l l o w i n g a r g u m e n t s c o n t r o l t h e b e h a v i o u r o f t h i s t o o l c h a i n :
#
# P L A T F O R M : ( d e f a u l t " O S " )
# O S = B u i l d f o r i P h o n e O S .
# O S 6 4 = B u i l d f o r a r m 6 4 i p h o n e O S .
# O S 6 4 C O M B I N E D = B u i l d f o r a r m 6 4 x 8 6 _ 6 4 i p h o n e O S . C o m b i n e d i n t o F A T S T A T I C lib ( supported on 3.14+ of CMakewith "-G Xcode" argument ONLY )
# S I M U L A T O R = B u i l d f o r x 8 6 i 3 8 6 i p h o n e O S S i m u l a t o r .
# S I M U L A T O R 6 4 = B u i l d f o r x 8 6 _ 6 4 i p h o n e O S S i m u l a t o r .
# T V O S = B u i l d f o r a r m 6 4 t v O S .
# T V O S C O M B I N E D = B u i l d f o r a r m 6 4 x 8 6 _ 6 4 t v O S . C o m b i n e d i n t o F A T S T A T I C lib ( supported on 3.14+ of CMake with "-G Xcode" argument ONLY )
# S I M U L A T O R _ T V O S = B u i l d f o r x 8 6 _ 6 4 t v O S S i m u l a t o r .
# W A T C H O S = B u i l d f o r a r m v 7 k a r m 6 4 _ 3 2 f o r w a t c h O S .
# W A T C H O S C O M B I N E D = B u i l d f o r a r m v 7 k a r m 6 4 _ 3 2 x 8 6 _ 6 4 w a t c h O S . C o m b i n e d i n t o F A T S T A T I C lib ( supported on 3.14+ of CMake with "-G Xcode" argument ONLY )
# S I M U L A T O R _ W A T C H O S = B u i l d f o r x 8 6 _ 6 4 f o r w a t c h O S S i m u l a t o r .
#
# C M A K E _ O S X _ S Y S R O O T : P a t h t o t h e S D K t o u s e . B y d e f a u l t t h i s i s
# a u t o m a t i c a l l y d e t e r m i n e d f r o m P L A T F O R M a n d x c o d e b u i l d , b u t
# c a n a l s o b e m a n u a l l y specified ( although this should not be required ) .
#
# I O S _ P L A T F O R M = O S | S I M U L A T O R
# C M A K E _ D E V E L O P E R _ R O O T : P a t h t o t h e D e v e l o p e r d i r e c t o r y f o r t h e p l a t f o r m
# b e i n g c o m p i l e d f o r . B y d e f a u l t t h i s i s a u t o m a t i c a l l y d e t e r m i n e d f r o m
# C M A K E _ O S X _ S Y S R O O T , b u t c a n a l s o b e m a n u a l l y specified ( although this should
# n o t b e r e q u i r e d ) .
#
# T h i s d e c i d e s w h e t h e r S D K S a r e s e l e c t e d f r o m t h e ` i P h o n e O S . p l a t f o r m ' o r
# ` i P h o n e S i m u l a t o r . p l a t f o r m ' f o l d e r s .
# D E P L O Y M E N T _ T A R G E T : M i n i m u m S D K v e r s i o n t o t a r g e t . D e f a u l t 2 . 0 o n w a t c h O S a n d 9 . 0 o n t v O S + i O S
#
# O S - t h e d e f a u l t , u s e d t o b u i l d f o r i P h o n e a n d i P a d p h y s i c a l d e v i c e s ,
# w h i c h h a v e a n A R M a r c h i t e c t u r e .
# S I M U L A T O R - u s e d t o b u i l d f o r t h e S i m u l a t o r p l a t f o r m s , w h i c h h a v e a n
# x 8 6 a r c h i t e c t u r e .
# E N A B L E _ B I T C O D E : ( 1 | 0 ) E n a b l e s o r d i s a b l e s b i t c o d e s u p p o r t . D e f a u l t 1 ( true )
#
# C M A K E _ I O S _ D E V E L O P E R _ R O O T = / p a t h / t o / p l a t f o r m / D e v e l o p e r f o l d e r
# E N A B L E _ A R C : ( 1 | 0 ) E n a b l e s o r d i s a b l e s A R C s u p p o r t . D e f a u l t 1 ( true, ARC enabled by default )
#
# B y d e f a u l t , t h i s l o c a t i o n i s a u t o m a t i c a l l y c h o s e n b a s e d o n t h e
# I O S _ P L A T F O R M v a l u e a b o v e . I f y o u m a n u a l l y s e t t h i s v a r i a b l e , i t
# o v e r r i d e s t h e d e f a u l t l o c a t i o n a n d f o r c e s t h e u s e o f a p a r t i c u l a r
# D e v e l o p e r P l a t f o r m .
# E N A B L E _ V I S I B I L I T Y : ( 1 | 0 ) E n a b l e s o r d i s a b l e s s y m b o l v i s i b i l i t y s u p p o r t . D e f a u l t 0 ( false, visibility hidden by default )
#
# C M A K E _ I O S _ S D K _ R O O T = / p a t h / t o / p l a t f o r m / D e v e l o p e r / S D K s / S D K f o l d e r
# E N A B L E _ S T R I C T _ T R Y _ C O M P I L E : ( 1 | 0 ) E n a b l e s o r d i s a b l e s s t r i c t try_compile ( ) o n a l l C h e c k * directives ( will run linker
# t o a c t u a l l y c h e c k i f l i n k i n g i s p o s s i b l e ) . D e f a u l t 0 ( false, will set CMAKE_TRY_COMPILE_TARGET_TYPE to STATIC_LIBRARY )
#
# B y d e f a u l t , t h i s l o c a t i o n i s a u t o m a t i c a l l y c h o s e n b a s e d o n t h e
# C M A K E _ I O S _ D E V E L O P E R _ R O O T v a l u e . I n t h i s c a s e i t i s a l w a y s t h e m o s t
# u p - t o - d a t e S D K f o u n d i n t h e C M A K E _ I O S _ D E V E L O P E R _ R O O T p a t h . I f y o u
# m a n u a l l y s e t t h i s v a r i a b l e , i t f o r c e s t h e u s e o f a s p e c i f i c S D K
# v e r s i o n .
# A R C H S : ( a r m v 7 a r m v 7 s a r m v 7 k a r m 6 4 a r m 6 4 _ 3 2 i 3 8 6 x 8 6 _ 6 4 ) I f s p e c i f i e d , w i l l o v e r r i d e t h e d e f a u l t a r c h i t e c t u r e s f o r t h e g i v e n P L A T F O R M
# O S = a r m v 7 a r m v 7 s arm64 ( if applicable )
# O S 6 4 = arm64 ( if applicable )
# S I M U L A T O R = i 3 8 6
# S I M U L A T O R 6 4 = x 8 6 _ 6 4
# T V O S = a r m 6 4
# S I M U L A T O R _ T V O S = x86_64 ( i386 has since long been deprecated )
# W A T C H O S = a r m v 7 k arm64_32 ( if applicable )
# S I M U L A T O R _ W A T C H O S = x86_64 ( i386 has since long been deprecated )
#
# T h i s t o o l c h a i n d e f i n e s t h e f o l l o w i n g v a r i a b l e s f o r u s e e x t e r n a l l y :
#
# M a c r o s
# - - - - - -
# X C O D E _ V E R S I O N : V e r s i o n number ( not including Build version ) o f X c o d e d e t e c t e d .
# S D K _ V E R S I O N : V e r s i o n o f S D K b e i n g u s e d .
# C M A K E _ O S X _ A R C H I T E C T U R E S : A r c h i t e c t u r e s b e i n g c o m p i l e d for ( generated from PLATFORM ) .
# A P P L E _ T A R G E T _ T R I P L E : U s e d b y a u t o c o n f b u i l d s y s t e m s . N O T E : I f " A R C H S " a r e o v e r r i d d e n , t h i s w i l l * N O T * b e s e t !
#
# set_xcode_property ( TARGET XCODE_PROPERTY XCODE_VALUE )
# T h i s t o o l c h a i n d e f i n e s t h e f o l l o w i n g m a c r o s f o r u s e e x t e r n a l l y :
#
# A c o n v e n i e n c e m a c r o f o r s e t t i n g X c o d e s p e c i f i c p r o p e r t i e s o n t a r g e t s .
# set_xcode_property ( TARGET XCODE_PROPERTY XCODE_VALUE XCODE_VARIANT )
# A c o n v e n i e n c e m a c r o f o r s e t t i n g x c o d e s p e c i f i c p r o p e r t i e s o n t a r g e t s .
# A v a i l a b l e v a r i a n t s a r e : A l l , R e l e a s e , R e l W i t h D e b I n f o , D e b u g , M i n S i z e R e l
# e x a m p l e : set_xcode_property ( myioslib IPHONEOS_DEPLOYMENT_TARGET "3.1" "all" ) .
#
# E x a m p l e :
# find_host_package ( PROGRAM ARGS )
# A m a c r o u s e d t o f i n d e x e c u t a b l e p r o g r a m s o n t h e h o s t s y s t e m , n o t w i t h i n t h e
# e n v i r o n m e n t . T h a n k s t o t h e a n d r o i d - c m a k e p r o j e c t f o r p r o v i d i n g t h e
# c o m m a n d .
#
# set_xcode_property ( myioslib IPHONEOS_DEPLOYMENT_TARGET "3.1" )
# * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * D E P R E C A T I O N S * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
#
# find_host_package ( PROGRAM ARGS )
# I O S _ D E P L O Y M E N T _ T A R G E T : ( D e p r e c a t e d ) A l i a s t o D E P L O Y M E N T _ T A R G E T
# C M A K E _ I O S _ D E V E L O P E R _ R O O T : ( D e p r e c a t e d ) A l i a s t o C M A K E _ D E V E L O P E R _ R O O T
# I O S _ P L A T F O R M : ( D e p r e c a t e d ) A l i a s t o P L A T F O R M
# I O S _ A R C H : ( D e p r e c a t e d ) A l i a s t o A R C H S
#
# A m a c r o t o f i n d e x e c u t a b l e p r o g r a m s o n t h e h o s t s y s t e m , n o t w i t h i n t h e
# i O S e n v i r o n m e n t . T h a n k s t o t h e ` a n d r o i d - c m a k e ' p r o j e c t f o r p r o v i d i n g
# t h e c o m m a n d .
# s t a n d a r d s e t t i n g s
set ( CMAKE_SYSTEM_NAME Darwin )
set ( CMAKE_SYSTEM_VERSION 1 )
set ( UNIX True )
set ( APPLE True )
set ( IOS True )
# r e q u i r e d a s o f c m a k e 2 . 8 . 1 0
set ( CMAKE_OSX_DEPLOYMENT_TARGET ""
C A C H E S T R I N G " F o r c e u n s e t o f t h e d e p l o y m e n t t a r g e t f o r i O S " F O R C E
)
# d e t e r m i n e t h e c m a k e h o s t s y s t e m v e r s i o n s o w e k n o w w h e r e t o f i n d t h e i O S
# S D K s
find_program ( CMAKE_UNAME uname /bin /usr/bin /usr/local/bin )
if ( CMAKE_UNAME )
exec_program ( uname ARGS -r OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_VERSION )
string ( REGEX REPLACE "^([0-9]+)\\.([0-9]+).*$" "\\1"
D A R W I N _ M A J O R _ V E R S I O N " $ { C M A K E _ H O S T _ S Y S T E M _ V E R S I O N } " )
endif ( CMAKE_UNAME )
# s k i p t h e p l a t f o r m c o m p i l e r c h e c k s f o r c r o s s c o m p i l i n g
set ( CMAKE_CXX_COMPILER_WORKS TRUE )
set ( CMAKE_C_COMPILER_WORKS TRUE )
# a l l i O S / D a r w i n s p e c i f i c s e t t i n g s - s o m e m a y b e r e d u n d a n t
# * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
#
# F i x f o r P T h r e a d l i b r a r y n o t i n p a t h
set ( CMAKE_THREAD_LIBS_INIT "-lpthread" )
set ( CMAKE_HAVE_THREADS_LIBRARY 1 )
set ( CMAKE_USE_WIN32_THREADS_INIT 0 )
set ( CMAKE_USE_PTHREADS_INIT 1 )
# C a c h e w h a t g e n e r a t o r i s u s e d
set ( USED_CMAKE_GENERATOR "${CMAKE_GENERATOR}" CACHE STRING "Expose CMAKE_GENERATOR" FORCE )
if ( ${ CMAKE_VERSION } VERSION_GREATER_EQUAL "3.14" )
set ( MODERN_CMAKE YES )
endif ( )
# G e t t h e X c o d e v e r s i o n b e i n g u s e d .
execute_process ( COMMAND xcodebuild -version
O U T P U T _ V A R I A B L E X C O D E _ V E R S I O N
E R R O R _ Q U I E T
O U T P U T _ S T R I P _ T R A I L I N G _ W H I T E S P A C E )
string ( REGEX MATCH "Xcode [0-9\\.]+" XCODE_VERSION "${XCODE_VERSION}" )
string ( REGEX REPLACE "Xcode ([0-9\\.]+)" "\\1" XCODE_VERSION "${XCODE_VERSION}" )
# # # # # # # # ALIASES ( DEPRECATION WARNINGS )
if ( DEFINED IOS_PLATFORM )
set ( PLATFORM ${ IOS_PLATFORM } )
message ( DEPRECATION "IOS_PLATFORM argument is DEPRECATED. Consider using the new PLATFORM argument instead." )
endif ( )
if ( DEFINED IOS_DEPLOYMENT_TARGET )
set ( DEPLOYMENT_TARGET ${ IOS_DEPLOYMENT_TARGET } )
message ( DEPRECATION "IOS_DEPLOYMENT_TARGET argument is DEPRECATED. Consider using the new DEPLOYMENT_TARGET argument instead." )
endif ( )
if ( DEFINED CMAKE_IOS_DEVELOPER_ROOT )
set ( CMAKE_DEVELOPER_ROOT ${ CMAKE_IOS_DEVELOPER_ROOT } )
message ( DEPRECATION "CMAKE_IOS_DEVELOPER_ROOT argument is DEPRECATED. Consider using the new CMAKE_DEVELOPER_ROOT argument instead." )
endif ( )
if ( DEFINED IOS_ARCH )
set ( ARCHS ${ IOS_ARCH } )
message ( DEPRECATION "IOS_ARCH argument is DEPRECATED. Consider using the new ARCHS argument instead." )
endif ( )
# # # # # # # # E N D A L I A S E S
# U n s e t t h e F O R C E o n c a c h e v a r i a b l e s i f i n try_compile ( )
set ( FORCE_CACHE FORCE )
get_property ( _CMAKE_IN_TRY_COMPILE GLOBAL PROPERTY IN_TRY_COMPILE )
if ( _CMAKE_IN_TRY_COMPILE )
unset ( FORCE_CACHE )
endif ( )
# D e f a u l t t o b u i l d i n g f o r i P h o n e O S i f n o t s p e c i f i e d o t h e r w i s e , a n d w e c a n n o t
# d e t e r m i n e t h e p l a t f o r m f r o m t h e C M A K E _ O S X _ A R C H I T E C T U R E S v a r i a b l e . T h e u s e
# o f C M A K E _ O S X _ A R C H I T E C T U R E S i s s u c h t h a t try_compile ( ) p r o j e c t s c a n c o r r e c t l y
# d e t e r m i n e t h e v a l u e o f P L A T F O R M f r o m t h e r o o t p r o j e c t , a s
# C M A K E _ O S X _ A R C H I T E C T U R E S i s p r o p a g a t e d t o t h e m b y C M a k e .
if ( NOT DEFINED PLATFORM )
if ( CMAKE_OSX_ARCHITECTURES )
if ( CMAKE_OSX_ARCHITECTURES MATCHES ".*arm.*" AND CMAKE_OSX_SYSROOT MATCHES ".*iphoneos.*" )
set ( PLATFORM "OS" )
elseif ( CMAKE_OSX_ARCHITECTURES MATCHES "i386" AND CMAKE_OSX_SYSROOT MATCHES ".*iphonesimulator.*" )
set ( PLATFORM "SIMULATOR" )
elseif ( CMAKE_OSX_ARCHITECTURES MATCHES "x86_64" AND CMAKE_OSX_SYSROOT MATCHES ".*iphonesimulator.*" )
set ( PLATFORM "SIMULATOR64" )
elseif ( CMAKE_OSX_ARCHITECTURES MATCHES "arm64" AND CMAKE_OSX_SYSROOT MATCHES ".*appletvos.*" )
set ( PLATFORM "TVOS" )
elseif ( CMAKE_OSX_ARCHITECTURES MATCHES "x86_64" AND CMAKE_OSX_SYSROOT MATCHES ".*appletvsimulator.*" )
set ( PLATFORM "SIMULATOR_TVOS" )
elseif ( CMAKE_OSX_ARCHITECTURES MATCHES ".*armv7k.*" AND CMAKE_OSX_SYSROOT MATCHES ".*watchos.*" )
set ( PLATFORM "WATCHOS" )
elseif ( CMAKE_OSX_ARCHITECTURES MATCHES "i386" AND CMAKE_OSX_SYSROOT MATCHES ".*watchsimulator.*" )
set ( PLATFORM "SIMULATOR_WATCHOS" )
endif ( )
endif ( )
if ( NOT PLATFORM )
set ( PLATFORM "OS" )
endif ( )
endif ( )
set ( PLATFORM_INT "${PLATFORM}" CACHE STRING "Type of platform for which the build targets." )
# H a n d l e t h e c a s e w h e r e w e a r e t a r g e t i n g i O S a n d a v e r s i o n a b o v e 1 0 . 3 . 4 ( 32-bit support dropped officially )
if ( PLATFORM_INT STREQUAL "OS" AND DEPLOYMENT_TARGET VERSION_GREATER_EQUAL 10.3.4 )
set ( PLATFORM_INT "OS64" )
message ( STATUS "Targeting minimum SDK version ${DEPLOYMENT_TARGET}. Dropping 32-bit support." )
elseif ( PLATFORM_INT STREQUAL "SIMULATOR" AND DEPLOYMENT_TARGET VERSION_GREATER_EQUAL 10.3.4 )
set ( PLATFORM_INT "SIMULATOR64" )
message ( STATUS "Targeting minimum SDK version ${DEPLOYMENT_TARGET}. Dropping 32-bit support." )
endif ( )
# D e t e r m i n e t h e p l a t f o r m n a m e a n d a r c h i t e c t u r e s f o r u s e i n x c o d e b u i l d c o m m a n d s
# f r o m t h e s p e c i f i e d P L A T F O R M n a m e .
if ( PLATFORM_INT STREQUAL "OS" )
set ( SDK_NAME iphoneos )
if ( NOT ARCHS )
set ( ARCHS armv7 armv7s arm64 )
set ( APPLE_TARGET_TRIPLE_INT arm-apple-ios )
endif ( )
elseif ( PLATFORM_INT STREQUAL "OS64" )
set ( SDK_NAME iphoneos )
if ( NOT ARCHS )
if ( XCODE_VERSION VERSION_GREATER 10.0 )
set ( ARCHS arm64 ) # A d d a r m 6 4 e w h e n A p p l e h a v e f i x e d t h e i n t e g r a t i o n i s s u e s w i t h i t , l i b a r c l i t e _ i p h o n e o s . a i s c u r r e n t l y m i s s u n g b i t c o d e m a r k e r s f o r e x a m p l e
else ( )
set ( ARCHS arm64 )
endif ( )
set ( APPLE_TARGET_TRIPLE_INT aarch64-apple-ios )
endif ( )
elseif ( PLATFORM_INT STREQUAL "OS64COMBINED" )
set ( SDK_NAME iphoneos )
if ( MODERN_CMAKE )
if ( NOT ARCHS )
if ( XCODE_VERSION VERSION_GREATER 10.0 )
set ( ARCHS arm64 x86_64 ) # A d d a r m 6 4 e w h e n A p p l e h a v e f i x e d t h e i n t e g r a t i o n i s s u e s w i t h i t , l i b a r c l i t e _ i p h o n e o s . a i s c u r r e n t l y m i s s u n g b i t c o d e m a r k e r s f o r e x a m p l e
else ( )
set ( ARCHS arm64 x86_64 )
endif ( )
set ( APPLE_TARGET_TRIPLE_INT aarch64-x86_64-apple-ios )
endif ( )
else ( )
message ( FATAL_ERROR "Please make sure that you are running CMake 3.14+ to make the OS64COMBINED setting work" )
endif ( )
elseif ( PLATFORM_INT STREQUAL "SIMULATOR" )
set ( SDK_NAME iphonesimulator )
if ( NOT ARCHS )
set ( ARCHS i386 )
set ( APPLE_TARGET_TRIPLE_INT i386-apple-ios )
endif ( )
message ( DEPRECATION "SIMULATOR IS DEPRECATED. Consider using SIMULATOR64 instead." )
elseif ( PLATFORM_INT STREQUAL "SIMULATOR64" )
set ( SDK_NAME iphonesimulator )
if ( NOT ARCHS )
set ( ARCHS x86_64 )
set ( APPLE_TARGET_TRIPLE_INT x86_64-apple-ios )
endif ( )
elseif ( PLATFORM_INT STREQUAL "TVOS" )
set ( SDK_NAME appletvos )
if ( NOT ARCHS )
set ( ARCHS arm64 )
set ( APPLE_TARGET_TRIPLE_INT aarch64-apple-tvos )
endif ( )
elseif ( PLATFORM_INT STREQUAL "TVOSCOMBINED" )
set ( SDK_NAME appletvos )
if ( MODERN_CMAKE )
if ( NOT ARCHS )
set ( ARCHS arm64 x86_64 )
set ( APPLE_TARGET_TRIPLE_INT aarch64-x86_64-apple-tvos )
endif ( )
else ( )
message ( FATAL_ERROR "Please make sure that you are running CMake 3.14+ to make the TVOSCOMBINED setting work" )
endif ( )
elseif ( PLATFORM_INT STREQUAL "SIMULATOR_TVOS" )
set ( SDK_NAME appletvsimulator )
if ( NOT ARCHS )
set ( ARCHS x86_64 )
set ( APPLE_TARGET_TRIPLE_INT x86_64-apple-tvos )
endif ( )
elseif ( PLATFORM_INT STREQUAL "WATCHOS" )
set ( SDK_NAME watchos )
set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fgnu-inline-asm" )
if ( NOT ARCHS )
if ( XCODE_VERSION VERSION_GREATER 10.0 )
set ( ARCHS armv7k arm64_32 )
set ( APPLE_TARGET_TRIPLE_INT aarch64_32-apple-watchos )
else ( )
set ( ARCHS armv7k )
set ( APPLE_TARGET_TRIPLE_INT arm-apple-watchos )
endif ( )
endif ( )
elseif ( PLATFORM_INT STREQUAL "WATCHOSCOMBINED" )
set ( SDK_NAME watchos )
if ( MODERN_CMAKE )
if ( NOT ARCHS )
if ( XCODE_VERSION VERSION_GREATER 10.0 )
set ( ARCHS armv7k arm64_32 i386 )
set ( APPLE_TARGET_TRIPLE_INT aarch64_32-i386-apple-watchos )
else ( )
set ( ARCHS armv7k i386 )
set ( APPLE_TARGET_TRIPLE_INT arm-i386-apple-watchos )
endif ( )
endif ( )
else ( )
message ( FATAL_ERROR "Please make sure that you are running CMake 3.14+ to make the WATCHOSCOMBINED setting work" )
endif ( )
elseif ( PLATFORM_INT STREQUAL "SIMULATOR_WATCHOS" )
set ( SDK_NAME watchsimulator )
if ( NOT ARCHS )
set ( ARCHS i386 )
set ( APPLE_TARGET_TRIPLE_INT i386-apple-watchos )
endif ( )
else ( )
message ( FATAL_ERROR "Invalid PLATFORM: ${PLATFORM_INT}" )
endif ( )
if ( MODERN_CMAKE AND PLATFORM_INT MATCHES ".*COMBINED" AND NOT USED_CMAKE_GENERATOR MATCHES "Xcode" )
message ( FATAL_ERROR "The COMBINED options only work with Xcode generator, -G Xcode" )
endif ( )
# I f u s e r d i d n o t s p e c i f y t h e S D K r o o t t o u s e , t h e n q u e r y x c o d e b u i l d f o r i t .
execute_process ( COMMAND xcodebuild -version -sdk ${ SDK_NAME } Path
O U T P U T _ V A R I A B L E C M A K E _ O S X _ S Y S R O O T _ I N T
E R R O R _ Q U I E T
O U T P U T _ S T R I P _ T R A I L I N G _ W H I T E S P A C E )
if ( NOT DEFINED CMAKE_OSX_SYSROOT_INT AND NOT DEFINED CMAKE_OSX_SYSROOT )
message ( SEND_ERROR "Please make sure that Xcode is installed and that the toolchain"
" i s p o i n t i n g t o t h e c o r r e c t p a t h . P l e a s e r u n : "
" s u d o x c o d e - s e l e c t - s / A p p l i c a t i o n s / X c o d e . a p p / C o n t e n t s / D e v e l o p e r "
" a n d s e e i f t h a t f i x e s t h e p r o b l e m f o r y o u . " )
message ( FATAL_ERROR "Invalid CMAKE_OSX_SYSROOT: ${CMAKE_OSX_SYSROOT} "
" d o e s n o t e x i s t . " )
elseif ( DEFINED CMAKE_OSX_SYSROOT_INT )
set ( CMAKE_OSX_SYSROOT "${CMAKE_OSX_SYSROOT_INT}" CACHE INTERNAL "" )
endif ( )
# S e t X c o d e p r o p e r t y f o r S D K R O O T a s w e l l i f X c o d e g e n e r a t o r i s u s e d
if ( USED_CMAKE_GENERATOR MATCHES "Xcode" )
set ( CMAKE_OSX_SYSROOT "${SDK_NAME}" CACHE INTERNAL "" )
if ( NOT DEFINED CMAKE_XCODE_ATTRIBUTE_DEVELOPMENT_TEAM )
set ( CMAKE_XCODE_ATTRIBUTE_DEVELOPMENT_TEAM "123456789A" CACHE INTERNAL "" )
endif ( )
endif ( )
# S p e c i f y m i n i m u m v e r s i o n o f d e p l o y m e n t t a r g e t .
if ( NOT DEFINED DEPLOYMENT_TARGET )
if ( PLATFORM_INT STREQUAL "WATCHOS" OR PLATFORM_INT STREQUAL "SIMULATOR_WATCHOS" )
# U n l e s s s p e c i f i e d , S D K v e r s i o n 2 . 0 i s u s e d b y d e f a u l t a s m i n i m u m t a r g e t version ( watchOS ) .
set ( DEPLOYMENT_TARGET "2.0"
C A C H E S T R I N G " M i n i m u m S D K v e r s i o n t o b u i l d f o r . " )
else ( )
# U n l e s s s p e c i f i e d , S D K v e r s i o n 9 . 0 i s u s e d b y d e f a u l t a s m i n i m u m t a r g e t version ( iOS, tvOS ) .
set ( DEPLOYMENT_TARGET "9.0"
C A C H E S T R I N G " M i n i m u m S D K v e r s i o n t o b u i l d f o r . " )
endif ( )
message ( STATUS "Using the default min-version since DEPLOYMENT_TARGET not provided!" )
endif ( )
# U s e b i t c o d e o r n o t
if ( NOT DEFINED ENABLE_BITCODE AND NOT ARCHS MATCHES "((^|;|, )(i386|x86_64))+" )
# U n l e s s s p e c i f i e d , e n a b l e b i t c o d e s u p p o r t b y d e f a u l t
message ( STATUS "Enabling bitcode support by default. ENABLE_BITCODE not provided!" )
set ( ENABLE_BITCODE TRUE )
elseif ( NOT DEFINED ENABLE_BITCODE )
message ( STATUS "Disabling bitcode support by default on simulators. ENABLE_BITCODE not provided for override!" )
set ( ENABLE_BITCODE FALSE )
endif ( )
set ( ENABLE_BITCODE_INT ${ ENABLE_BITCODE } CACHE BOOL "Whether or not to enable bitcode" ${ FORCE_CACHE } )
# U s e A R C o r n o t
if ( NOT DEFINED ENABLE_ARC )
# U n l e s s s p e c i f i e d , e n a b l e A R C s u p p o r t b y d e f a u l t
set ( ENABLE_ARC TRUE )
message ( STATUS "Enabling ARC support by default. ENABLE_ARC not provided!" )
endif ( )
set ( ENABLE_ARC_INT ${ ENABLE_ARC } CACHE BOOL "Whether or not to enable ARC" ${ FORCE_CACHE } )
# U s e h i d d e n v i s i b i l i t y o r n o t
if ( NOT DEFINED ENABLE_VISIBILITY )
# U n l e s s s p e c i f i e d , d i s a b l e s y m b o l s v i s i b i l i t y b y d e f a u l t
set ( ENABLE_VISIBILITY FALSE )
message ( STATUS "Hiding symbols visibility by default. ENABLE_VISIBILITY not provided!" )
endif ( )
set ( ENABLE_VISIBILITY_INT ${ ENABLE_VISIBILITY } CACHE BOOL "Whether or not to hide symbols (-fvisibility=hidden)" ${ FORCE_CACHE } )
# S e t s t r i c t c o m p i l e r c h e c k s o r n o t
if ( NOT DEFINED ENABLE_STRICT_TRY_COMPILE )
# U n l e s s s p e c i f i e d , d i s a b l e s t r i c t try_compile ( )
set ( ENABLE_STRICT_TRY_COMPILE FALSE )
message ( STATUS "Using NON-strict compiler checks by default. ENABLE_STRICT_TRY_COMPILE not provided!" )
endif ( )
set ( ENABLE_STRICT_TRY_COMPILE_INT ${ ENABLE_STRICT_TRY_COMPILE } CACHE BOOL "Whether or not to use strict compiler checks" ${ FORCE_CACHE } )
# G e t t h e S D K v e r s i o n i n f o r m a t i o n .
execute_process ( COMMAND xcodebuild -sdk ${ CMAKE_OSX_SYSROOT } -version SDKVersion
O U T P U T _ V A R I A B L E S D K _ V E R S I O N
E R R O R _ Q U I E T
O U T P U T _ S T R I P _ T R A I L I N G _ W H I T E S P A C E )
# F i n d t h e D e v e l o p e r r o o t f o r t h e s p e c i f i c i O S p l a t f o r m b e i n g c o m p i l e d f o r
# f r o m C M A K E _ O S X _ S Y S R O O T . S h o u l d b e . . / . . / f r o m S D K s p e c i f i e d i n
# C M A K E _ O S X _ S Y S R O O T . T h e r e d o e s n o t a p p e a r t o b e a d i r e c t w a y t o o b t a i n
# t h i s i n f o r m a t i o n f r o m x c r u n o r x c o d e b u i l d .
if ( NOT DEFINED CMAKE_DEVELOPER_ROOT AND NOT USED_CMAKE_GENERATOR MATCHES "Xcode" )
get_filename_component ( PLATFORM_SDK_DIR ${ CMAKE_OSX_SYSROOT } PATH )
get_filename_component ( CMAKE_DEVELOPER_ROOT ${ PLATFORM_SDK_DIR } PATH )
if ( NOT DEFINED CMAKE_DEVELOPER_ROOT )
message ( FATAL_ERROR "Invalid CMAKE_DEVELOPER_ROOT: "
" $ { C M A K E _ D E V E L O P E R _ R O O T } d o e s n o t e x i s t . " )
endif ( )
endif ( )
# F i n d t h e C & C + + c o m p i l e r s f o r t h e s p e c i f i e d S D K .
if ( NOT CMAKE_C_COMPILER )
execute_process ( COMMAND xcrun -sdk ${ CMAKE_OSX_SYSROOT } -find clang
O U T P U T _ V A R I A B L E C M A K E _ C _ C O M P I L E R
E R R O R _ Q U I E T
O U T P U T _ S T R I P _ T R A I L I N G _ W H I T E S P A C E )
message ( STATUS "Using C compiler: ${CMAKE_C_COMPILER}" )
endif ( )
if ( NOT CMAKE_CXX_COMPILER )
execute_process ( COMMAND xcrun -sdk ${ CMAKE_OSX_SYSROOT } -find clang++
O U T P U T _ V A R I A B L E C M A K E _ C X X _ C O M P I L E R
E R R O R _ Q U I E T
O U T P U T _ S T R I P _ T R A I L I N G _ W H I T E S P A C E )
message ( STATUS "Using CXX compiler: ${CMAKE_CXX_COMPILER}" )
endif ( )
# Find ( Apple's ) l i b t o o l .
execute_process ( COMMAND xcrun -sdk ${ CMAKE_OSX_SYSROOT } -find libtool
O U T P U T _ V A R I A B L E B U I L D _ L I B T O O L
E R R O R _ Q U I E T
O U T P U T _ S T R I P _ T R A I L I N G _ W H I T E S P A C E )
message ( STATUS "Using libtool: ${BUILD_LIBTOOL}" )
# C o n f i g u r e l i b t o o l t o b e u s e d i n s t e a d o f a r + r a n l i b t o b u i l d s t a t i c l i b r a r i e s .
# T h i s i s r e q u i r e d o n X c o d e 7 + , b u t s h o u l d a l s o w o r k o n p r e v i o u s v e r s i o n s o f
# X c o d e .
set ( CMAKE_C_CREATE_STATIC_LIBRARY
" $ { B U I L D _ L I B T O O L } - s t a t i c - o < T A R G E T > < L I N K _ F L A G S > < O B J E C T S > " )
set ( CMAKE_CXX_CREATE_STATIC_LIBRARY
" $ { B U I L D _ L I B T O O L } - s t a t i c - o < T A R G E T > < L I N K _ F L A G S > < O B J E C T S > " )
# F i n d t h e t o o l c h a i n ' s p r o v i d e d i n s t a l l _ n a m e _ t o o l i f n o n e i s f o u n d o n t h e h o s t
if ( NOT CMAKE_INSTALL_NAME_TOOL )
execute_process ( COMMAND xcrun -sdk ${ CMAKE_OSX_SYSROOT } -find install_name_tool
O U T P U T _ V A R I A B L E C M A K E _ I N S T A L L _ N A M E _ T O O L _ I N T
E R R O R _ Q U I E T
O U T P U T _ S T R I P _ T R A I L I N G _ W H I T E S P A C E )
set ( CMAKE_INSTALL_NAME_TOOL ${ CMAKE_INSTALL_NAME_TOOL_INT } CACHE STRING "" ${ FORCE_CACHE } )
endif ( )
# G e t t h e v e r s i o n o f Darwin ( OS X ) o f t h e h o s t .
execute_process ( COMMAND uname -r
O U T P U T _ V A R I A B L E C M A K E _ H O S T _ S Y S T E M _ V E R S I O N
E R R O R _ Q U I E T
O U T P U T _ S T R I P _ T R A I L I N G _ W H I T E S P A C E )
if ( SDK_NAME MATCHES "iphone" )
set ( CMAKE_SYSTEM_NAME iOS CACHE INTERNAL "" ${ FORCE_CACHE } )
endif ( )
# C M a k e 3 . 1 4 + s u p p o r t b u i l d i n g f o r i O S , w a t c h O S a n d t v O S o u t o f t h e b o x .
if ( MODERN_CMAKE )
if ( SDK_NAME MATCHES "appletv" )
set ( CMAKE_SYSTEM_NAME tvOS CACHE INTERNAL "" ${ FORCE_CACHE } )
elseif ( SDK_NAME MATCHES "watch" )
set ( CMAKE_SYSTEM_NAME watchOS CACHE INTERNAL "" ${ FORCE_CACHE } )
endif ( )
# P r o v i d e f l a g s f o r a c o m b i n e d F A T l i b r a r y b u i l d o n n e w e r C M a k e v e r s i o n s
if ( PLATFORM_INT MATCHES ".*COMBINED" )
set ( CMAKE_XCODE_ATTRIBUTE_ONLY_ACTIVE_ARCH "NO" CACHE INTERNAL "" ${ FORCE_CACHE } )
set ( CMAKE_IOS_INSTALL_COMBINED YES CACHE INTERNAL "" ${ FORCE_CACHE } )
message ( STATUS "Will combine built (static) artifacts into FAT lib..." )
endif ( )
elseif ( ${ CMAKE_VERSION } VERSION_GREATER_EQUAL "3.10" )
# L e g a c y c o d e p a t h p r i o r t o C M a k e 3 . 1 4 o r f a l l b a c k i f n o S D K _ N A M E s p e c i f i e d
set ( CMAKE_SYSTEM_NAME iOS CACHE INTERNAL "" ${ FORCE_CACHE } )
else ( )
# L e g a c y c o d e p a t h p r i o r t o C M a k e 3 . 1 4 o r f a l l b a c k i f n o S D K _ N A M E s p e c i f i e d
set ( CMAKE_SYSTEM_NAME Darwin CACHE INTERNAL "" ${ FORCE_CACHE } )
endif ( )
# S t a n d a r d s e t t i n g s .
set ( CMAKE_SYSTEM_VERSION ${ SDK_VERSION } CACHE INTERNAL "" )
set ( UNIX TRUE CACHE BOOL "" )
set ( APPLE TRUE CACHE BOOL "" )
set ( IOS TRUE CACHE BOOL "" )
set ( CMAKE_AR ar CACHE FILEPATH "" FORCE )
set ( CMAKE_RANLIB ranlib CACHE FILEPATH "" FORCE )
set ( CMAKE_STRIP strip CACHE FILEPATH "" FORCE )
# S e t t h e a r c h i t e c t u r e s f o r w h i c h t o b u i l d .
set ( CMAKE_OSX_ARCHITECTURES ${ ARCHS } CACHE STRING "Build architecture for iOS" )
# C h a n g e t h e t y p e o f t a r g e t g e n e r a t e d f o r try_compile ( ) s o i t ' l l w o r k w h e n c r o s s - c o m p i l i n g , w e a k c o m p i l e r c h e c k s
if ( ENABLE_STRICT_TRY_COMPILE_INT )
message ( STATUS "Using strict compiler checks (default in CMake)." )
else ( )
set ( CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY )
endif ( )
# A l l i O S / D a r w i n s p e c i f i c s e t t i n g s - s o m e m a y b e r e d u n d a n t .
set ( CMAKE_MACOSX_BUNDLE YES )
set ( CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED "NO" )
set ( CMAKE_SHARED_LIBRARY_PREFIX "lib" )
set ( CMAKE_SHARED_LIBRARY_SUFFIX ".dylib" )
set ( CMAKE_SHARED_MODULE_PREFIX "lib" )
set ( CMAKE_SHARED_MODULE_SUFFIX ".so" )
set ( CMAKE_C_COMPILER_ABI ELF )
set ( CMAKE_CXX_COMPILER_ABI ELF )
set ( CMAKE_C_HAS_ISYSROOT 1 )
set ( CMAKE_CXX_HAS_ISYSROOT 1 )
set ( CMAKE_MODULE_EXISTS 1 )
set ( CMAKE_DL_LIBS "" )
set ( CMAKE_C_OSX_COMPATIBILITY_VERSION_FLAG
" - c o m p a t i b i l i t y _ v e r s i o n " )
set ( CMAKE_C_OSX_CURRENT_VERSION_FLAG
" - c u r r e n t _ v e r s i o n " )
set ( CMAKE_CXX_OSX_COMPATIBILITY_VERSION_FLAG
" $ { C M A K E _ C _ O S X _ C O M P A T I B I L I T Y _ V E R S I O N _ F L A G } " )
set ( CMAKE_CXX_OSX_CURRENT_VERSION_FLAG
" $ { C M A K E _ C _ O S X _ C U R R E N T _ V E R S I O N _ F L A G } " )
# h i d d e n v i s i b i l i t y i s r e q u i r e d f o r c x x o n i O S
set ( CMAKE_C_FLAGS_INIT "" )
set ( CMAKE_CXX_FLAGS_INIT
" - h e a d e r p a d _ m a x _ i n s t a l l _ n a m e s - f v i s i b i l i t y = h i d d e n - f v i s i b i l i t y - i n l i n e s - h i d d e n " )
set ( CMAKE_C_LINK_FLAGS
" - W l , - s e a r c h _ p a t h s _ f i r s t $ { C M A K E _ C _ L I N K _ F L A G S } " )
set ( CMAKE_CXX_LINK_FLAGS
" - W l , - s e a r c h _ p a t h s _ f i r s t $ { C M A K E _ C X X _ L I N K _ F L A G S } " )
set ( CMAKE_C_OSX_COMPATIBILITY_VERSION_FLAG "-compatibility_version " )
set ( CMAKE_C_OSX_CURRENT_VERSION_FLAG "-current_version " )
set ( CMAKE_CXX_OSX_COMPATIBILITY_VERSION_FLAG "${CMAKE_C_OSX_COMPATIBILITY_VERSION_FLAG}" )
set ( CMAKE_CXX_OSX_CURRENT_VERSION_FLAG "${CMAKE_C_OSX_CURRENT_VERSION_FLAG}" )
if ( ARCHS MATCHES "((^|;|, )(arm64|arm64e|x86_64))+" )
set ( CMAKE_C_SIZEOF_DATA_PTR 8 )
set ( CMAKE_CXX_SIZEOF_DATA_PTR 8 )
if ( ARCHS MATCHES "((^|;|, )(arm64|arm64e))+" )
set ( CMAKE_SYSTEM_PROCESSOR "aarch64" )
else ( )
set ( CMAKE_SYSTEM_PROCESSOR "x86_64" )
endif ( )
else ( )
set ( CMAKE_C_SIZEOF_DATA_PTR 4 )
set ( CMAKE_CXX_SIZEOF_DATA_PTR 4 )
set ( CMAKE_SYSTEM_PROCESSOR "arm" )
endif ( )
# N o t e t h a t o n l y X c o d e 7 + s u p p o r t s t h e n e w e r m o r e s p e c i f i c :
# - m $ { S D K _ N A M E } - v e r s i o n - m i n f l a g s , o l d e r v e r s i o n s o f X c o d e u s e :
# - m ( ios/ios-simulator ) - v e r s i o n - m i n i n s t e a d .
if ( ${ CMAKE_VERSION } VERSION_LESS "3.11" )
if ( PLATFORM_INT STREQUAL "OS" OR PLATFORM_INT STREQUAL "OS64" )
if ( XCODE_VERSION VERSION_LESS 7.0 )
set ( SDK_NAME_VERSION_FLAGS
" - m i o s - v e r s i o n - m i n = $ { D E P L O Y M E N T _ T A R G E T } " )
else ( )
# X c o d e 7 . 0 + u s e s f l a g s w e c a n b u i l d d i r e c t l y f r o m S D K _ N A M E .
set ( SDK_NAME_VERSION_FLAGS
" - m $ { S D K _ N A M E } - v e r s i o n - m i n = $ { D E P L O Y M E N T _ T A R G E T } " )
endif ( )
elseif ( PLATFORM_INT STREQUAL "TVOS" )
set ( SDK_NAME_VERSION_FLAGS
" - m t v o s - v e r s i o n - m i n = $ { D E P L O Y M E N T _ T A R G E T } " )
elseif ( PLATFORM_INT STREQUAL "SIMULATOR_TVOS" )
set ( SDK_NAME_VERSION_FLAGS
" - m t v o s - s i m u l a t o r - v e r s i o n - m i n = $ { D E P L O Y M E N T _ T A R G E T } " )
elseif ( PLATFORM_INT STREQUAL "WATCHOS" )
set ( SDK_NAME_VERSION_FLAGS
" - m w a t c h o s - v e r s i o n - m i n = $ { D E P L O Y M E N T _ T A R G E T } " )
elseif ( PLATFORM_INT STREQUAL "SIMULATOR_WATCHOS" )
set ( SDK_NAME_VERSION_FLAGS
" - m w a t c h o s - s i m u l a t o r - v e r s i o n - m i n = $ { D E P L O Y M E N T _ T A R G E T } " )
else ( )
# S I M U L A T O R o r S I M U L A T O R 6 4 b o t h u s e - m i o s - s i m u l a t o r - v e r s i o n - m i n .
set ( SDK_NAME_VERSION_FLAGS
" - m i o s - s i m u l a t o r - v e r s i o n - m i n = $ { D E P L O Y M E N T _ T A R G E T } " )
endif ( )
else ( )
# N e w e r v e r s i o n s o f C M a k e s e t s t h e v e r s i o n m i n f l a g s c o r r e c t l y
set ( CMAKE_OSX_DEPLOYMENT_TARGET ${ DEPLOYMENT_TARGET } CACHE STRING
" S e t C M a k e d e p l o y m e n t t a r g e t " $ { F O R C E _ C A C H E } )
endif ( )
if ( DEFINED APPLE_TARGET_TRIPLE_INT )
set ( APPLE_TARGET_TRIPLE ${ APPLE_TARGET_TRIPLE_INT } CACHE STRING
" A u t o c o n f t a r g e t t r i p l e c o m p a t i b l e v a r i a b l e " $ { F O R C E _ C A C H E } )
endif ( )
if ( ENABLE_BITCODE_INT )
set ( BITCODE "-fembed-bitcode" )
set ( CMAKE_XCODE_ATTRIBUTE_BITCODE_GENERATION_MODE "bitcode" CACHE INTERNAL "" )
set ( CMAKE_XCODE_ATTRIBUTE_ENABLE_BITCODE "YES" CACHE INTERNAL "" )
else ( )
set ( BITCODE "" )
set ( CMAKE_XCODE_ATTRIBUTE_ENABLE_BITCODE "NO" CACHE INTERNAL "" )
endif ( )
if ( ENABLE_ARC_INT )
set ( FOBJC_ARC "-fobjc-arc" )
set ( CMAKE_XCODE_ATTRIBUTE_CLANG_ENABLE_OBJC_ARC "YES" CACHE INTERNAL "" )
else ( )
set ( FOBJC_ARC "-fno-objc-arc" )
set ( CMAKE_XCODE_ATTRIBUTE_CLANG_ENABLE_OBJC_ARC "NO" CACHE INTERNAL "" )
endif ( )
if ( NOT ENABLE_VISIBILITY_INT )
set ( VISIBILITY "-fvisibility=hidden" )
set ( CMAKE_XCODE_ATTRIBUTE_GCC_SYMBOLS_PRIVATE_EXTERN "YES" CACHE INTERNAL "" )
else ( )
set ( VISIBILITY "" )
set ( CMAKE_XCODE_ATTRIBUTE_GCC_SYMBOLS_PRIVATE_EXTERN "NO" CACHE INTERNAL "" )
endif ( )
if ( NOT IOS_TOOLCHAIN_HAS_RUN )
# C h e c k i f X c o d e g e n e r a t o r i s u s e d , s i n c e t h a t w i l l h a n d l e t h e s e f l a g s a u t o m a g i c a l l y
if ( USED_CMAKE_GENERATOR MATCHES "Xcode" )
message ( STATUS "Not setting any manual command-line buildflags, since Xcode is selected as generator." )
else ( )
set ( CMAKE_C_FLAGS
" $ { S D K _ N A M E _ V E R S I O N _ F L A G S } $ { B I T C O D E } - f o b j c - a b i - v e r s i o n = 2 $ { F O B J C _ A R C } $ { C M A K E _ C _ F L A G S } " )
# H i d d e n v i s i b i l t y i s r e q u i r e d f o r C + + o n i O S .
set ( CMAKE_CXX_FLAGS
" $ { S D K _ N A M E _ V E R S I O N _ F L A G S } $ { B I T C O D E } $ { V I S I B I L I T Y } - f v i s i b i l i t y - i n l i n e s - h i d d e n - f o b j c - a b i - v e r s i o n = 2 $ { F O B J C _ A R C } $ { C M A K E _ C X X _ F L A G S } " )
set ( CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS} -O0 -g ${CMAKE_CXX_FLAGS_DEBUG}" )
set ( CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS} -DNDEBUG -Os -ffast-math ${CMAKE_CXX_FLAGS_MINSIZEREL}" )
set ( CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS} -DNDEBUG -O2 -g -ffast-math ${CMAKE_CXX_FLAGS_RELWITHDEBINFO}" )
set ( CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS} -DNDEBUG -O3 -ffast-math ${CMAKE_CXX_FLAGS_RELEASE}" )
set ( CMAKE_C_LINK_FLAGS "${SDK_NAME_VERSION_FLAGS} -Wl,-search_paths_first ${CMAKE_C_LINK_FLAGS}" )
set ( CMAKE_CXX_LINK_FLAGS "${SDK_NAME_VERSION_FLAGS} -Wl,-search_paths_first ${CMAKE_CXX_LINK_FLAGS}" )
set ( CMAKE_ASM_FLAGS "${CFLAGS} -x assembler-with-cpp" )
# I n o r d e r t o e n s u r e t h a t t h e u p d a t e d c o m p i l e r f l a g s a r e u s e d i n try_compile ( )
# t e s t s , w e h a v e t o f o r c i b l y s e t t h e m i n t h e C M a k e c a c h e , n o t m e r e l y s e t t h e m
# i n t h e l o c a l s c o p e .
set ( VARS_TO_FORCE_IN_CACHE
C M A K E _ C _ F L A G S
C M A K E _ C X X _ F L A G S
C M A K E _ C X X _ F L A G S _ D E B U G
C M A K E _ C X X _ F L A G S _ R E L W I T H D E B I N F O
C M A K E _ C X X _ F L A G S _ M I N S I Z E R E L
C M A K E _ C X X _ F L A G S _ R E L E A S E
C M A K E _ C _ L I N K _ F L A G S
C M A K E _ C X X _ L I N K _ F L A G S )
foreach ( VAR_TO_FORCE ${ VARS_TO_FORCE_IN_CACHE } )
set ( ${ VAR_TO_FORCE } "${${VAR_TO_FORCE}}" CACHE STRING "" ${ FORCE_CACHE } )
endforeach ( )
endif ( )
# # P r i n t s t a t u s m e s s a g e s t o i n f o r m o f t h e c u r r e n t s t a t e
message ( STATUS "Configuring ${SDK_NAME} build for platform: ${PLATFORM_INT}, architecture(s): ${ARCHS}" )
message ( STATUS "Using SDK: ${CMAKE_OSX_SYSROOT_INT}" )
if ( DEFINED APPLE_TARGET_TRIPLE )
message ( STATUS "Autoconf target triple: ${APPLE_TARGET_TRIPLE}" )
endif ( )
message ( STATUS "Using minimum deployment version: ${DEPLOYMENT_TARGET}"
" ( S D K v e r s i o n : $ { S D K _ V E R S I O N } ) " )
if ( MODERN_CMAKE )
message ( STATUS "Merging integrated CMake 3.14+ iOS,tvOS,watchOS,macOS toolchain(s) with this toolchain!" )
endif ( )
if ( USED_CMAKE_GENERATOR MATCHES "Xcode" )
message ( STATUS "Using Xcode version: ${XCODE_VERSION}" )
endif ( )
if ( DEFINED SDK_NAME_VERSION_FLAGS )
message ( STATUS "Using version flags: ${SDK_NAME_VERSION_FLAGS}" )
endif ( )
message ( STATUS "Using a data_ptr size of: ${CMAKE_CXX_SIZEOF_DATA_PTR}" )
message ( STATUS "Using install_name_tool: ${CMAKE_INSTALL_NAME_TOOL}" )
if ( ENABLE_BITCODE_INT )
message ( STATUS "Enabling bitcode support." )
else ( )
message ( STATUS "Disabling bitcode support." )
endif ( )
if ( ENABLE_ARC_INT )
message ( STATUS "Enabling ARC support." )
else ( )
message ( STATUS "Disabling ARC support." )
endif ( )
if ( NOT ENABLE_VISIBILITY_INT )
message ( STATUS "Hiding symbols (-fvisibility=hidden)." )
endif ( )
endif ( )
set ( CMAKE_PLATFORM_HAS_INSTALLNAME 1 )
set ( CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS
" - d y n a m i c l i b - h e a d e r p a d _ m a x _ i n s t a l l _ n a m e s " )
set ( CMAKE_SHARED_MODULE_CREATE_C_FLAGS
" - b u n d l e - h e a d e r p a d _ m a x _ i n s t a l l _ n a m e s " )
set ( CMAKE_SHARED_MODULE_LOADER_C_FLAG
" - W l , - b u n d l e _ l o a d e r , " )
set ( CMAKE_SHARED_MODULE_LOADER_CXX_FLAG
" - W l , - b u n d l e _ l o a d e r , " )
set ( CMAKE_FIND_LIBRARY_SUFFIXES
" . d y l i b " " . s o " " . a " )
# h a c k : I f a n e w cmake ( which uses CMAKE_INSTALL_NAME_TOOL ) r u n s o n a n o l d
# b u i l d tree ( where `install_name_tool' was hardcoded ) , a n d w h e r e
# C M A K E _ I N S T A L L _ N A M E _ T O O L i s n ' t i n t h e c a c h e a n d s t i l l c m a k e d i d n ' t
# f a i l i n ` C M a k e F i n d B i n U t i l s . c m a k e ' ( b e c a u s e i t i s n ' t r e r u n ) , h a r d c o d e
# C M A K E _ I N S T A L L _ N A M E _ T O O L h e r e t o ` i n s t a l l _ n a m e _ t o o l ' s o i t b e h a v e s a s
# i t d i d b e f o r e .
if ( NOT DEFINED CMAKE_INSTALL_NAME_TOOL )
find_program ( CMAKE_INSTALL_NAME_TOOL install_name_tool )
endif ( NOT DEFINED CMAKE_INSTALL_NAME_TOOL )
# s e t u p i O S p l a t f o r m u n l e s s s p e c i f i e d m a n u a l l y w i t h I O S _ P L A T F O R M
if ( NOT DEFINED IOS_PLATFORM )
set ( IOS_PLATFORM "OS" )
endif ( NOT DEFINED IOS_PLATFORM )
set ( IOS_PLATFORM ${ IOS_PLATFORM } CACHE STRING "Type of iOS Platform" )
# c h e c k t h e p l a t f o r m s e l e c t i o n a n d s e t u p f o r d e v e l o p e r r o o t
if ( ${ IOS_PLATFORM } STREQUAL "OS" )
set ( IOS_PLATFORM_LOCATION "iPhoneOS.platform" )
# t h i s c a u s e s t h e i n s t a l l e r s t o p r o p e r l y l o c a t e t h e o u t p u t l i b r a r i e s
set ( CMAKE_XCODE_EFFECTIVE_PLATFORMS "-iphoneos" )
elseif ( ${ IOS_PLATFORM } STREQUAL "SIMULATOR" )
set ( IOS_PLATFORM_LOCATION "iPhoneSimulator.platform" )
# t h i s c a u s e s t h e i n s t a l l e r s t o p r o p e r l y l o c a t e t h e o u t p u t l i b r a r i e s
set ( CMAKE_XCODE_EFFECTIVE_PLATFORMS "-iphonesimulator" )
else ( ${ IOS_PLATFORM } STREQUAL "OS" )
message ( FATAL_ERROR
" U n s u p p o r t e d I O S _ P L A T F O R M v a l u e s e l e c t e d . P l e a s e c h o o s e O S o r S I M U L A T O R . " )
endif ( ${ IOS_PLATFORM } STREQUAL "OS" )
# s e t u p i O S d e v e l o p e r l o c a t i o n u n l e s s s p e c i f i e d m a n u a l l y w i t h
# C M A K E _ I O S _ D E V E L O P E R _ R O O T - -
# n o t e t h a t X c o d e 4 . 3 c h a n g e d t h e i n s t a l l a t i o n l o c a t i o n ; c h o o s e t h e m o s t
# r e c e n t o n e a v a i l a b l e
set ( XCODE_POST_43_ROOT
" / A p p l i c a t i o n s / X c o d e . a p p / C o n t e n t s / D e v e l o p e r / P l a t f o r m s / $ { I O S _ P L A T F O R M _ L O C A T I O N } / D e v e l o p e r " )
set ( XCODE_PRE_43_ROOT
" / D e v e l o p e r / P l a t f o r m s / $ { I O S _ P L A T F O R M _ L O C A T I O N } / D e v e l o p e r " )
if ( NOT DEFINED CMAKE_IOS_DEVELOPER_ROOT )
if ( EXISTS ${ XCODE_POST_43_ROOT } )
set ( CMAKE_IOS_DEVELOPER_ROOT ${ XCODE_POST_43_ROOT } )
elseif ( EXISTS ${ XCODE_PRE_43_ROOT } )
set ( CMAKE_IOS_DEVELOPER_ROOT ${ XCODE_PRE_43_ROOT } )
endif ( EXISTS ${ XCODE_POST_43_ROOT } )
endif ( NOT DEFINED CMAKE_IOS_DEVELOPER_ROOT )
set ( CMAKE_IOS_DEVELOPER_ROOT ${ CMAKE_IOS_DEVELOPER_ROOT }
C A C H E P A T H " L o c a t i o n o f i O S P l a t f o r m "
)
# f i n d a n d u s e t h e m o s t r e c e n t i O S S D K u n l e s s s p e c i f i e d m a n u a l l y w i t h
# C M A K E _ I O S _ S D K _ R O O T
if ( NOT DEFINED CMAKE_IOS_SDK_ROOT )
file ( GLOB _CMAKE_IOS_SDKS "${CMAKE_IOS_DEVELOPER_ROOT}/SDKs/*" )
if ( _CMAKE_IOS_SDKS )
list ( SORT _CMAKE_IOS_SDKS )
list ( REVERSE _CMAKE_IOS_SDKS )
list ( GET _CMAKE_IOS_SDKS 0 CMAKE_IOS_SDK_ROOT )
else ( _CMAKE_IOS_SDKS )
message ( FATAL_ERROR
" N o i O S S D K ' s f o u n d i n d e f a u l t s e a r c h p a t h $ { C M A K E _ I O S _ D E V E L O P E R _ R O O T } . M a n u a l l y s e t C M A K E _ I O S _ S D K _ R O O T o r i n s t a l l t h e i O S S D K . " )
endif ( _CMAKE_IOS_SDKS )
message ( STATUS "Toolchain using default iOS SDK: ${CMAKE_IOS_SDK_ROOT}" )
endif ( NOT DEFINED CMAKE_IOS_SDK_ROOT )
set ( CMAKE_IOS_SDK_ROOT ${ CMAKE_IOS_SDK_ROOT }
C A C H E P A T H " L o c a t i o n o f t h e s e l e c t e d i O S S D K "
)
# s e t t h e s y s r o o t d e f a u l t t o t h e m o s t r e c e n t S D K
set ( CMAKE_OSX_SYSROOT ${ CMAKE_IOS_SDK_ROOT }
C A C H E P A T H " S y s r o o t u s e d f o r i O S s u p p o r t "
)
# s e t t h e a r c h i t e c t u r e f o r i O S - -
# n o t e t h a t c u r r e n t l y b o t h A R C H S _ S T A N D A R D _ 3 2 _ B I T a n d
# A R C H S _ U N I V E R S A L _ I P H O N E _ O S s e t a r m v 7 o n l y , s o s e t b o t h m a n u a l l y
if ( ${ IOS_PLATFORM } STREQUAL "OS" )
set ( IOS_ARCH $ ( ARCHS_STANDARD_32_64_BIT ) )
else ( ${ IOS_PLATFORM } STREQUAL "OS" )
set ( IOS_ARCH i386 )
endif ( ${ IOS_PLATFORM } STREQUAL "OS" )
set ( CMAKE_OSX_ARCHITECTURES ${ IOS_ARCH }
C A C H E s t r i n g " B u i l d a r c h i t e c t u r e f o r i O S "
)
# s e t t h e f i n d r o o t t o t h e i O S d e v e l o p e r r o o t s a n d t o u s e r d e f i n e d p a t h s
set ( CMAKE_FIND_ROOT_PATH
$ { C M A K E _ I O S _ D E V E L O P E R _ R O O T }
$ { C M A K E _ I O S _ S D K _ R O O T }
$ { C M A K E _ P R E F I X _ P A T H }
C A C H E s t r i n g " i O S f i n d s e a r c h p a t h r o o t "
)
# d e f a u l t t o s e a r c h i n g f o r f r a m e w o r k s f i r s t
set ( CMAKE_SHARED_LINKER_FLAGS "-rpath @executable_path/Frameworks -rpath @loader_path/Frameworks" )
set ( CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-dynamiclib -Wl,-headerpad_max_install_names" )
set ( CMAKE_SHARED_MODULE_CREATE_C_FLAGS "-bundle -Wl,-headerpad_max_install_names" )
set ( CMAKE_SHARED_MODULE_LOADER_C_FLAG "-Wl,-bundle_loader," )
set ( CMAKE_SHARED_MODULE_LOADER_CXX_FLAG "-Wl,-bundle_loader," )
set ( CMAKE_FIND_LIBRARY_SUFFIXES ".tbd" ".dylib" ".so" ".a" )
set ( CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-install_name" )
# S e t t h e f i n d r o o t t o t h e i O S d e v e l o p e r r o o t s a n d t o u s e r d e f i n e d p a t h s .
set ( CMAKE_FIND_ROOT_PATH ${ CMAKE_OSX_SYSROOT_INT } ${ CMAKE_PREFIX_PATH } CACHE STRING " Root path that will be prepended
t o a l l s e a r c h p a t h s " )
# D e f a u l t t o s e a r c h i n g f o r f r a m e w o r k s f i r s t .
set ( CMAKE_FIND_FRAMEWORK FIRST )
# S e t u p t h e d e f a u l t s e a r c h d i r e c t o r i e s f o r f r a m e w o r k s .
set ( CMAKE_FRAMEWORK_PATH
$ { C M A K E _ D E V E L O P E R _ R O O T } / L i b r a r y / P r i v a t e F r a m e w o r k s
$ { C M A K E _ O S X _ S Y S R O O T _ I N T } / S y s t e m / L i b r a r y / F r a m e w o r k s
$ { C M A K E _ F R A M E W O R K _ P A T H } C A C H E S T R I N G " F r a m e w o r k s s e a r c h p a t h s " $ { F O R C E _ C A C H E } )
set ( IOS_TOOLCHAIN_HAS_RUN TRUE CACHE BOOL "Has the CMake toolchain run already?" ${ FORCE_CACHE } )
# B y d e f a u l t , s e a r c h b o t h t h e s p e c i f i e d i O S S D K a n d t h e r e m a i n d e r o f t h e h o s t f i l e s y s t e m .
if ( NOT CMAKE_FIND_ROOT_PATH_MODE_PROGRAM )
set ( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM BOTH CACHE STRING "" ${ FORCE_CACHE } )
endif ( )
if ( NOT CMAKE_FIND_ROOT_PATH_MODE_LIBRARY )
set ( CMAKE_FIND_ROOT_PATH_MODE_LIBRARY BOTH CACHE STRING "" ${ FORCE_CACHE } )
endif ( )
if ( NOT CMAKE_FIND_ROOT_PATH_MODE_INCLUDE )
set ( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE BOTH CACHE STRING "" ${ FORCE_CACHE } )
endif ( )
if ( NOT CMAKE_FIND_ROOT_PATH_MODE_PACKAGE )
set ( CMAKE_FIND_ROOT_PATH_MODE_PACKAGE BOTH CACHE STRING "" ${ FORCE_CACHE } )
endif ( )
# s e t u p t h e d e f a u l t s e a r c h d i r e c t o r i e s f o r f r a m e w o r k s
set ( CMAKE_SYSTEM_FRAMEWORK_PATH
$ { C M A K E _ I O S _ S D K _ R O O T } / S y s t e m / L i b r a r y / F r a m e w o r k s
$ { C M A K E _ I O S _ S D K _ R O O T } / S y s t e m / L i b r a r y / P r i v a t e F r a m e w o r k s
$ { C M A K E _ I O S _ S D K _ R O O T } / D e v e l o p e r / L i b r a r y / F r a m e w o r k s
)
# o n l y s e a r c h t h e i O S S D K s , n o t t h e r e m a i n d e r o f t h e h o s t f i l e s y s t e m
set ( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY )
set ( CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY )
set ( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY )
# t h i s l i t t l e m a c r o l e t s y o u s e t a n y X c o d e s p e c i f i c p r o p e r t y
macro ( set_xcode_property TARGET XCODE_PROPERTY XCODE_VALUE )
set_property ( TARGET ${ TARGET }
P R O P E R T Y X C O D E _ A T T R I B U T E _ $ { X C O D E _ P R O P E R T Y } $ { X C O D E _ V A L U E } )
#
# S o m e h e l p e r - m a c r o s b e l o w t o s i m p l i f y a n d b e a u t i f y t h e C M a k e F i l e
#
# T h i s l i t t l e m a c r o l e t s y o u s e t a n y X c o d e s p e c i f i c p r o p e r t y .
macro ( set_xcode_property TARGET XCODE_PROPERTY XCODE_VALUE XCODE_RELVERSION )
set ( XCODE_RELVERSION_I "${XCODE_RELVERSION}" )
if ( XCODE_RELVERSION_I STREQUAL "All" )
set_property ( TARGET ${ TARGET } PROPERTY
X C O D E _ A T T R I B U T E _ $ { X C O D E _ P R O P E R T Y } " $ { X C O D E _ V A L U E } " )
else ( )
set_property ( TARGET ${ TARGET } PROPERTY
X C O D E _ A T T R I B U T E _ $ { X C O D E _ P R O P E R T Y } [ v a r i a n t = $ { X C O D E _ R E L V E R S I O N _ I } ] " $ { X C O D E _ V A L U E } " )
endif ( )
endmacro ( set_xcode_property )
# t h i s m a c r o l e t s y o u f i n d e x e c u t a b l e p r o g r a m s o n t h e h o s t s y s t e m
# T h i s m a c r o l e t s y o u f i n d e x e c u t a b l e p r o g r a m s o n t h e h o s t s y s t e m .
macro ( find_host_package )
set ( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER )
set ( CMAKE_FIND_ROOT_PATH_MODE_LIBRARY NEVER )
set ( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE NEVER )
set ( CMAKE_FIND_ROOT_PATH_MODE_PACKAGE NEVER )
set ( IOS FALSE )
find_package ( ${ ARGN } )
set ( IOS TRUE )
set ( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY )
set ( CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY )
set ( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY )
set ( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM BOTH )
set ( CMAKE_FIND_ROOT_PATH_MODE_LIBRARY BOTH )
set ( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE BOTH )
set ( CMAKE_FIND_ROOT_PATH_MODE_PACKAGE BOTH )
endmacro ( find_host_package )
# e o f