2017-10-25 14:57:25 +00:00
|
|
|
if(NOT CMAKE_CROSSCOMPILING)
|
|
|
|
find_package(PkgConfig QUIET)
|
|
|
|
pkg_check_modules(PC_FREETYPE freetype2)
|
|
|
|
endif()
|
2017-03-02 11:31:20 +00:00
|
|
|
|
2017-10-24 10:10:46 +00:00
|
|
|
set_extra_dirs_lib(FREETYPE freetype)
|
|
|
|
find_library(FREETYPE_LIBRARY
|
2017-10-25 14:57:25 +00:00
|
|
|
NAMES freetype freetype.6
|
2017-10-24 10:10:46 +00:00
|
|
|
HINTS ${HINTS_FREETYPE_LIBDIR} ${PC_FREETYPE_LIBDIR} ${PC_FREETYPE_LIBRARY_DIRS}
|
|
|
|
PATHS ${PATHS_FREETYPE_LIBDIR}
|
2017-10-25 14:57:25 +00:00
|
|
|
${CROSSCOMPILING_NO_CMAKE_SYSTEM_PATH}
|
2017-10-24 10:10:46 +00:00
|
|
|
)
|
|
|
|
set_extra_dirs_include(FREETYPE freetype "${FREETYPE_LIBRARY}")
|
2017-03-21 12:35:51 +00:00
|
|
|
find_path(FREETYPE_INCLUDEDIR
|
|
|
|
NAMES config/ftheader.h freetype/config/ftheader.h
|
2017-03-02 11:31:20 +00:00
|
|
|
PATH_SUFFIXES freetype2
|
2017-07-31 16:30:24 +00:00
|
|
|
HINTS ${HINTS_FREETYPE_INCLUDEDIR} ${PC_FREETYPE_INCLUDEDIR} ${PC_FREETYPE_INCLUDE_DIRS}
|
|
|
|
PATHS ${PATHS_FREETYPE_INCLUDEDIR}
|
2017-10-25 14:57:25 +00:00
|
|
|
${CROSSCOMPILING_NO_CMAKE_SYSTEM_PATH}
|
2017-03-02 11:31:20 +00:00
|
|
|
)
|
2017-02-23 13:16:32 +00:00
|
|
|
|
|
|
|
include(FindPackageHandleStandardArgs)
|
2017-03-02 11:31:20 +00:00
|
|
|
find_package_handle_standard_args(Freetype DEFAULT_MSG FREETYPE_LIBRARY FREETYPE_INCLUDEDIR)
|
|
|
|
|
|
|
|
mark_as_advanced(FREETYPE_LIBRARY FREETYPE_INCLUDEDIR)
|
|
|
|
|
|
|
|
set(FREETYPE_LIBRARIES ${FREETYPE_LIBRARY})
|
|
|
|
set(FREETYPE_INCLUDE_DIRS ${FREETYPE_INCLUDEDIR})
|
2017-03-07 14:24:08 +00:00
|
|
|
|
2017-10-24 13:29:53 +00:00
|
|
|
is_bundled(IS_BUNDLED "${FREETYPE_LIBRARY}")
|
|
|
|
if(IS_BUNDLED AND TARGET_OS STREQUAL "windows")
|
2017-07-21 21:43:01 +00:00
|
|
|
set(FREETYPE_COPY_FILES "${EXTRA_FREETYPE_LIBDIR}/libfreetype.dll")
|
2017-03-07 14:24:08 +00:00
|
|
|
else()
|
|
|
|
set(FREETYPE_COPY_FILES)
|
|
|
|
endif()
|