From: Pierre d'Herbemont Date: Sat, 9 Feb 2008 00:07:43 +0000 (+0000) Subject: cmake: Detect matroska. X-Git-Tag: 0.9.0-test0~2778 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=72cb2e3e75021446b0a9c1f4ace767dbb6ff160f;p=vlc cmake: Detect matroska. --- diff --git a/extras/buildsystem/cmake/include/FindMatroska.cmake b/extras/buildsystem/cmake/include/FindMatroska.cmake new file mode 100644 index 0000000000..5c9c4473f4 --- /dev/null +++ b/extras/buildsystem/cmake/include/FindMatroska.cmake @@ -0,0 +1,44 @@ +# - Find library containing Matroska() +# The following variables are set if Matroska is found. If Matroska is not +# found, Matroska_FOUND is set to false. +# Matroska_FOUND - System has Matroska. +# Matroska_LIBRARIES - Link these to use Matroska. +# Matroska_CFLAGS - Link these to use Matroska. + + +if (NOT Matroska_SEARCHED) + include(CheckLibraryExists) + + set(Matroska_SEARCHED TRUE CACHE INTERNAL "") + set(Matroska_FOUND FALSE CACHE INTERNAL "") + + pkg_check_modules(matroska libmatroska) + + if (NOT Matroska_FOUND) + set(Matroska_LIBRARIES "") + find_library( matroska_LIBRARY matroska ) + if (matroska_LIBRARY) + set(Matroska_LIBRARIES "${matroska_LIBRARY}") + set(Matroska_FOUND TRUE CACHE INTERNAL "") + endif (matroska_LIBRARY) + foreach (library ebml ebml_pic) + find_library( ${library}_LIBRARY ${library} ) + if (${library}_LIBRARY) + set(Matroska_LIBRARIES "${library};${Matroska_LIBRARIES}") + endif (${library}_LIBRARY) + endforeach (library) + set(Matroska_LIBRARIES "${Matroska_LIBRARIES}" CACHE INTERNAL STRING) + endif (NOT Matroska_FOUND) + + if (Matroska_FOUND) + if (NOT Matroska_FIND_QUIETLY) + message(STATUS "Found Matroska in: ${Matroska_LIBRARIES}") + endif (NOT Matroska_FIND_QUIETLY) + else (Matroska_FOUND) + if (Matroska_FIND_REQUIRED) + message(FATAL_ERROR "Could not find the library containing Matroska") + endif (Matroska_FIND_REQUIRED) + endif (Matroska_FOUND) + + mark_as_advanced(Matroska_LIBRARIES) +endif(NOT Matroska_SEARCHED) diff --git a/extras/buildsystem/cmake/include/config.cmake b/extras/buildsystem/cmake/include/config.cmake index e874859dd6..61bdea4d0d 100644 --- a/extras/buildsystem/cmake/include/config.cmake +++ b/extras/buildsystem/cmake/include/config.cmake @@ -425,6 +425,7 @@ if(QT4_FOUND) vlc_enable_modules(qt4) vlc_add_module_compile_flag(qt4 ${QT_CFLAGS} ) vlc_module_add_link_libraries(qt4 ${QT_LIBRARIES}) + # Define our own qt4_wrap_ui macro to match wanted behaviour MACRO (VLC_QT4_WRAP_UI outfiles ) FOREACH (it ${ARGN}) @@ -438,7 +439,6 @@ if(QT4_FOUND) MAIN_DEPENDENCY ${infile}) SET(${outfiles} ${${outfiles}} ${outfile}) ENDFOREACH (it) - ENDMACRO (VLC_QT4_WRAP_UI) endif(QT4_FOUND) @@ -453,6 +453,14 @@ if(OPENGL_FOUND) vlc_module_add_link_libraries(opengl ${OPENGL_LIBRARIES}) endif(OPENGL_FOUND) +find_package(Matroska 0.7.7) +if(Matroska_FOUND) + vlc_enable_modules(mkv) + vlc_check_include_files (matroska/KaxAttachments.h) + vlc_check_include_files (matroska/KaxVersion.h) + vlc_module_add_link_libraries(mkv ${Matroska_LIBRARIES}) +endif(Matroska_FOUND) + set(CMAKE_REQUIRED_INCLUDES) ###########################################################