From 176210dd15fbfd76b3fc6633a32abbb85e7865e1 Mon Sep 17 00:00:00 2001 From: kervala Date: Wed, 13 Apr 2016 20:36:43 +0200 Subject: [PATCH] Fixed: Link to freetype when using Qt --- code/CMakeLists.txt | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/code/CMakeLists.txt b/code/CMakeLists.txt index 58c2d7db6..3d2cefe60 100644 --- a/code/CMakeLists.txt +++ b/code/CMakeLists.txt @@ -324,13 +324,19 @@ IF(WITH_QT5) ENDIF() # freetype is needed since Qt 5.5 - IF(UNIX) - SET(FREETYPE_LIB "${QT_LIBRARY_DIR}/libqtfreetype.a") - ELSEIF(WIN32) - SET(FREETYPE_LIB "${QT_LIBRARY_DIR}/qtfreetype.lib") - ENDIF() - IF(EXISTS ${FREETYPE_LIB}) - SET(QT_LIBRARIES ${QT_LIBRARIES} ${FREETYPE_LIB}) + FIND_PACKAGE(FreeType) + + IF(FREETYPE_FOUND) + SET(QT_LIBRARIES ${QT_LIBRARIES} ${FREETYPE_LIBRARIES}) + ELSE() + IF(UNIX) + SET(FREETYPE_LIB "${QT_LIBRARY_DIR}/libqtfreetype.a") + ELSEIF(WIN32) + SET(FREETYPE_LIB "${QT_LIBRARY_DIR}/qtfreetype.lib") + ENDIF() + IF(EXISTS ${FREETYPE_LIB}) + SET(QT_LIBRARIES ${QT_LIBRARIES} ${FREETYPE_LIB}) + ENDIF() ENDIF() ADD_QT_PLUGIN(accessible qtaccessiblewidgets)