1 # - Find library containing Matroska()
2 # The following variables are set if Matroska is found. If Matroska is not
3 # found, Matroska_FOUND is set to false.
4 # Matroska_FOUND - System has Matroska.
5 # Matroska_LIBRARIES - Link these to use Matroska.
6 # Matroska_CFLAGS - Link these to use Matroska.
9 if (NOT Matroska_SEARCHED)
10 include(CheckLibraryExists)
12 set(Matroska_SEARCHED TRUE CACHE INTERNAL "")
13 set(Matroska_FOUND FALSE CACHE INTERNAL "")
15 pkg_check_modules(matroska libmatroska)
17 if (NOT Matroska_FOUND)
18 set(Matroska_LIBRARIES "")
19 find_library( matroska_LIBRARY matroska )
21 set(Matroska_LIBRARIES "${matroska_LIBRARY}")
22 set(Matroska_FOUND TRUE CACHE INTERNAL "")
23 endif (matroska_LIBRARY)
24 foreach (library ebml ebml_pic)
25 find_library( ${library}_LIBRARY ${library} )
26 if (${library}_LIBRARY)
27 set(Matroska_LIBRARIES "${library};${Matroska_LIBRARIES}")
28 endif (${library}_LIBRARY)
30 set(Matroska_LIBRARIES "${Matroska_LIBRARIES}" CACHE INTERNAL STRING)
31 endif (NOT Matroska_FOUND)
34 if (NOT Matroska_FIND_QUIETLY)
35 message(STATUS "Found Matroska in: ${Matroska_LIBRARIES}")
36 endif (NOT Matroska_FIND_QUIETLY)
38 if (Matroska_FIND_REQUIRED)
39 message(FATAL_ERROR "Could not find the library containing Matroska")
40 endif (Matroska_FIND_REQUIRED)
41 endif (Matroska_FOUND)
43 mark_as_advanced(Matroska_LIBRARIES)
44 endif(NOT Matroska_SEARCHED)