summaryrefslogtreecommitdiffstats
path: root/project/cmake/modules/FindFreeType.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'project/cmake/modules/FindFreeType.cmake')
-rw-r--r--project/cmake/modules/FindFreeType.cmake49
1 files changed, 38 insertions, 11 deletions
diff --git a/project/cmake/modules/FindFreeType.cmake b/project/cmake/modules/FindFreeType.cmake
index a1e69ab..fb4c668 100644
--- a/project/cmake/modules/FindFreeType.cmake
+++ b/project/cmake/modules/FindFreeType.cmake
@@ -1,18 +1,45 @@
1# - Try to find freetype 1#.rst:
2# Once done this will define 2# FindFreetype
3# ------------
4# Finds the FreeType library
3# 5#
4# FREETYPE_FOUND - system has freetype 6# This will will define the following variables::
5# FREETYPE_INCLUDE_DIRS - the freetype include directory 7#
6# FREETYPE_LIBRARIES - The freetype libraries 8# FREETYPE_FOUND - system has FreeType
9# FREETYPE_INCLUDE_DIRS - the FreeType include directory
10# FREETYPE_LIBRARIES - the FreeType libraries
11#
12# and the following imported targets::
13#
14# FreeType::FreeType - The FreeType library
7 15
8if(PKG_CONFIG_FOUND) 16if(PKG_CONFIG_FOUND)
9 pkg_check_modules (FREETYPE freetype2) 17 pkg_check_modules(PC_FREETYPE freetype2 QUIET)
10else()
11 find_path(FREETYPE_INCLUDE_DIRS freetype/freetype.h)
12 find_library(FREETYPE_LIBRARIES NAMES freetype freetype246MT)
13endif() 18endif()
14 19
20find_path(FREETYPE_INCLUDE_DIR NAMES freetype/freetype.h freetype.h
21 PATHS ${PC_FREETYPE_INCLUDEDIR}
22 ${PC_FREETYPE_INCLUDE_DIRS})
23find_library(FREETYPE_LIBRARY NAMES freetype freetype246MT
24 PATHS ${PC_FREETYPE_LIBDIR})
25
26set(FREETYPE_VERSION ${PC_FREETYPE_VERSION})
27
15include(FindPackageHandleStandardArgs) 28include(FindPackageHandleStandardArgs)
16find_package_handle_standard_args(FreeType DEFAULT_MSG FREETYPE_INCLUDE_DIRS FREETYPE_LIBRARIES) 29find_package_handle_standard_args(FreeType
30 REQUIRED_VARS FREETYPE_LIBRARY FREETYPE_INCLUDE_DIR
31 VERSION_VAR FREETYPE_VERSION)
32
33if(FREETYPE_FOUND)
34 set(FREETYPE_LIBRARIES ${FREETYPE_LIBRARY})
35 set(FREETYPE_INCLUDE_DIRS ${FREETYPE_INCLUDE_DIR})
36
37 if(NOT TARGET FreeType::FreeType)
38 add_library(FreeType::FreeType UNKNOWN IMPORTED)
39 set_target_properties(FreeType::FreeType PROPERTIES
40 IMPORTED_LOCATION "${FREETYPE_LIBRARY}"
41 INTERFACE_INCLUDE_DIRECTORIES "${FREETYPE_INCLUDE_DIR}")
42 endif()
43endif()
17 44
18mark_as_advanced(FREETYPE_INCLUDE_DIRS FREETYPE_LIBRARIES) 45mark_as_advanced(FREETYPE_INCLUDE_DIR FREETYPE_LIBRARY)