OSG_TEXT_USE_FONTCONFIG cmake option added: Set to ON to enable attempt to use FontConfig in osgText; Disabled by default for iOS and Android

This commit is contained in:
konstantin.matveyev 2019-07-26 14:09:36 +03:00 committed by Robert Osfield
parent 2716c8a32b
commit 36a3c5f2b2
2 changed files with 10 additions and 1 deletions

View File

@ -506,6 +506,12 @@ ENDIF()
OPTION(OSG_GL_LIBRARY_STATIC "Set to ON to statically link with OpenGL/GLES library." OFF)
IF (OSG_BUILD_PLATFORM_IPHONE OR ANDROID)
OPTION(OSG_TEXT_USE_FONTCONFIG "Set to ON to enable attempt to use FontConfig in osgText." OFF)
ELSE ()
OPTION(OSG_TEXT_USE_FONTCONFIG "Set to OFF to disable attempt to use FontConfig in osgText." ON)
ENDIF ()
# Map the OSG_GL*_AVAILABLE settings to OSG_GL_* settings
IF (OSG_GLES2_AVAILABLE OR OSG_GLES3_AVAILABLE OR OSG_GL3_AVAILABLE)
OPTION(OSG_GL_DISPLAYLISTS_AVAILABLE "Set to OFF to disable use of OpenGL display lists." OFF)

View File

@ -1,4 +1,4 @@
IF(NOT OSG_BUILD_PLATFORM_IPHONE AND NOT ANDROID)
IF(OSG_TEXT_USE_FONTCONFIG)
find_package(Fontconfig MODULE)
ENDIF()
@ -54,8 +54,11 @@ SET(TARGET_LIBRARIES
SET(COMPONENT_PKGCONFIG_DESCRIPTION "Text rendering library for OpenSceneGraph")
if(Fontconfig_FOUND)
MESSAGE(STATUS "osgText will be linked with FontConfig library")
list(APPEND TARGET_LIBRARIES Fontconfig::Fontconfig)
ADD_DEFINITIONS(-DWITH_FONTCONFIG)
else()
MESSAGE(STATUS "osgText will not be linked with FontConfig library")
endif()
SETUP_LIBRARY(${LIB_NAME})