From: rnv Date: Wed, 25 Jan 2017 15:42:58 +0000 (+0300) Subject: Fix problems with freetype includes. X-Git-Tag: SHAPER_2.7.0~6 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=7d62bde90bf3a6af1b04579da8b7a8de68011c3a;p=tools%2Fconfiguration.git Fix problems with freetype includes. --- diff --git a/cmake/FindSalomeCAS.cmake b/cmake/FindSalomeCAS.cmake index f1c843c..37c7028 100755 --- a/cmake/FindSalomeCAS.cmake +++ b/cmake/FindSalomeCAS.cmake @@ -51,6 +51,25 @@ ELSE() SET(CAS_BINPLUGIN TKBin) ENDIF() +# Workaround: detect and add freetype to CAS_INCLUDE_DIRS +# It will be suppressed after migration OCCT detection procedure to CONFIG mode +# and the correction of the several bugs in the OCCT CMake configuration. +SET(Freetype_DIR $ENV{FREETYPE_ROOT_DIR}) +# Standard CMake Findfreetype.cmake doesn't find ft2build.h, do it manually: +# 1. Find custom freetype +FIND_PATH( FREETYPE_INCLUDE_DIR_ft2build ft2build.h + PATHS $ENV{FREETYPE_ROOT_DIR} + PATH_SUFFIXES include/freetype2 include freetype2 + NO_DEFAULT_PATH ) + +# 2. Find native freetype, if custom doesn't found: +IF(NOT FREETYPE_INCLUDE_DIR_ft2build) + FIND_PATH( FREETYPE_INCLUDE_DIR_ft2build ft2build.h + PATH_SUFFIXES include/freetype2 include freetype2 ) +ENDIF() +SET(CAS_INCLUDE_DIRS ${CAS_INCLUDE_DIRS} ${FREETYPE_INCLUDE_DIR_freetype2} ${FREETYPE_INCLUDE_DIR_ft2build}) +# End of workaround + IF(CAS_FOUND) SALOME_ACCUMULATE_HEADERS(CAS_INCLUDE_DIRS) SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${CAS_TKernel})