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.
This commit is contained in:
jp9000 2014-08-20 15:13:59 -07:00
parent 5291760cf8
commit b54ab482b5

View File

@ -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