From b54ab482b50c0dc28de55bff2281f160ac358e28 Mon Sep 17 00:00:00 2001 From: jp9000 Date: Wed, 20 Aug 2014 15:13:59 -0700 Subject: [PATCH] Fix freetype cmake module On fedora, the freetype cmake module would not find the correct location. This is because it wasn't using the pkg-cofig include directory, which is different from the main ft2build.h header directory (which is /usr/include). This modification may be a good thing to do on all the cmake packages, actually. Currently, they all just search for the location of a specific header, and ignore the pkg-config includes if they find it in specific hint locations. --- cmake/Modules/FindFreetype.cmake | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/cmake/Modules/FindFreetype.cmake b/cmake/Modules/FindFreetype.cmake index 71e593106..76d85721c 100644 --- a/cmake/Modules/FindFreetype.cmake +++ b/cmake/Modules/FindFreetype.cmake @@ -25,16 +25,20 @@ else() set(FREETYPE_PATH_ARCH FreetypePath${_lib_suffix}) - find_path(FREETYPE_INCLUDE_DIR - NAMES ft2build.h - HINTS - ${_FREETYPE_INCLUDE_DIRS} - "${CMAKE_SOURCE_DIR}/additional_install_files/include" - "$ENV{obsAdditionalInstallFiles}/include" - ENV FreetypePath - ENV ${FREETYPE_PATH_ARCH} - PATHS - /usr/include /usr/local/include /opt/local/include /sw/include) + if (NOT _FREETYPE_INCLUDE_DIRS STREQUAL "") + set (FREETYPE_INCLUDE_DIR ${_FREETYPE_INCLUDE_DIRS}) + else() + find_path(FREETYPE_INCLUDE_DIR + NAMES ft2build.h + HINTS + ${_FREETYPE_INCLUDE_DIRS} + "${CMAKE_SOURCE_DIR}/additional_install_files/include" + "$ENV{obsAdditionalInstallFiles}/include" + ENV FreetypePath + ENV ${FREETYPE_PATH_ARCH} + PATHS + /usr/include /usr/local/include /opt/local/include /sw/include) + endif() find_library(FREETYPE_LIB NAMES ${_FREETYPE_LIBRARIES} freetype libfreetype