2017-02-28 23:51:22 +00:00
|
|
|
find_package(PkgConfig QUIET)
|
2017-03-02 11:31:20 +00:00
|
|
|
pkg_check_modules(PC_FREETYPE freetype2)
|
|
|
|
set_extra_dirs(FREETYPE freetype)
|
|
|
|
|
|
|
|
find_path(FREETYPE_INCLUDEDIR ft2build.h
|
|
|
|
PATH_SUFFIXES freetype2
|
|
|
|
HINTS ${PC_FREETYPE_INCLUDEDIR} ${PC_FREETYPE_INCLUDE_DIRS}
|
|
|
|
PATHS ${EXTRA_FREETYPE_INCLUDEDIR}
|
|
|
|
)
|
|
|
|
find_library(FREETYPE_LIBRARY
|
|
|
|
NAMES freetype
|
|
|
|
HINTS ${PC_FREETYPE_LIBDIR} ${PC_FREETYPE_LIBRARY_DIRS}
|
|
|
|
PATHS ${EXTRA_FREETYPE_LIBDIR}
|
|
|
|
)
|
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
|
|
|
|
|
|
|
string(FIND "${FREETYPE_LIBRARY}" "${PROJECT_SOURCE_DIR}" LOCAL_PATH_POS)
|
|
|
|
if(LOCAL_PATH_POS EQUAL 0 AND TARGET_OS STREQUAL "windows")
|
|
|
|
set(FREETYPE_COPY_FILES "${EXTRA_FREETYPE_LIBDIR}/freetype.dll")
|
|
|
|
else()
|
|
|
|
set(FREETYPE_COPY_FILES)
|
|
|
|
endif()
|