Fix Freetype cmake module
This commit is contained in:
parent
bffbe94377
commit
62d7bcf841
@ -3,11 +3,7 @@
|
||||
# FREETYPE_FOUND
|
||||
# FREETYPE_INCLUDE_DIRS
|
||||
# FREETYPE_LIBRARIES
|
||||
#
|
||||
|
||||
if(FREETYPE_INCLUDE_DIRS AND FREETYPE_LIBRARIES)
|
||||
set(FREETYPE_FOUND TRUE)
|
||||
else()
|
||||
find_package(PkgConfig QUIET)
|
||||
if (PKG_CONFIG_FOUND)
|
||||
pkg_check_modules(_FREETYPE QUIET freetype2)
|
||||
@ -32,7 +28,7 @@ else()
|
||||
PATHS
|
||||
/usr/include /usr/local/include /opt/local/include /sw/include
|
||||
PATH_SUFFIXES
|
||||
include/freetype2 include)
|
||||
freetype2 include/freetype2 include)
|
||||
|
||||
find_path(FREETYPE_INCLUDE_DIR_freetype2
|
||||
NAMES
|
||||
@ -48,17 +44,20 @@ else()
|
||||
PATHS
|
||||
/usr/include /usr/local/include /opt/local/include /sw/include
|
||||
PATH_SUFFIXES
|
||||
include/freetype2 include)
|
||||
freetype2 include/freetype2 include)
|
||||
|
||||
find_library(FREETYPE_LIB
|
||||
NAMES ${_FREETYPE_LIBRARIES} freetype libfreetype
|
||||
HINTS
|
||||
${_FREETYPE_LIBRARY_DIRS}
|
||||
"${FREETYPE_INCLUDE_DIR_ft2build}/../lib"
|
||||
"${CMAKE_SOURCE_DIR}/additional_install_files/lib${_lib_suffix}"
|
||||
"$ENV{obsAdditionalInstallFiles}/lib${_lib_suffix}"
|
||||
"${FREETYPE_INCLUDE_DIR_ft2build}/../../lib${_lib_suffix}"
|
||||
"${FREETYPE_INCLUDE_DIR_ft2build}/../../lib"
|
||||
"${FREETYPE_INCLUDE_DIR_ft2build}/../lib${_lib_suffix}"
|
||||
"${FREETYPE_INCLUDE_DIR_ft2build}/../libs${_lib_suffix}"
|
||||
"${FREETYPE_INCLUDE_DIR_ft2build}/lib"
|
||||
"${FREETYPE_INCLUDE_DIR_ft2build}/../lib"
|
||||
"${FREETYPE_INCLUDE_DIR_ft2build}/lib${_lib_suffix}"
|
||||
"${FREETYPE_INCLUDE_DIR_ft2build}/lib"
|
||||
ENV FREETYPE_DIR
|
||||
PATHS
|
||||
/usr/lib /usr/local/lib /opt/local/lib /sw/lib
|
||||
@ -72,10 +71,11 @@ else()
|
||||
unset(FREETYPE_INCLUDE_DIR)
|
||||
endif()
|
||||
|
||||
set(FREETYPE_INCLUDE_DIRS ${FREETYPE_INCLUDE_DIR} CACHE PATH "freetype include dirs")
|
||||
set(FREETYPE_LIBRARIES ${FREETYPE_LIB} CACHE STRING "freetype libraries")
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(Freetype DEFAULT_MSG FREETYPE_LIB FREETYPE_INCLUDE_DIR_ft2build FREETYPE_INCLUDE_DIR_freetype2)
|
||||
mark_as_advanced(FREETYPE_INCLUDE_DIR FREETYPE_INCLUDE_DIR_ft2build FREETYPE_INCLUDE_DIR_freetype2 FREETYPE_LIB)
|
||||
|
||||
if(FREETYPE_FOUND)
|
||||
set(FREETYPE_INCLUDE_DIRS ${FREETYPE_INCLUDE_DIR})
|
||||
set(FREETYPE_LIBRARIES ${FREETYPE_LIB})
|
||||
endif()
|
||||
|
Loading…
x
Reference in New Issue
Block a user