Merge pull request #25883 from CrystalP/fix-slowscan
[xbmc.git] / cmake / modules / FindLibDvd.cmake
blobac0467c5f59368c471b90e1940c8938ada3fcc76
1 #.rst:
2 # FindLibDvd
3 # ----------
5 # This will define the following target:
7 #   ${APP_NAME_LC}::Dvd  - Wrapper target to generate/build libdvdnav shared library
9 if(NOT TARGET ${APP_NAME_LC}::${CMAKE_FIND_PACKAGE_NAME})
10   find_package(LibDvdNav MODULE REQUIRED)
12   if(CORE_SYSTEM_NAME MATCHES windows)
13     set(LIBDVD_TARGET_DIR .)
14     copy_file_to_buildtree(${DEPENDS_PATH}/bin/libdvdnav.dll DIRECTORY ${LIBDVD_TARGET_DIR})
15   else()
16     set(_dvdlibs LibDvdRead::LibDvdRead)
18     if(TARGET LibDvdCSS::LibDvdCSS)
19       list(APPEND _dvdlibs LibDvdCSS::LibDvdCSS)
20     endif()
22     # link a shared dvdnav library that includes the whole archives of dvdread and dvdcss as well
23     # the quotes around _dvdlibs are on purpose, since we want to pass a list to the function that will be unpacked automatically
24     core_link_library(LibDvdNav::LibDvdNav system/players/VideoPlayer/libdvdnav archives "${_dvdlibs}")
25   endif()
27   add_library(${APP_NAME_LC}::${CMAKE_FIND_PACKAGE_NAME} INTERFACE IMPORTED)
28   add_dependencies(${APP_NAME_LC}::${CMAKE_FIND_PACKAGE_NAME} LibDvdNav::LibDvdNav)
29 endif()