]> git.sesse.net Git - vlc/commitdiff
cmake: Find libdvbpsi, libmpeg2.
authorPierre d'Herbemont <pdherbemont@videolan.org>
Thu, 14 Feb 2008 00:04:12 +0000 (00:04 +0000)
committerPierre d'Herbemont <pdherbemont@videolan.org>
Thu, 14 Feb 2008 00:04:12 +0000 (00:04 +0000)
extras/buildsystem/cmake/include/FindDvbpsi.cmake [new file with mode: 0644]
extras/buildsystem/cmake/include/FindMpeg2.cmake [new file with mode: 0644]
extras/buildsystem/cmake/include/config.cmake

diff --git a/extras/buildsystem/cmake/include/FindDvbpsi.cmake b/extras/buildsystem/cmake/include/FindDvbpsi.cmake
new file mode 100644 (file)
index 0000000..42365e9
--- /dev/null
@@ -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 (file)
index 0000000..1e349c8
--- /dev/null
@@ -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)
index 545dcebedfb070c6f5dd52cc5f931e868a6c2db1..2c203e94c32219849666ad23b3b4563fe1250d44 100644 (file)
@@ -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)
 
 ###########################################################