diff options
| author | manuel <manuel@mausz.at> | 2016-11-24 21:27:41 +0100 |
|---|---|---|
| committer | manuel <manuel@mausz.at> | 2016-11-24 21:27:41 +0100 |
| commit | 8cdf8dec703d882b46ca50a769fabb95ffc48e2c (patch) | |
| tree | f7fe8233508f79d3dc94f8f445ce6342e7dfbdbb /project/cmake/modules/FindFreeType.cmake | |
| parent | 5823b05feb29a59510c32a9c28ca18b50b9b6399 (diff) | |
| download | kodi-pvr-build-8cdf8dec703d882b46ca50a769fabb95ffc48e2c.tar.gz kodi-pvr-build-8cdf8dec703d882b46ca50a769fabb95ffc48e2c.tar.bz2 kodi-pvr-build-8cdf8dec703d882b46ca50a769fabb95ffc48e2c.zip | |
sync with upstream
Diffstat (limited to 'project/cmake/modules/FindFreeType.cmake')
| -rw-r--r-- | project/cmake/modules/FindFreeType.cmake | 49 |
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 | ||
| 8 | if(PKG_CONFIG_FOUND) | 16 | if(PKG_CONFIG_FOUND) |
| 9 | pkg_check_modules (FREETYPE freetype2) | 17 | pkg_check_modules(PC_FREETYPE freetype2 QUIET) |
| 10 | else() | ||
| 11 | find_path(FREETYPE_INCLUDE_DIRS freetype/freetype.h) | ||
| 12 | find_library(FREETYPE_LIBRARIES NAMES freetype freetype246MT) | ||
| 13 | endif() | 18 | endif() |
| 14 | 19 | ||
| 20 | find_path(FREETYPE_INCLUDE_DIR NAMES freetype/freetype.h freetype.h | ||
| 21 | PATHS ${PC_FREETYPE_INCLUDEDIR} | ||
| 22 | ${PC_FREETYPE_INCLUDE_DIRS}) | ||
| 23 | find_library(FREETYPE_LIBRARY NAMES freetype freetype246MT | ||
| 24 | PATHS ${PC_FREETYPE_LIBDIR}) | ||
| 25 | |||
| 26 | set(FREETYPE_VERSION ${PC_FREETYPE_VERSION}) | ||
| 27 | |||
| 15 | include(FindPackageHandleStandardArgs) | 28 | include(FindPackageHandleStandardArgs) |
| 16 | find_package_handle_standard_args(FreeType DEFAULT_MSG FREETYPE_INCLUDE_DIRS FREETYPE_LIBRARIES) | 29 | find_package_handle_standard_args(FreeType |
| 30 | REQUIRED_VARS FREETYPE_LIBRARY FREETYPE_INCLUDE_DIR | ||
| 31 | VERSION_VAR FREETYPE_VERSION) | ||
| 32 | |||
| 33 | if(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() | ||
| 43 | endif() | ||
| 17 | 44 | ||
| 18 | mark_as_advanced(FREETYPE_INCLUDE_DIRS FREETYPE_LIBRARIES) | 45 | mark_as_advanced(FREETYPE_INCLUDE_DIR FREETYPE_LIBRARY) |
