2017-04-04 10:33:51 +00:00
cmake_minimum_required ( VERSION 2.8.0 )
project ( harfbuzz )
2017-05-13 17:02:56 +00:00
## Limit framework build to Xcode generator
if ( BUILD_FRAMEWORK )
# for a framework on macOS, use `cmake .. -DBUILD_FRAMEWORK:BOOL=true -G Xcode`
if ( NOT "${CMAKE_GENERATOR}" STREQUAL "Xcode" )
message ( FATAL_ERROR
" Y o u s h o u l d u s e X c o d e g e n e r a t o r w i t h B U I L D _ F R A M E W O R K e n a b l e d " )
endif ( )
set ( CMAKE_OSX_ARCHITECTURES "$(ARCHS_STANDARD_32_64_BIT)" )
set ( CMAKE_MACOSX_RPATH ON )
set ( BUILD_SHARED_LIBS ON )
endif ( )
2017-05-04 16:01:42 +00:00
## Disallow in-source builds, as CMake generated make files can collide with autotools ones
if ( NOT MSVC AND "${PROJECT_BINARY_DIR}" STREQUAL "${PROJECT_SOURCE_DIR}" )
2017-04-04 10:33:51 +00:00
message ( FATAL_ERROR
"
I n - s o u r c e b u i l d s a r e n o t p e r m i t t e d ! M a k e a s e p a r a t e f o l d e r f o r "
" b u i l d i n g , e . g . , "
"
m k d i r b u i l d ; c d b u i l d ; c m a k e . . "
"
B e f o r e t h a t , r e m o v e t h e f i l e s c r e a t e d b y t h i s f a i l e d r u n w i t h "
"
r m - r f C M a k e C a c h e . t x t C M a k e F i l e s " )
endif ( )
2017-05-04 16:01:42 +00:00
2017-04-04 10:33:51 +00:00
## HarfBuzz build configurations
2017-04-11 18:48:18 +00:00
option ( HB_HAVE_FREETYPE "Enable freetype interop helpers" OFF )
option ( HB_HAVE_GRAPHITE2 "Enable Graphite2 complementary shaper" OFF )
2017-04-04 10:33:51 +00:00
option ( HB_BUILTIN_UCDN "Use HarfBuzz provided UCDN" ON )
2017-04-11 18:48:18 +00:00
option ( HB_HAVE_GLIB "Enable glib unicode functions" OFF )
option ( HB_HAVE_ICU "Enable icu unicode functions" OFF )
2017-04-19 18:29:46 +00:00
if ( APPLE )
option ( HB_HAVE_CORETEXT "Enable CoreText shaper backend on macOS" ON )
endif ( )
if ( WIN32 )
option ( HB_HAVE_UNISCRIBE "Enable Uniscribe shaper backend on Windows" OFF )
option ( HB_HAVE_DIRECWRITE "Enable DirectWrite shaper backend on Windows" OFF )
endif ( )
2017-04-11 17:02:14 +00:00
option ( HB_BUILD_UTILS "Build harfbuzz utils, needs cairo, freetype, and glib properly be installed" OFF )
if ( HB_BUILD_UTILS )
set ( HB_HAVE_GLIB ON )
set ( HB_HAVE_FREETYPE ON )
endif ( )
2017-04-04 10:33:51 +00:00
include_directories ( AFTER
2017-04-05 09:21:23 +00:00
$ { P R O J E C T _ S O U R C E _ D I R } / s r c
2017-04-04 10:33:51 +00:00
$ { P R O J E C T _ B I N A R Y _ D I R } / s r c
)
add_definitions ( -DHAVE_OT )
if ( BUILD_SHARED_LIBS )
add_definitions ( -DHAVE_ATEXIT )
endif ( )
if ( MSVC )
add_definitions ( -wd4244 -wd4267 -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS )
endif ( )
if ( WIN32 AND NOT MINGW AND BUILD_SHARED_LIBS )
add_definitions ( "-DHB_EXTERN=__declspec(dllexport) extern" )
endif ( )
2017-05-04 16:01:42 +00:00
2017-05-13 17:02:56 +00:00
## Detect if we are running inside a distribution or regular repository folder
2017-04-04 10:33:51 +00:00
set ( IN_HB_DIST FALSE )
2017-06-19 10:17:09 +00:00
if ( EXISTS "${PROJECT_SOURCE_DIR}/ChangeLog" )
2017-04-04 10:33:51 +00:00
# perhaps we are on dist directory
set ( IN_HB_DIST TRUE )
set ( HB_VERSION_H "${PROJECT_SOURCE_DIR}/src/hb-version.h" )
endif ( )
2017-05-04 16:01:42 +00:00
2017-04-11 17:02:14 +00:00
## Extract variables from Makefile files
# http://stackoverflow.com/a/27630120/1414809
function ( prepend var prefix )
set ( listVar "" )
foreach ( f ${ ARGN } )
list ( APPEND listVar "${prefix}${f}" )
2017-04-11 18:48:18 +00:00
endforeach ( )
2017-04-11 17:02:14 +00:00
set ( ${ var } "${listVar}" PARENT_SCOPE )
endfunction ( )
2017-04-19 18:29:46 +00:00
function ( extract_make_variable variable file prefix )
2017-04-11 17:02:14 +00:00
string ( REGEX MATCH "${variable} = ([^$]+)\\$" temp ${ file } )
string ( REGEX MATCHALL "[^ \n\t\\]+" list ${ CMAKE_MATCH_1 } )
2017-04-19 18:29:46 +00:00
prepend ( list ${ prefix } ${ list } )
2017-04-11 17:02:14 +00:00
set ( ${ variable } ${ list } PARENT_SCOPE )
2017-04-05 09:21:23 +00:00
endfunction ( )
2017-04-19 18:29:46 +00:00
file ( READ ${ PROJECT_SOURCE_DIR } /src/Makefile.sources SRCSOURCES )
file ( READ ${ PROJECT_SOURCE_DIR } /util/Makefile.sources UTILSOURCES )
file ( READ ${ PROJECT_SOURCE_DIR } /src/hb-ucdn/Makefile.sources UCDNSOURCES )
2017-04-11 17:02:14 +00:00
2017-04-19 18:29:46 +00:00
extract_make_variable ( HB_BASE_sources ${ SRCSOURCES } "${PROJECT_SOURCE_DIR}/src/" )
extract_make_variable ( HB_BASE_headers ${ SRCSOURCES } "${PROJECT_SOURCE_DIR}/src/" )
extract_make_variable ( HB_OT_sources ${ SRCSOURCES } "${PROJECT_SOURCE_DIR}/src/" )
extract_make_variable ( HB_OT_headers ${ SRCSOURCES } "${PROJECT_SOURCE_DIR}/src/" )
2017-04-11 18:48:18 +00:00
2017-04-05 09:21:23 +00:00
if ( IN_HB_DIST )
2017-04-19 18:29:46 +00:00
set ( RAGEL_GENERATED_DIR "${PROJECT_SOURCE_DIR}/src/" )
2017-04-05 09:21:23 +00:00
else ( )
2017-04-19 18:29:46 +00:00
set ( RAGEL_GENERATED_DIR "${PROJECT_BINARY_DIR}/src/" )
2017-04-05 09:21:23 +00:00
endif ( )
2017-04-19 18:29:46 +00:00
extract_make_variable ( HB_BASE_RAGEL_GENERATED_sources ${ SRCSOURCES } ${ RAGEL_GENERATED_DIR } )
extract_make_variable ( HB_OT_RAGEL_GENERATED_sources ${ SRCSOURCES } ${ RAGEL_GENERATED_DIR } )
2017-04-11 17:02:14 +00:00
2017-04-19 18:29:46 +00:00
extract_make_variable ( HB_VIEW_sources ${ UTILSOURCES } "${PROJECT_SOURCE_DIR}/util/" )
extract_make_variable ( HB_SHAPE_sources ${ UTILSOURCES } "${PROJECT_SOURCE_DIR}/util/" )
extract_make_variable ( HB_OT_SHAPE_CLOSURE_sources ${ UTILSOURCES } "${PROJECT_SOURCE_DIR}/util/" )
extract_make_variable ( LIBHB_UCDN_sources ${ UCDNSOURCES } "${PROJECT_SOURCE_DIR}/src/hb-ucdn/" )
2017-04-11 18:48:18 +00:00
2017-04-11 17:02:14 +00:00
file ( READ configure.ac CONFIGUREAC )
string ( REGEX MATCH "\\[(([0-9]+)\\.([0-9]+)\\.([0-9]+))\\]" HB_VERSION_MATCH ${ CONFIGUREAC } )
set ( HB_VERSION ${ CMAKE_MATCH_1 } )
set ( HB_VERSION_MAJOR ${ CMAKE_MATCH_2 } )
set ( HB_VERSION_MINOR ${ CMAKE_MATCH_3 } )
set ( HB_VERSION_MICRO ${ CMAKE_MATCH_4 } )
2017-05-04 16:01:42 +00:00
2017-04-05 09:21:23 +00:00
2017-05-13 17:02:56 +00:00
## Define ragel tasks
2017-04-04 10:33:51 +00:00
if ( NOT IN_HB_DIST )
2017-06-19 10:17:09 +00:00
find_program ( RAGEL "ragel" CMAKE_FIND_ROOT_PATH_BOTH )
2017-04-04 10:33:51 +00:00
if ( RAGEL )
message ( STATUS "ragel found at: ${RAGEL}" )
2017-04-05 09:21:23 +00:00
else ( )
2017-04-19 18:29:46 +00:00
message ( FATAL_ERROR "ragel not found, get it here -- http://www.complang.org/ragel/ or, use harfbuzz releases https://github.com/behdad/harfbuzz/releases" )
2017-04-05 09:21:23 +00:00
endif ( )
2017-04-04 10:33:51 +00:00
2017-04-05 09:21:23 +00:00
foreach ( ragel_output IN ITEMS ${ HB_BASE_RAGEL_GENERATED_sources } ${ HB_OT_RAGEL_GENERATED_sources } )
string ( REGEX MATCH "([^/]+)\\.hh" temp ${ ragel_output } )
set ( target_name ${ CMAKE_MATCH_1 } )
add_custom_command ( OUTPUT ${ ragel_output }
C O M M A N D $ { R A G E L } - G 2 - o $ { r a g e l _ o u t p u t } $ { P R O J E C T _ S O U R C E _ D I R } / s r c / $ { t a r g e t _ n a m e } . r l - I $ { P R O J E C T _ S O U R C E _ D I R } $ { A R G N }
D E P E N D S $ { P R O J E C T _ S O U R C E _ D I R } / s r c / $ { t a r g e t _ n a m e } . r l
2017-04-04 10:33:51 +00:00
)
2017-04-05 09:21:23 +00:00
add_custom_target ( harfbuzz_ ${ target_name } DEPENDS ${ PROJECT_BINARY_DIR } /src/ ${ target_name } )
endforeach ( )
2017-04-19 18:29:46 +00:00
mark_as_advanced ( RAGEL )
2017-05-13 17:02:56 +00:00
endif ( )
2017-05-04 16:01:42 +00:00
2017-04-04 10:33:51 +00:00
2017-05-13 17:02:56 +00:00
## Generate hb-version.h
if ( NOT IN_HB_DIST )
2017-04-04 10:33:51 +00:00
set ( HB_VERSION_H_IN "${PROJECT_SOURCE_DIR}/src/hb-version.h.in" )
set ( HB_VERSION_H "${PROJECT_BINARY_DIR}/src/hb-version.h" )
set_source_files_properties ( "${HB_VERSION_H}" PROPERTIES GENERATED true )
configure_file ( "${HB_VERSION_H_IN}" "${HB_VERSION_H}.tmp" @ONLY )
execute_process ( COMMAND "${CMAKE_COMMAND}" -E copy_if_different
" $ { H B _ V E R S I O N _ H } . t m p "
2017-05-13 17:02:56 +00:00
" $ { H B _ V E R S I O N _ H } "
)
2017-04-04 10:33:51 +00:00
file ( REMOVE "${HB_VERSION_H}.tmp" )
endif ( )
2017-05-13 17:02:56 +00:00
2017-04-11 17:02:14 +00:00
## Define sources and headers of the project
2017-04-05 09:21:23 +00:00
set ( project_sources
$ { H B _ B A S E _ s o u r c e s }
$ { H B _ B A S E _ R A G E L _ G E N E R A T E D _ s o u r c e s }
2017-04-04 10:33:51 +00:00
2017-04-05 09:21:23 +00:00
$ { H B _ O T _ s o u r c e s }
$ { H B _ O T _ R A G E L _ G E N E R A T E D _ s o u r c e s }
)
2017-04-04 10:33:51 +00:00
set ( project_headers
$ { H B _ V E R S I O N _ H }
$ { H B _ B A S E _ h e a d e r s }
$ { H B _ O T _ h e a d e r s }
)
2017-05-04 16:01:42 +00:00
## Find and include needed header folders and libraries
2017-04-04 10:33:51 +00:00
if ( HB_HAVE_FREETYPE )
2017-04-19 18:29:46 +00:00
add_definitions ( -DHAVE_FREETYPE=1 -DHAVE_FT_FACE_GETCHARVARIANTINDEX=1 )
2017-04-04 10:33:51 +00:00
2017-04-19 18:29:46 +00:00
# https://github.com/WebKit/webkit/blob/master/Source/cmake/FindFreetype2.cmake
find_package ( PkgConfig )
pkg_check_modules ( PC_FREETYPE2 QUIET freetype2 )
find_path ( FREETYPE2_HEADER_DIR NAMES freetype.h HINTS ${ PC_FREETYPE2_INCLUDE_DIRS } ${ PC_FREETYPE2_INCLUDEDIR } $ENV{ FREETYPE_DIR } /include PATH_SUFFIXES freetype )
find_path ( FREETYPE2_ROOT_INCLUDE_DIR NAMES freetype/freetype.h HINTS ${ PC_FREETYPE2_INCLUDE_DIRS } ${ PC_FREETYPE2_INCLUDEDIR } $ENV{ FREETYPE_DIR } /include )
2017-04-04 10:33:51 +00:00
if ( CMAKE_BUILD_TYPE MATCHES Debug )
2017-04-19 18:29:46 +00:00
set ( FREETYPE2_LIBRARY_NAME freetyped )
2017-04-04 10:33:51 +00:00
else ( )
2017-04-19 18:29:46 +00:00
set ( FREETYPE2_LIBRARY_NAME freetype )
2017-04-04 10:33:51 +00:00
endif ( )
2017-04-19 18:29:46 +00:00
find_library ( FREETYPE2_LIBRARIES ${ FREETYPE2_LIBRARY_NAME } HINTS ${ PC_FREETYPE2_LIBDIR } ${ PC_FREETYPE2_LIBRARY_DIRS } $ENV{ FREETYPE_DIR } /lib )
2017-04-04 10:33:51 +00:00
2017-04-19 18:29:46 +00:00
include_directories ( AFTER ${ FREETYPE2_HEADER_DIR } ${ FREETYPE2_ROOT_INCLUDE_DIR } )
2017-04-04 10:33:51 +00:00
2017-04-11 17:02:14 +00:00
list ( APPEND project_sources ${ PROJECT_SOURCE_DIR } /src/hb-ft.cc )
list ( APPEND project_headers ${ PROJECT_SOURCE_DIR } /src/hb-ft.h )
2017-04-19 18:29:46 +00:00
list ( APPEND THIRD_PARTY_LIBS ${ FREETYPE2_LIBRARIES } )
mark_as_advanced ( FREETYPE2_HEADER_DIR FREETYPE2_ROOT_INCLUDE_DIR FREETYPE2_LIBRARIES )
2017-04-04 10:33:51 +00:00
endif ( )
2017-04-11 18:48:18 +00:00
if ( HB_HAVE_GRAPHITE2 )
add_definitions ( -DHAVE_GRAPHITE2 )
find_path ( GRAPHITE2_INCLUDE_DIR graphite2/Font.h )
find_library ( GRAPHITE2_LIBRARY graphite2 )
include_directories ( ${ GRAPHITE2_INCLUDE_DIR } )
list ( APPEND project_sources ${ PROJECT_SOURCE_DIR } /src/hb-graphite2.cc )
list ( APPEND project_headers ${ PROJECT_SOURCE_DIR } /src/hb-graphite2.h )
list ( APPEND THIRD_PARTY_LIBS ${ GRAPHITE2_LIBRARY } )
2017-04-19 18:29:46 +00:00
mark_as_advanced ( GRAPHITE2_INCLUDE_DIR GRAPHITE2_LIBRARY )
2017-04-11 18:48:18 +00:00
endif ( )
2017-04-04 10:33:51 +00:00
if ( HB_BUILTIN_UCDN )
include_directories ( src/hb-ucdn )
add_definitions ( -DHAVE_UCDN )
2017-04-11 17:02:14 +00:00
list ( APPEND project_sources
2017-04-05 09:21:23 +00:00
$ { P R O J E C T _ S O U R C E _ D I R } / s r c / h b - u c d n . c c
2017-05-13 17:02:56 +00:00
$ { L I B H B _ U C D N _ s o u r c e s }
)
2017-04-11 17:02:14 +00:00
endif ( )
if ( HB_HAVE_GLIB )
add_definitions ( -DHAVE_GLIB )
# https://github.com/WebKit/webkit/blob/master/Source/cmake/FindGLIB.cmake
find_package ( PkgConfig )
pkg_check_modules ( PC_GLIB QUIET glib-2.0 )
find_library ( GLIB_LIBRARIES NAMES glib-2.0 HINTS ${ PC_GLIB_LIBDIR } ${ PC_GLIB_LIBRARY_DIRS } )
find_path ( GLIBCONFIG_INCLUDE_DIR NAMES glibconfig.h HINTS ${ PC_LIBDIR } ${ PC_LIBRARY_DIRS } ${ PC_GLIB_INCLUDEDIR } ${ PC_GLIB_INCLUDE_DIRS } PATH_SUFFIXES glib-2.0/include )
find_path ( GLIB_INCLUDE_DIR NAMES glib.h HINTS ${ PC_GLIB_INCLUDEDIR } ${ PC_GLIB_INCLUDE_DIRS } PATH_SUFFIXES glib-2.0 )
include_directories ( ${ GLIBCONFIG_INCLUDE_DIR } ${ GLIB_INCLUDE_DIR } )
list ( APPEND project_sources ${ PROJECT_SOURCE_DIR } /src/hb-glib.cc )
list ( APPEND project_headers ${ PROJECT_SOURCE_DIR } /src/hb-glib.h )
list ( APPEND THIRD_PARTY_LIBS ${ GLIB_LIBRARIES } )
2017-04-19 18:29:46 +00:00
mark_as_advanced ( GLIB_LIBRARIES GLIBCONFIG_INCLUDE_DIR GLIB_INCLUDE_DIR )
2017-04-04 10:33:51 +00:00
endif ( )
2017-04-11 18:48:18 +00:00
if ( HB_HAVE_ICU )
add_definitions ( -DHAVE_ICU )
# https://github.com/WebKit/webkit/blob/master/Source/cmake/FindICU.cmake
find_package ( PkgConfig )
pkg_check_modules ( PC_ICU QUIET icu-uc )
find_path ( ICU_INCLUDE_DIR NAMES unicode/utypes.h HINTS ${ PC_ICU_INCLUDE_DIRS } ${ PC_ICU_INCLUDEDIR } )
find_library ( ICU_LIBRARY NAMES libicuuc cygicuuc cygicuuc32 icuuc HINTS ${ PC_ICU_LIBRARY_DIRS } ${ PC_ICU_LIBDIR } )
include_directories ( ${ ICU_INCLUDE_DIR } )
list ( APPEND project_sources ${ PROJECT_SOURCE_DIR } /src/hb-icu.cc )
list ( APPEND project_headers ${ PROJECT_SOURCE_DIR } /src/hb-icu.h )
list ( APPEND THIRD_PARTY_LIBS ${ ICU_LIBRARY } )
2017-04-19 18:29:46 +00:00
mark_as_advanced ( ICU_INCLUDE_DIR ICU_LIBRARY )
2017-04-11 18:48:18 +00:00
endif ( )
2017-04-04 10:33:51 +00:00
if ( APPLE AND HB_HAVE_CORETEXT )
# Apple Advanced Typography
add_definitions ( -DHAVE_CORETEXT )
2017-04-11 17:02:14 +00:00
list ( APPEND project_sources ${ PROJECT_SOURCE_DIR } /src/hb-coretext.cc )
list ( APPEND project_headers ${ PROJECT_SOURCE_DIR } /src/hb-coretext.h )
2017-04-04 10:33:51 +00:00
find_library ( APPLICATION_SERVICES_FRAMEWORK ApplicationServices )
if ( APPLICATION_SERVICES_FRAMEWORK )
2017-04-11 17:02:14 +00:00
list ( APPEND THIRD_PARTY_LIBS ${ APPLICATION_SERVICES_FRAMEWORK } )
2017-04-04 10:33:51 +00:00
endif ( APPLICATION_SERVICES_FRAMEWORK )
2017-04-19 18:29:46 +00:00
mark_as_advanced ( APPLICATION_SERVICES_FRAMEWORK )
2017-04-04 10:33:51 +00:00
endif ( )
if ( WIN32 AND HB_HAVE_UNISCRIBE )
add_definitions ( -DHAVE_UNISCRIBE )
2017-04-11 17:02:14 +00:00
list ( APPEND project_sources ${ PROJECT_SOURCE_DIR } /src/hb-uniscribe.cc )
list ( APPEND project_headers ${ PROJECT_SOURCE_DIR } /src/hb-uniscribe.h )
2017-04-04 10:33:51 +00:00
2017-04-11 17:02:14 +00:00
list ( APPEND THIRD_PARTY_LIBS usp10 gdi32 rpcrt4 )
2017-04-04 10:33:51 +00:00
endif ( )
if ( WIN32 AND HB_HAVE_DIRECTWRITE )
add_definitions ( -DHAVE_DIRECTWRITE )
2017-04-11 17:02:14 +00:00
list ( APPEND project_sources ${ PROJECT_SOURCE_DIR } /src/hb-directwrite.cc )
list ( APPEND project_headers ${ PROJECT_SOURCE_DIR } /src/hb-directwrite.h )
2017-04-04 10:33:51 +00:00
2017-04-11 17:02:14 +00:00
list ( APPEND THIRD_PARTY_LIBS dwrite rpcrt4 )
2017-04-04 10:33:51 +00:00
endif ( )
2017-05-04 16:01:42 +00:00
2017-04-04 10:33:51 +00:00
2017-04-13 23:55:50 +00:00
## Atomic ops availability detection
file ( WRITE "${PROJECT_BINARY_DIR}/try_compile_intel_atomic_primitives.c"
" v o i d memory_barrier ( void ) { __sync_synchronize ( ) ; }
i n t atomic_add ( int *i ) { r e t u r n __sync_fetch_and_add ( i, 1 ) ; }
i n t mutex_trylock ( int *m ) { r e t u r n __sync_lock_test_and_set ( m, 1 ) ; }
v o i d mutex_unlock ( int *m ) { __sync_lock_release ( m ) ; }
2017-04-14 00:38:11 +00:00
i n t main ( ) { r e t u r n 0 ; }
2017-04-13 23:55:50 +00:00
" )
try_compile ( HB_HAVE_INTEL_ATOMIC_PRIMITIVES
$ { P R O J E C T _ B I N A R Y _ D I R } / t r y _ c o m p i l e _ i n t e l _ a t o m i c _ p r i m i t i v e s
S O U R C E S $ { P R O J E C T _ B I N A R Y _ D I R } / t r y _ c o m p i l e _ i n t e l _ a t o m i c _ p r i m i t i v e s . c )
if ( HB_HAVE_INTEL_ATOMIC_PRIMITIVES )
add_definitions ( -DHAVE_INTEL_ATOMIC_PRIMITIVES )
endif ( )
file ( WRITE "${PROJECT_BINARY_DIR}/try_compile_solaris_atomic_ops.c"
" #include <atomic.h>
/ * T h i s r e q u i r e s S o l a r i s S t u d i o 1 2 . 2 o r n e w e r : * /
#include <mbarrier.h>
v o i d memory_barrier ( void ) { __machine_rw_barrier ( ) ; }
i n t atomic_add ( volatile unsigned *i ) { r e t u r n atomic_add_int_nv ( i, 1 ) ; }
v o i d * atomic_ptr_cmpxchg ( volatile void **target, void *cmp, void *newval ) { r e t u r n atomic_cas_ptr ( target, cmp, newval ) ; }
2017-04-14 00:38:11 +00:00
i n t main ( ) { r e t u r n 0 ; }
2017-04-13 23:55:50 +00:00
" )
try_compile ( HB_HAVE_SOLARIS_ATOMIC_OPS
$ { P R O J E C T _ B I N A R Y _ D I R } / t r y _ c o m p i l e _ s o l a r i s _ a t o m i c _ o p s
S O U R C E S $ { P R O J E C T _ B I N A R Y _ D I R } / t r y _ c o m p i l e _ s o l a r i s _ a t o m i c _ o p s . c )
2017-04-14 00:01:17 +00:00
if ( HB_HAVE_SOLARIS_ATOMIC_OPS )
add_definitions ( -DHAVE_SOLARIS_ATOMIC_OPS )
2017-04-13 23:55:50 +00:00
endif ( )
2017-05-04 16:01:42 +00:00
## Define harfbuzz library
2017-04-19 18:29:46 +00:00
add_library ( harfbuzz ${ project_sources } ${ project_headers } )
2017-04-04 10:33:51 +00:00
target_link_libraries ( harfbuzz ${ THIRD_PARTY_LIBS } )
2017-05-04 16:01:42 +00:00
2017-05-13 17:02:56 +00:00
## Additional framework build configs
if ( BUILD_FRAMEWORK )
set ( CMAKE_MACOSX_RPATH ON )
set_target_properties ( harfbuzz PROPERTIES
F R A M E W O R K T R U E
P U B L I C _ H E A D E R " $ { p r o j e c t _ h e a d e r s } "
X C O D E _ A T T R I B U T E _ I N S T A L L _ P A T H " @ r p a t h "
)
set ( MACOSX_FRAMEWORK_IDENTIFIER "harfbuzz" )
set ( MACOSX_FRAMEWORK_SHORT_VERSION_STRING "${HB_VERSION}" )
set ( MACOSX_FRAMEWORK_BUNDLE_VERSION "${HB_VERSION}" )
endif ( )
2017-05-04 16:01:42 +00:00
## Additional harfbuzz build artifacts
2017-04-11 17:02:14 +00:00
if ( HB_BUILD_UTILS )
# https://github.com/WebKit/webkit/blob/master/Source/cmake/FindCairo.cmake
find_package ( PkgConfig )
pkg_check_modules ( PC_CAIRO QUIET cairo )
find_path ( CAIRO_INCLUDE_DIRS NAMES cairo.h HINTS ${ PC_CAIRO_INCLUDEDIR } ${ PC_CAIRO_INCLUDE_DIRS } PATH_SUFFIXES cairo )
find_library ( CAIRO_LIBRARIESNAMES cairo HINTS ${ PC_CAIRO_LIBDIR } ${ PC_CAIRO_LIBRARY_DIRS } )
add_definitions ( "-DPACKAGE_NAME=\" HarfBuzz\ "" )
add_definitions ( "-DPACKAGE_VERSION=\" ${ HB_VERSION } \"")
include_directories ( ${ CAIRO_INCLUDE_DIRS } )
add_executable ( hb-view ${ HB_VIEW_sources } )
target_link_libraries ( hb-view harfbuzz ${ CAIRO_LIBRARIESNAMES } )
add_executable ( hb-shape ${ HB_SHAPE_sources } )
target_link_libraries ( hb-shape harfbuzz )
add_executable ( hb-ot-shape-closure ${ HB_OT_SHAPE_CLOSURE_sources } )
target_link_libraries ( hb-ot-shape-closure harfbuzz )
2017-04-19 18:29:46 +00:00
2017-05-04 16:01:42 +00:00
mark_as_advanced ( CAIRO_INCLUDE_DIRS CAIRO_LIBRARIESNAMES )
2017-04-11 17:02:14 +00:00
endif ( )
2017-05-04 16:01:42 +00:00
2017-04-04 10:33:51 +00:00
## Install
if ( NOT SKIP_INSTALL_HEADERS AND NOT SKIP_INSTALL_ALL )
install ( FILES ${ project_headers } DESTINATION include/harfbuzz )
endif ( )
if ( NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL )
install ( TARGETS harfbuzz
A R C H I V E D E S T I N A T I O N l i b
L I B R A R Y D E S T I N A T I O N l i b
R U N T I M E D E S T I N A T I O N b i n
2017-05-13 17:02:56 +00:00
F R A M E W O R K D E S T I N A T I O N L i b r a r y / F r a m e w o r k s
2017-04-04 10:33:51 +00:00
)
endif ( )