summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEmanoil Kotsev <deloptes@gmail.com>2020-02-29 22:25:41 +0100
committerEmanoil Kotsev <deloptes@gmail.com>2020-10-27 08:00:15 +0100
commit59c7686aa1d3b1ff6e1b293a61deb57c394969df (patch)
treef0dd18fbdc619be41601ed5cfb6121f06821512b
parentb29c9d4b8dfb79cc74030c4311b361ac399c2b30 (diff)
downloadkplayer-issue/1/kplayer.tar.gz
kplayer-issue/1/kplayer.zip
Add basic check for libdvdrad, libdvdnav, libdvdcssissue/1/kplayer
these libraries are required to build kplayer with DVD support in various flavours. The libraries are available from debian multimedia or directly from the VLAN/VLC project. Signed-off-by: Emanoil Kotsev <deloptes@gmail.com>
-rw-r--r--ConfigureChecks.cmake46
1 files changed, 46 insertions, 0 deletions
diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake
index 1f96afd..bd0b618 100644
--- a/ConfigureChecks.cmake
+++ b/ConfigureChecks.cmake
@@ -29,3 +29,49 @@ endif( )
#### check for headers
check_include_file( "sys/sysmacros.h" HAVE_SYS_SYSMACROS_H )
+
+#### check for libdvdread, libdvdnav and libdvdcss
+
+macro( tqt_message )
+ message( STATUS "${ARGN}" )
+endmacro( )
+
+set(_dvdlibs dvdread dvdnav)
+set(_handlevars LIBDVD_INCLUDE_DIRS DVDREAD_LIBRARY DVDNAV_LIBRARY)
+
+if(WITH_ALL_OPTIONS)
+ set(WITH_DVDCSS "ON")
+endif()
+
+if(WITH_DVDCSS)
+ list(APPEND _dvdlibs libdvdcss)
+ list(APPEND _handlevars DVDCSS_LIBRARY LIBDVDCSS_INCLUDE_DIRS )
+endif()
+
+if(PKG_CONFIG_FOUND)
+ pkg_check_modules(PC_DVD ${_dvdlibs} QUIET)
+endif()
+
+find_path(LIBDVD_INCLUDE_DIRS dvdnav/dvdnav.h PATHS ${PC_DVD_INCLUDE_DIRS})
+find_library(DVDREAD_LIBRARY NAMES dvdread libdvdread PATHS ${PC_DVD_dvdread_LIBDIR})
+find_library(DVDNAV_LIBRARY NAMES dvdnav libdvdnav PATHS ${PC_DVD_dvdnav_LIBDIR})
+
+if(WITH_DVDCSS)
+ find_path(LIBDVDCSS_INCLUDE_DIRS dvdcss/dvdcss.h PATHS ${PC_DVD_INCLUDE_DIRS})
+ find_library(DVDCSS_LIBRARY NAMES dvdcss libdvdcss PATHS ${PC_DVD_libdvdcss_LIBDIR})
+endif()
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(LibDvd REQUIRED_VARS ${_handlevars})
+if(LIBDVD_FOUND)
+ list(APPEND LIBDVD_LIBRARIES ${DVDREAD_LIBRARY})
+ list(APPEND LIBDVD_LIBRARIES ${DVDNAV_LIBRARY})
+ if(WITH_DVDCSS)
+ list(APPEND LIBDVD_LIBRARIES ${DVDCSS_LIBRARY})
+ endif()
+ foreach(_dvd_lib ${LIBDVD_LIBRARIES})
+ tqt_message( " ${_dvd_lib}" )
+ endforeach()
+else()
+ tde_message_fatal( " DVD libraries not found" )
+endif()