diff options
| author | manuel <manuel@mausz.at> | 2016-03-08 21:02:53 +0100 |
|---|---|---|
| committer | manuel <manuel@mausz.at> | 2016-03-08 21:02:53 +0100 |
| commit | 9fc8b732737f139d3e466510d75668ab45578960 (patch) | |
| tree | 76db9bf5cb8cc869be908a5ed3d6f4cca3e3608a /project/cmake/modules/FindTagLib.cmake | |
| parent | b75e2659df11c23aa921d2eed83c23adc282ed27 (diff) | |
| download | kodi-pvr-build-9fc8b732737f139d3e466510d75668ab45578960.tar.gz kodi-pvr-build-9fc8b732737f139d3e466510d75668ab45578960.tar.bz2 kodi-pvr-build-9fc8b732737f139d3e466510d75668ab45578960.zip | |
sync with upstream
Diffstat (limited to 'project/cmake/modules/FindTagLib.cmake')
| -rw-r--r-- | project/cmake/modules/FindTagLib.cmake | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/project/cmake/modules/FindTagLib.cmake b/project/cmake/modules/FindTagLib.cmake new file mode 100644 index 0000000..b515e81 --- /dev/null +++ b/project/cmake/modules/FindTagLib.cmake | |||
| @@ -0,0 +1,62 @@ | |||
| 1 | #.rst: | ||
| 2 | # FindTagLib | ||
| 3 | # ---------- | ||
| 4 | # Finds the TagLib library | ||
| 5 | # | ||
| 6 | # This will will define the following variables:: | ||
| 7 | # | ||
| 8 | # TAGLIB_FOUND - system has TagLib | ||
| 9 | # TAGLIB_INCLUDE_DIRS - the TagLib include directory | ||
| 10 | # TAGLIB_LIBRARIES - the TagLib libraries | ||
| 11 | # | ||
| 12 | # and the following imported targets:: | ||
| 13 | # | ||
| 14 | # TagLib::TagLib - The TagLib library | ||
| 15 | |||
| 16 | if(PKG_CONFIG_FOUND) | ||
| 17 | pkg_check_modules(PC_TAGLIB taglib>=1.8.0 QUIET) | ||
| 18 | endif() | ||
| 19 | |||
| 20 | find_path(TAGLIB_INCLUDE_DIR taglib/tag.h | ||
| 21 | PATHS ${PC_TAGLIB_INCLUDEDIR}) | ||
| 22 | find_library(TAGLIB_LIBRARY_RELEASE NAMES tag | ||
| 23 | PATH_SUFFIXES ${CONFIGURATION_LIBDIR_RELEASE} | ||
| 24 | PATHS ${PC_TAGLIB_LIBDIR}) | ||
| 25 | find_library(TAGLIB_LIBRARY_DEBUG NAMES tag | ||
| 26 | PATH_SUFFIXES ${CONFIGURATION_LIBDIR_DEBUG} | ||
| 27 | PATHS ${PC_TAGLIB_LIBDIR}) | ||
| 28 | set(TAGLIB_VERSION ${PC_TAGLIB_VERSION}) | ||
| 29 | |||
| 30 | include(SelectLibraryConfigurations) | ||
| 31 | select_library_configurations(TAGLIB) | ||
| 32 | |||
| 33 | include(FindPackageHandleStandardArgs) | ||
| 34 | find_package_handle_standard_args(TAGLIB | ||
| 35 | REQUIRED_VARS TAGLIB_LIBRARY TAGLIB_INCLUDE_DIR | ||
| 36 | VERSION_VAR TAGLIB_VERSION) | ||
| 37 | |||
| 38 | if(TAGLIB_FOUND) | ||
| 39 | set(TAGLIB_LIBRARIES ${TAGLIB_LIBRARY}) | ||
| 40 | |||
| 41 | # Workaround broken .pc file | ||
| 42 | list(APPEND TAGLIB_LIBRARIES ${PC_TAGLIB_ZLIB_LIBRARIES}) | ||
| 43 | |||
| 44 | set(TAGLIB_INCLUDE_DIRS ${TAGLIB_INCLUDE_DIR}) | ||
| 45 | if(NOT TARGET TagLib::TagLib) | ||
| 46 | add_library(TagLib::TagLib UNKNOWN IMPORTED) | ||
| 47 | if(TAGLIB_LIBRARY_RELEASE) | ||
| 48 | set_target_properties(TagLib::TagLib PROPERTIES | ||
| 49 | IMPORTED_CONFIGURATIONS RELEASE | ||
| 50 | IMPORTED_LOCATION "${TAGLIB_LIBRARY_RELEASE}") | ||
| 51 | endif() | ||
| 52 | if(TAGLIB_LIBRARY_DEBUG) | ||
| 53 | set_target_properties(TagLib::TagLib PROPERTIES | ||
| 54 | IMPORTED_CONFIGURATIONS DEBUG | ||
| 55 | IMPORTED_LOCATION "${TAGLIB_LIBRARY_DEBUG}") | ||
| 56 | endif() | ||
| 57 | set_target_properties(TagLib::TagLib PROPERTIES | ||
| 58 | INTERFACE_INCLUDE_DIRECTORIES "${TAGLIB_INCLUDE_DIR}") | ||
| 59 | endif() | ||
| 60 | endif() | ||
| 61 | |||
| 62 | mark_as_advanced(TAGLIB_INCLUDE_DIR TAGLIB_LIBRARY) | ||
