@ -12,13 +12,17 @@
# f u l l y .
#
#
# T h e f o l l o w i n g w i l l 1 . c r e a t e a b u i l d d i r e c t o r y a n d 2 . c h a n g e i n t o i t a n d
# T h e f o l l o w i n g will ( 1 ) c r e a t e a b u i l d d i r e c t o r y , and ( 2 ) c h a n g e i n t o i t a n d
# c a l l c m a k e t o c o n f i g u r e t h e b u i l d w i t h d e f a u l t p a r a m e t e r s a s a s t a t i c
# l i b r a r y . S e e h t t p s : / / c m a k e . o r g / c m a k e / h e l p / l a t e s t / v a r i a b l e / C M A K E _ B U I L D _ T Y P E . h t m l
# f o r i n f o r m a t i o n a b o u t D e b u g , R e l e a s e , e t c . b u i l d s .
# l i b r a r y . S e e
#
# h t t p s : / / c m a k e . o r g / c m a k e / h e l p / l a t e s t / v a r i a b l e / C M A K E _ B U I L D _ T Y P E . h t m l
#
# f o r i n f o r m a t i o n a b o u t d e b u g o r r e l e a s e b u i l d s , f o r e x a m p l e
#
# c m a k e - B b u i l d - D C M A K E _ B U I L D _ T Y P E = R e l e a s e
#
#
# F o r a d y n a m i c l i b r a r y , u s e
#
# c m a k e - B b u i l d - D B U I L D _ S H A R E D _ L I B S = t r u e - D C M A K E _ B U I L D _ T Y P E = R e l e a s e
@ -39,7 +43,8 @@
#
# c m a k e - E c h d i r b u i l d c m a k e - G X c o d e - D I O S _ P L A T F O R M = S I M U L A T O R 6 4 . .
#
# F i n a l l y , b u i l d t h e p r o j e c t w i t h :
#
# F i n a l l y , b u i l d t h e p r o j e c t w i t h
#
# c m a k e - - b u i l d b u i l d
#
@ -56,40 +61,47 @@
#
# S o m e n o t e s .
#
# . ` c m a k e ' c r e a t e s c o n f i g u r a t i o n f i l e s i n
# - ` c m a k e ' c r e a t e s c o n f i g u r a t i o n f i l e s i n
#
# < b u i l d - d i r e c t o r y > / i n c l u d e / f r e e t y p e / c o n f i g
#
# w h i c h s h o u l d b e f u r t h e r m o d i f i e d i f n e c e s s a r y .
#
# . Y o u c a n u s e ` c m a k e ' d i r e c t l y o n a f r e s h l y c l o n e d F r e e T y p e g i t
# - Y o u c a n u s e ` c m a k e ' d i r e c t l y o n a f r e s h l y c l o n e d F r e e T y p e g i t
# r e p o s i t o r y .
#
# . ` C M a k e L i s t s . t x t ' i s p r o v i d e d a s - i s s i n c e i t i s n o r m a l l y n o t u s e d b y t h e
# - ` C M a k e L i s t s . t x t ' i s p r o v i d e d a s - i s s i n c e i t i s n o r m a l l y n o t u s e d b y t h e
# d e v e l o p e r t e a m .
#
# . S e t t h e ` F T _ W I T H _ Z L I B ' , ` F T _ W I T H _ B Z I P 2 ' , ` F T _ W I T H _ P N G ' ,
# ` F T _ W I T H _ H A R F B U Z Z ' , a n d ` F T _ W I T H _ B R O T L I ' C M a k e v a r i a b l e s t o ` O N ' t o
# f o r c e u s i n g a d e p e n d e n c y . L e a v e a v a r i a b l e undefined ( which is the
# d e f a u l t ) t o u s e t h e d e p e n d e n c y o n l y i f i t i s a v a i l a b l e . E x a m p l e :
# - S e t t h e ` F T _ R E Q U I R E _ Z L I B ' , ` F T _ R E Q U I R E _ B Z I P 2 ' , ` F T _ R E Q U I R E _ P N G ' ,
# ` F T _ R E Q U I R E _ H A R F B U Z Z ' , a n d ` F T _ R E Q U I R E _ B R O T L I ' C M a k e v a r i a b l e s t o ` O N '
# o r ` T R U E ' t o f o r c e u s i n g a d e p e n d e n c y . L e a v e a v a r i a b l e u n d e f i n e d
# ( w h i c h i s t h e d e f a u l t ) t o u s e t h e d e p e n d e n c y o n l y i f i t i s a v a i l a b l e .
# E x a m p l e :
#
# c m a k e - B b u i l d - D F T _ W I T H _ Z L I B = O N \
# - D F T _ W I T H _ B Z I P 2 = O N \
# - D F T _ W I T H _ P N G = O N \
# - D F T _ W I T H _ H A R F B U Z Z = O N \
# - D F T _ W I T H _ B R O T L I = O N [ . . . ]
# c m a k e - B b u i l d - D F T _ R E Q U I R E _ Z L I B = T R U E \
# - D F T _ R E Q U I R E _ B Z I P 2 = T R U E \
# - D F T _ R E Q U I R E _ P N G = T R U E \
# - D F T _ R E Q U I R E _ H A R F B U Z Z = T R U E \
# - D F T _ R E Q U I R E _ B R O T L I = T R U E [ . . . ]
#
# S e t ` C M A K E _ D I S A B L E _ F I N D _ P A C K A G E _ X X X = T R U E ' t o d i s a b l e a d e p e n d e n c y c o m p l e t e l y
# ( w h e r e ` X X X ' i s a C M a k e p a c k a g e n a m e l i k e ` B Z i p 2 ' ) . E x a m p l e f o r d i s a b l i n g a l l
# - S e t ` F T _ D I S A B L E _ X X X = T R U E ' t o d i s a b l e a d e p e n d e n c y completely ( where
# ` X X X ' i s a C M a k e p a c k a g e n a m e l i k e ` B Z i p 2 ' ) . E x a m p l e f o r d i s a b l i n g a l l
# d e p e n d e n c i e s :
#
# c m a k e - B b u i l d - D C M A K E _ D I S A B L E _ F I N D _ P A C K A G E _ Z L I B = T R U E \
# - D C M A K E _ D I S A B L E _ F I N D _ P A C K A G E _ B Z i p 2 = T R U E \
# - D C M A K E _ D I S A B L E _ F I N D _ P A C K A G E _ P N G = T R U E \
# - D C M A K E _ D I S A B L E _ F I N D _ P A C K A G E _ H a r f B u z z = T R U E \
# - D C M A K E _ D I S A B L E _ F I N D _ P A C K A G E _ B r o t l i D e c = T R U E [ . . . ]
# c m a k e - B b u i l d - D F T _ D I S A B L E _ Z L I B = T R U E \
# - D F T _ D I S A B L E _ B Z I P 2 = T R U E \
# - D F T _ D I S A B L E _ P N G = T R U E \
# - D F T _ D I S A B L E _ H A R F B U Z Z = T R U E \
# - D F T _ D I S A B L E _ B R O T L I = T R U E [ . . . ]
#
# - N O T E : I f a p a c k a g e i s s e t a s D I S A B L E D , i t c a n n o t b e s e t a s R E Q U I R E D
# w i t h o u t u n s e t t i n g t h e D I S A B L E D v a l u e f i r s t . F o r e x a m p l e , i f
# ` F T _ D I S A B L E _ H A R F B U Z Z = T R U E ' h a s b e e n set ( Cache is present ) , y o u n e e d t o
# c a l l ` F T _ D I S A B L E _ H A R F B U Z Z = F A L S E ' b e f o r e c a l l i n g
# ` F T _ R E Q U I R E _ H A R F B U Z Z = T R U E ' .
#
# . I n s t a l l a t i o n o f F r e e T y p e c a n b e c o n t r o l l e d w i t h t h e C M a k e v a r i a b l e s
# - I n s t a l l a t i o n o f F r e e T y p e c a n b e c o n t r o l l e d w i t h t h e C M a k e v a r i a b l e s
# ` S K I P _ I N S T A L L _ H E A D E R S ' , ` S K I P _ I N S T A L L _ L I B R A R I E S ' , a n d ` S K I P _ I N S T A L L _ A L L '
# ( t h i s i s c o m p a t i b l e w i t h t h e s a m e C M a k e v a r i a b l e s i n z l i b ' s C M a k e
# s u p p o r t ) .
@ -109,6 +121,7 @@ if (NOT CMAKE_VERSION VERSION_LESS 3.3)
endif ( )
include ( CheckIncludeFile )
include ( CMakeDependentOption )
# C M A K E _ T O O L C H A I N _ F I L E m u s t b e s e t b e f o r e ` p r o j e c t ' i s c a l l e d , w h i c h
# c o n f i g u r e s t h e b a s e b u i l d e n v i r o n m e n t a n d r e f e r e n c e s t h e t o o l c h a i n f i l e
@ -171,13 +184,37 @@ string(REGEX REPLACE
math ( EXPR LIBRARY_SOVERSION "${LIBTOOL_CURRENT} - ${LIBTOOL_AGE}" )
set ( LIBRARY_VERSION "${LIBRARY_SOVERSION}.${LIBTOOL_AGE}.${LIBTOOL_REVISION}" )
# E x t e r n a l d e p e n d e n c y l i b r a r y d e t e c t i o n i s a u t o m a t i c . S e e t h e n o t e s a t t h e t o p
# o f t h i s f i l e , f o r h o w t o f o r c e o r d i s a b l e d e p e n d e n c i e s c o m p l e t e l y .
option ( FT_WITH_ZLIB "Use system zlib instead of internal library." OFF )
option ( FT_WITH_BZIP2 "Support bzip2 compressed fonts." OFF )
option ( FT_WITH_PNG "Support PNG compressed OpenType embedded bitmaps." OFF )
option ( FT_WITH_HARFBUZZ "Improve auto-hinting of OpenType fonts." OFF )
option ( FT_WITH_BROTLI "Support compressed WOFF2 fonts." OFF )
# E x t e r n a l d e p e n d e n c y l i b r a r y d e t e c t i o n i s a u t o m a t i c . S e e t h e n o t e s a t t h e
# t o p o f t h i s f i l e , f o r h o w t o f o r c e o r d i s a b l e d e p e n d e n c i e s c o m p l e t e l y .
option ( FT_DISABLE_ZLIB
" D i s a b l e u s e o f s y s t e m z l i b a n d u s e i n t e r n a l z l i b l i b r a r y i n s t e a d . " O F F )
cmake_dependent_option ( FT_REQUIRE_ZLIB
" R e q u i r e s y s t e m z l i b i n s t e a d o f i n t e r n a l z l i b l i b r a r y . " O F F
" N O T F T _ D I S A B L E _ Z L I B " O F F )
option ( FT_DISABLE_BZIP2
" D i s a b l e s u p p o r t o f b z i p 2 c o m p r e s s e d f o n t s . " O F F )
cmake_dependent_option ( FT_REQUIRE_BZIP2
" R e q u i r e s u p p o r t o f b z i p 2 c o m p r e s s e d f o n t s . " O F F
" N O T F T _ D I S A B L E _ B Z I P 2 " O F F )
option ( FT_DISABLE_PNG
" D i s a b l e s u p p o r t o f P N G c o m p r e s s e d O p e n T y p e e m b e d d e d b i t m a p s . " O F F )
cmake_dependent_option ( FT_REQUIRE_PNG
" R e q u i r e s u p p o r t o f P N G c o m p r e s s e d O p e n T y p e e m b e d d e d b i t m a p s . " O F F
" N O T F T _ D I S A B L E _ P N G " O F F )
option ( FT_DISABLE_HARFBUZZ
" D i s a b l e HarfBuzz ( used for improving auto-hinting of OpenType fonts ) . " O F F )
cmake_dependent_option ( FT_REQUIRE_HARFBUZZ
" R e q u i r e H a r f B u z z f o r i m p r o v i n g a u t o - h i n t i n g o f O p e n T y p e f o n t s . " O F F
" N O T F T _ D I S A B L E _ H A R F B U Z Z " O F F )
option ( FT_DISABLE_BROTLI
" D i s a b l e s u p p o r t o f c o m p r e s s e d W O F F 2 f o n t s . " O F F )
cmake_dependent_option ( FT_REQUIRE_BROTLI
" R e q u i r e s u p p o r t o f c o m p r e s s e d W O F F 2 f o n t s . " O F F
" N O T F T _ D I S A B L E _ B R O T L I " O F F )
# D i s a l l o w i n - s o u r c e b u i l d s
@ -208,35 +245,45 @@ endif ()
# F i n d d e p e n d e n c i e s
set ( HARFBUZZ_MIN_VERSION "2.0.0" )
if ( FT_WITH_HARFBUZZ )
find_package ( HarfBuzz ${ HARFBUZZ_MIN_VERSION } REQUIRED )
else ( )
find_package ( HarfBuzz ${ HARFBUZZ_MIN_VERSION } )
if ( NOT FT_DISABLE_HARFBUZZ )
set ( HARFBUZZ_MIN_VERSION "2.0.0" )
if ( FT_REQUIRE_HARFBUZZ )
find_package ( HarfBuzz ${ HARFBUZZ_MIN_VERSION } REQUIRED )
else ( )
find_package ( HarfBuzz ${ HARFBUZZ_MIN_VERSION } )
endif ( )
endif ( )
if ( FT_WITH_PNG )
find_package ( PNG REQUIRED )
else ( )
find_package ( PNG )
if ( NOT FT_DISABLE_PNG )
if ( FT_REQUIRE_PNG )
find_package ( PNG REQUIRED )
else ( )
find_package ( PNG )
endif ( )
endif ( )
if ( FT_WITH_ZLIB )
find_package ( ZLIB REQUIRED )
else ( )
find_package ( ZLIB )
if ( NOT FT_DISABLE_ZLIB )
if ( FT_REQUIRE_ZLIB )
find_package ( ZLIB REQUIRED )
else ( )
find_package ( ZLIB )
endif ( )
endif ( )
if ( FT_WITH_BZIP2 )
find_package ( BZip2 REQUIRED )
else ( )
find_package ( BZip2 )
if ( NOT FT_DISABLE_BZIP2 )
if ( FT_REQUIRE_BZIP2 )
find_package ( BZip2 REQUIRED )
else ( )
find_package ( BZip2 )
endif ( )
endif ( )
if ( FT_WITH_BROTLI )
find_package ( BrotliDec REQUIRED )
else ( )
find_package ( BrotliDec )
if ( NOT FT_DISABLE_BROTLI )
if ( FT_REQUIRE_BROTLI )
find_package ( BrotliDec REQUIRED )
else ( )
find_package ( BrotliDec )
endif ( )
endif ( )
# C r e a t e t h e c o n f i g u r a t i o n f i l e
@ -426,7 +473,7 @@ target_include_directories(
P R I V A T E
$ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / i n c l u d e
$ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / i n c l u d e
# M a k e < f t c o n f i g . h > a v a i l a b l e f o r b u i l d s / u n i x / f t s y s t e m . c .
$ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / i n c l u d e / f r e e t y p e / c o n f i g
)