From f98d6a45b17127f51bda0591af1f3dafe6b1cf44 Mon Sep 17 00:00:00 2001 From: Pierre d'Herbemont Date: Thu, 14 Feb 2008 00:04:12 +0000 Subject: [PATCH] cmake: Find libdvbpsi, libmpeg2. --- .../cmake/include/FindDvbpsi.cmake | 36 +++++++++++++++++++ .../buildsystem/cmake/include/FindMpeg2.cmake | 36 +++++++++++++++++++ extras/buildsystem/cmake/include/config.cmake | 21 +++++++++++ 3 files changed, 93 insertions(+) create mode 100644 extras/buildsystem/cmake/include/FindDvbpsi.cmake create mode 100644 extras/buildsystem/cmake/include/FindMpeg2.cmake diff --git a/extras/buildsystem/cmake/include/FindDvbpsi.cmake b/extras/buildsystem/cmake/include/FindDvbpsi.cmake new file mode 100644 index 0000000000..42365e9d10 --- /dev/null +++ b/extras/buildsystem/cmake/include/FindDvbpsi.cmake @@ -0,0 +1,36 @@ +# - Find library containing Dvbpsi() +# The following variables are set if Dvbpsi is found. If Dvbpsi is not +# found, Dvbpsi_FOUND is set to false. +# Dvbpsi_FOUND - System has Dvbpsi. +# Dvbpsi_LIBRARIES - Link these to use Dvbpsi. +# Dvbpsi_CFLAGS - Link these to use Dvbpsi. + + +if (NOT Dvbpsi_SEARCHED) + include(CheckLibraryExists) + + set(Dvbpsi_SEARCHED TRUE CACHE INTERNAL "") + set(Dvbpsi_FOUND FALSE CACHE INTERNAL "") + + pkg_check_modules(Dvbpsi dvbpsi) + + if (NOT Dvbpsi_FOUND) + find_library(Dvbpsi_LIBRARY NAMES dvbpsi) + if (Dvbpsi_LIBRARY) + set(Dvbpsi_LIBRARIES "${Dvbpsi_LIBRARY}" CACHE INTERNAL "") + set(Dvbpsi_FOUND TRUE CACHE INTERNAL "") + endif (Dvbpsi_LIBRARY) + endif (NOT Dvbpsi_FOUND) + + if (Dvbpsi_FOUND) + if (NOT Dvbpsi_FIND_QUIETLY) + message(STATUS "Found Dvbpsi in: ${Dvbpsi_LIBRARIES}") + endif (NOT Dvbpsi_FIND_QUIETLY) + else (Dvbpsi_FOUND) + if (Dvbpsi_FIND_REQUIRED) + message(FATAL_ERROR "Could not find the library containing Dvbpsi") + endif (Dvbpsi_FIND_REQUIRED) + endif (Dvbpsi_FOUND) + + mark_as_advanced(Dvbpsi_LIBRARIES) +endif(NOT Dvbpsi_SEARCHED) diff --git a/extras/buildsystem/cmake/include/FindMpeg2.cmake b/extras/buildsystem/cmake/include/FindMpeg2.cmake new file mode 100644 index 0000000000..1e349c80cd --- /dev/null +++ b/extras/buildsystem/cmake/include/FindMpeg2.cmake @@ -0,0 +1,36 @@ +# - Find library containing Mpeg2() +# The following variables are set if Mpeg2 is found. If Mpeg2 is not +# found, Mpeg2_FOUND is set to false. +# Mpeg2_FOUND - System has Mpeg2. +# Mpeg2_LIBRARIES - Link these to use Mpeg2. +# Mpeg2_CFLAGS - Link these to use Mpeg2. + + +if (NOT Mpeg2_SEARCHED) + include(CheckLibraryExists) + + set(Mpeg2_SEARCHED TRUE CACHE INTERNAL "") + set(Mpeg2_FOUND FALSE CACHE INTERNAL "") + + pkg_check_modules(Mpeg2 mpeg2) + + if (NOT Mpeg2_FOUND) + find_library(Mpeg2_LIBRARY NAMES mpeg2) + if (Mpeg2_LIBRARY) + set(Mpeg2_LIBRARIES "${Mpeg2_LIBRARY}" CACHE INTERNAL "") + set(Mpeg2_FOUND TRUE CACHE INTERNAL "") + endif (Mpeg2_LIBRARY) + endif (NOT Mpeg2_FOUND) + + if (Mpeg2_FOUND) + if (NOT Mpeg2_FIND_QUIETLY) + message(STATUS "Found Mpeg2 in: ${Mpeg2_LIBRARIES}") + endif (NOT Mpeg2_FIND_QUIETLY) + else (Mpeg2_FOUND) + if (Mpeg2_FIND_REQUIRED) + message(FATAL_ERROR "Could not find the library containing Mpeg2") + endif (Mpeg2_FIND_REQUIRED) + endif (Mpeg2_FOUND) + + mark_as_advanced(Mpeg2_LIBRARIES) +endif(NOT Mpeg2_SEARCHED) diff --git a/extras/buildsystem/cmake/include/config.cmake b/extras/buildsystem/cmake/include/config.cmake index 545dcebedf..2c203e94c3 100644 --- a/extras/buildsystem/cmake/include/config.cmake +++ b/extras/buildsystem/cmake/include/config.cmake @@ -120,6 +120,10 @@ set(CMAKE_EXTRA_INCLUDE_FILES arpa/inet.h) vlc_check_functions_exist(inet_aton inet_ntop inet_pton) set(CMAKE_EXTRA_INCLUDE_FILES) +set(CMAKE_EXTRA_INCLUDE_FILES sys/mman.h) +vlc_check_functions_exist(mmap) +set(CMAKE_EXTRA_INCLUDE_FILES) + set(CMAKE_REQUIRED_LIBRARIES) check_library_exists(poll poll "" HAVE_POLL) @@ -491,6 +495,23 @@ if(X11_FOUND) vlc_module_add_link_libraries(panoramix ${X11_LIBRARIES}) endif(X11_FOUND) +find_package(Mpeg2) +if(Mpeg2_FOUND) + vlc_enable_modules(libmpeg2) + check_include_files ("stdint.h;mpeg2dec/mpeg2.h" HAVE_MPEG2DEC_MPEG2_H) + vlc_module_add_link_libraries(libmpeg2 ${Mpeg2_LIBRARIES}) +endif(Mpeg2_FOUND) + +find_package(Dvbpsi) +if(Dvbpsi_FOUND) + vlc_enable_modules(ts) + set(CMAKE_REQUIRED_INCLUDES ${CONTRIB_INCLUDE}) + check_include_files ("stdint.h;dvbpsi/dvbpsi.h;dvbpsi/demux.h;dvbpsi/descriptor.h;dvbpsi/pat.h;dvbpsi/pmt.h;dvbpsi/sdt.h;dvbpsi/dr.h" HAVE_DVBPSI_DR_H) + vlc_module_add_link_libraries(ts ${Dvbpsi_LIBRARIES}) +endif(Dvbpsi_FOUND) + + + set(CMAKE_REQUIRED_INCLUDES) ########################################################### -- 2.20.1