diff options
Diffstat (limited to 'project/cmake/modules/FindASS.cmake')
| -rw-r--r-- | project/cmake/modules/FindASS.cmake | 48 |
1 files changed, 37 insertions, 11 deletions
diff --git a/project/cmake/modules/FindASS.cmake b/project/cmake/modules/FindASS.cmake index 5f4b0c7..2d592fa 100644 --- a/project/cmake/modules/FindASS.cmake +++ b/project/cmake/modules/FindASS.cmake | |||
| @@ -1,18 +1,44 @@ | |||
| 1 | # - Try to find ASS | 1 | #.rst: |
| 2 | # Once done this will define | 2 | # FindASS |
| 3 | # ------- | ||
| 4 | # Finds the ASS library | ||
| 3 | # | 5 | # |
| 4 | # ASS_FOUND - system has libass | 6 | # This will will define the following variables:: |
| 5 | # ASS_INCLUDE_DIRS - the libass include directory | 7 | # |
| 6 | # ASS_LIBRARIES - The libass libraries | 8 | # ASS_FOUND - system has ASS |
| 9 | # ASS_INCLUDE_DIRS - the ASS include directory | ||
| 10 | # ASS_LIBRARIES - the ASS libraries | ||
| 11 | # | ||
| 12 | # and the following imported targets:: | ||
| 13 | # | ||
| 14 | # ASS::ASS - The ASS library | ||
| 7 | 15 | ||
| 8 | if(PKG_CONFIG_FOUND) | 16 | if(PKG_CONFIG_FOUND) |
| 9 | pkg_check_modules (ASS libass) | 17 | pkg_check_modules(PC_ASS libass QUIET) |
| 10 | else() | ||
| 11 | find_path(ASS_INCLUDE_DIRS ass/ass.h) | ||
| 12 | find_library(ASS_LIBRARIES NAMES ass libass) | ||
| 13 | endif() | 18 | endif() |
| 14 | 19 | ||
| 20 | find_path(ASS_INCLUDE_DIR NAMES ass/ass.h | ||
| 21 | PATHS ${PC_ASS_INCLUDEDIR}) | ||
| 22 | find_library(ASS_LIBRARY NAMES ass libass | ||
| 23 | PATHS ${PC_ASS_LIBDIR}) | ||
| 24 | |||
| 25 | set(ASS_VERSION ${PC_ASS_VERSION}) | ||
| 26 | |||
| 15 | include(FindPackageHandleStandardArgs) | 27 | include(FindPackageHandleStandardArgs) |
| 16 | find_package_handle_standard_args(ASS DEFAULT_MSG ASS_INCLUDE_DIRS ASS_LIBRARIES) | 28 | find_package_handle_standard_args(ASS |
| 29 | REQUIRED_VARS ASS_LIBRARY ASS_INCLUDE_DIR | ||
| 30 | VERSION_VAR ASS_VERSION) | ||
| 31 | |||
| 32 | if(ASS_FOUND) | ||
| 33 | set(ASS_LIBRARIES ${ASS_LIBRARY}) | ||
| 34 | set(ASS_INCLUDE_DIRS ${ASS_INCLUDE_DIR}) | ||
| 35 | |||
| 36 | if(NOT TARGET ASS::ASS) | ||
| 37 | add_library(ASS::ASS UNKNOWN IMPORTED) | ||
| 38 | set_target_properties(ASS::ASS PROPERTIES | ||
| 39 | IMPORTED_LOCATION "${ASS_LIBRARY}" | ||
| 40 | INTERFACE_INCLUDE_DIRECTORIES "${ASS_INCLUDE_DIR}") | ||
| 41 | endif() | ||
| 42 | endif() | ||
| 17 | 43 | ||
| 18 | mark_as_advanced(ASS_INCLUDE_DIRS ASS_LIBRARIES) | 44 | mark_as_advanced(ASS_INCLUDE_DIR ASS_LIBRARY) |
