diff options
Diffstat (limited to 'cmake/modules')
29 files changed, 574 insertions, 207 deletions
diff --git a/cmake/modules/FindAML.cmake b/cmake/modules/FindAML.cmake deleted file mode 100644 index 89d1fd9..0000000 --- a/cmake/modules/FindAML.cmake +++ /dev/null | |||
| @@ -1,49 +0,0 @@ | |||
| 1 | #.rst: | ||
| 2 | # FindAML | ||
| 3 | # ------- | ||
| 4 | # Finds the AML codec | ||
| 5 | # | ||
| 6 | # This will define the following variables:: | ||
| 7 | # | ||
| 8 | # AML_FOUND - system has AML | ||
| 9 | # AML_INCLUDE_DIRS - the AML include directory | ||
| 10 | # AML_DEFINITIONS - the AML definitions | ||
| 11 | # | ||
| 12 | # and the following imported targets:: | ||
| 13 | # | ||
| 14 | # AML::AML - The AML codec | ||
| 15 | |||
| 16 | find_path(AML_INCLUDE_DIR codec_error.h | ||
| 17 | PATH_SUFFIXES amcodec) | ||
| 18 | |||
| 19 | include(FindPackageHandleStandardArgs) | ||
| 20 | find_package_handle_standard_args(AML | ||
| 21 | REQUIRED_VARS AML_INCLUDE_DIR) | ||
| 22 | |||
| 23 | include(CheckCSourceCompiles) | ||
| 24 | set(CMAKE_REQUIRED_INCLUDES ${AML_INCLUDE_DIR}) | ||
| 25 | check_c_source_compiles("#include <amcodec/codec.h> | ||
| 26 | |||
| 27 | int main() | ||
| 28 | { | ||
| 29 | int i = VIDEO_DEC_FORMAT_VP9; | ||
| 30 | return 0; | ||
| 31 | } | ||
| 32 | " AML_HAS_VP9) | ||
| 33 | |||
| 34 | if(AML_FOUND) | ||
| 35 | set(AML_INCLUDE_DIRS ${AML_INCLUDE_DIR}) | ||
| 36 | set(AML_DEFINITIONS -DHAS_LIBAMCODEC=1) | ||
| 37 | if(AML_HAS_VP9) | ||
| 38 | list(APPEND AML_DEFINITIONS -DHAS_LIBAMCODEC_VP9=1) | ||
| 39 | endif() | ||
| 40 | |||
| 41 | if(NOT TARGET AML::AML) | ||
| 42 | add_library(AML::AML UNKNOWN IMPORTED) | ||
| 43 | set_target_properties(AML::AML PROPERTIES | ||
| 44 | INTERFACE_INCLUDE_DIRECTORIES "${AML_INCLUDE_DIR}" | ||
| 45 | INTERFACE_COMPILE_DEFINITIONS HAS_LIBAMCODEC=1) | ||
| 46 | endif() | ||
| 47 | endif() | ||
| 48 | |||
| 49 | mark_as_advanced(AMLCODEC_INCLUDE_DIR) | ||
diff --git a/cmake/modules/FindBluray.cmake b/cmake/modules/FindBluray.cmake index 58a9a91..34bc50e 100644 --- a/cmake/modules/FindBluray.cmake +++ b/cmake/modules/FindBluray.cmake | |||
| @@ -48,6 +48,10 @@ if(BLURAY_FOUND) | |||
| 48 | list(APPEND BLURAY_DEFINITIONS -DHAVE_LIBBLURAY_BDJ=1) | 48 | list(APPEND BLURAY_DEFINITIONS -DHAVE_LIBBLURAY_BDJ=1) |
| 49 | endif() | 49 | endif() |
| 50 | 50 | ||
| 51 | if(${BLURAY_LIBRARY} MATCHES ".+\.a$" AND PC_BLURAY_STATIC_LIBRARIES) | ||
| 52 | list(APPEND BLURAY_LIBRARIES ${PC_BLURAY_STATIC_LIBRARIES}) | ||
| 53 | endif() | ||
| 54 | |||
| 51 | if(NOT TARGET Bluray::Bluray) | 55 | if(NOT TARGET Bluray::Bluray) |
| 52 | add_library(Bluray::Bluray UNKNOWN IMPORTED) | 56 | add_library(Bluray::Bluray UNKNOWN IMPORTED) |
| 53 | if(BLURAY_LIBRARY) | 57 | if(BLURAY_LIBRARY) |
diff --git a/cmake/modules/FindCdio.cmake b/cmake/modules/FindCdio.cmake index 91ba7bc..465ecc6 100644 --- a/cmake/modules/FindCdio.cmake +++ b/cmake/modules/FindCdio.cmake | |||
| @@ -8,47 +8,27 @@ | |||
| 8 | # CDIO_FOUND - system has cdio | 8 | # CDIO_FOUND - system has cdio |
| 9 | # CDIO_INCLUDE_DIRS - the cdio include directory | 9 | # CDIO_INCLUDE_DIRS - the cdio include directory |
| 10 | # CDIO_LIBRARIES - the cdio libraries | 10 | # CDIO_LIBRARIES - the cdio libraries |
| 11 | # | ||
| 12 | # and the following imported targets:: | ||
| 13 | # | ||
| 14 | # CDIO::CDIO - The cdio library | ||
| 15 | 11 | ||
| 16 | if(PKG_CONFIG_FOUND) | 12 | if(PKG_CONFIG_FOUND) |
| 17 | pkg_check_modules(PC_CDIO libcdio>=0.78 libiso9660 QUIET) | 13 | pkg_check_modules(PC_CDIO libcdio>=0.80 QUIET) |
| 18 | endif() | 14 | endif() |
| 19 | 15 | ||
| 20 | find_path(CDIO_INCLUDE_DIR NAMES cdio/cdio.h | 16 | find_path(CDIO_INCLUDE_DIR NAMES cdio/cdio.h |
| 21 | PATHS ${PC_CDIO_libcdio_INCLUDEDIR} | 17 | PATHS ${PC_CDIO_INCLUDEDIR}) |
| 22 | ${PC_CDIO_libiso9660_INCLUDEDIR}) | ||
| 23 | find_library(CDIO_LIBRARY NAMES cdio libcdio | ||
| 24 | PATHS ${CDIO_libcdio_LIBDIR} ${CDIO_libiso9660_LIBDIR}) | ||
| 25 | 18 | ||
| 26 | if(NOT WIN32) | 19 | find_library(CDIO_LIBRARY NAMES cdio libcdio |
| 27 | find_path(ISO9660_INCLUDE_DIR NAMES cdio/iso9660.h | 20 | PATHS ${PC_CDIO_LIBDIR}) |
| 28 | PATHS ${PC_CDIO_libcdio_INCLUDEDIR} | ||
| 29 | ${PC_CDIO_libiso9660_INCLUDEDIR}) | ||
| 30 | find_library(ISO9660_LIBRARY NAMES iso9660 | ||
| 31 | PATHS ${CDIO_libcdio_LIBDIR} ${CDIO_libiso9660_LIBDIR}) | ||
| 32 | list(APPEND ISO9660_VARS ISO9660_INCLUDE_DIR ISO9660_LIBRARY) | ||
| 33 | endif() | ||
| 34 | 21 | ||
| 35 | set(CDIO_VERSION ${PC_CDIO_libcdio_VERSION}) | 22 | set(CDIO_VERSION ${PC_CDIO_VERSION}) |
| 36 | 23 | ||
| 37 | include(FindPackageHandleStandardArgs) | 24 | include(FindPackageHandleStandardArgs) |
| 38 | find_package_handle_standard_args(Cdio | 25 | find_package_handle_standard_args(Cdio |
| 39 | REQUIRED_VARS CDIO_LIBRARY CDIO_INCLUDE_DIR ${ISO9660_VARS} | 26 | REQUIRED_VARS CDIO_LIBRARY CDIO_INCLUDE_DIR |
| 40 | VERSION_VAR CDIO_VERSION) | 27 | VERSION_VAR CDIO_VERSION) |
| 41 | 28 | ||
| 42 | if(CDIO_FOUND) | 29 | if(CDIO_FOUND) |
| 43 | set(CDIO_LIBRARIES ${CDIO_LIBRARY} ${ISO9660_LIBRARY}) | 30 | set(CDIO_LIBRARIES ${CDIO_LIBRARY}) |
| 44 | set(CDIO_INCLUDE_DIRS ${CDIO_INCLUDE_DIR} ${ISO9660_INCLUDE_DIR}) | 31 | set(CDIO_INCLUDE_DIRS ${CDIO_INCLUDE_DIR}) |
| 45 | |||
| 46 | if(NOT TARGET CDIO::CDIO) | ||
| 47 | add_library(CDIO::CDIO UNKNOWN IMPORTED) | ||
| 48 | set_target_properties(CDIO::CDIO PROPERTIES | ||
| 49 | IMPORTED_LOCATION "${CDIO_LIBRARY}" | ||
| 50 | INTERFACE_INCLUDE_DIRECTORIES "${CDIO_INCLUDE_DIR}") | ||
| 51 | endif() | ||
| 52 | endif() | 32 | endif() |
| 53 | 33 | ||
| 54 | mark_as_advanced(CDIO_INCLUDE_DIR CDIO_LIBRARY ISO9660_INCLUDE_DIR ISO9660_LIBRARY) | 34 | mark_as_advanced(CDIO_INCLUDE_DIR CDIO_LIBRARY) |
diff --git a/cmake/modules/FindClangFormat.cmake b/cmake/modules/FindClangFormat.cmake new file mode 100644 index 0000000..7220d31 --- /dev/null +++ b/cmake/modules/FindClangFormat.cmake | |||
| @@ -0,0 +1,11 @@ | |||
| 1 | #.rst: | ||
| 2 | # FindClangFormat | ||
| 3 | # ---------- | ||
| 4 | # Finds clang-format | ||
| 5 | |||
| 6 | find_program(CLANG_FORMAT_EXECUTABLE clang-format) | ||
| 7 | |||
| 8 | include(FindPackageHandleStandardArgs) | ||
| 9 | find_package_handle_standard_args(ClangFormat REQUIRED_VARS CLANG_FORMAT_EXECUTABLE) | ||
| 10 | |||
| 11 | mark_as_advanced(CLANG_FORMAT_EXECUTABLE) | ||
diff --git a/cmake/modules/FindCpluff.cmake b/cmake/modules/FindCpluff.cmake deleted file mode 100644 index 9e29e17..0000000 --- a/cmake/modules/FindCpluff.cmake +++ /dev/null | |||
| @@ -1,51 +0,0 @@ | |||
| 1 | # - Builds Cpluff as external project | ||
| 2 | # Once done this will define | ||
| 3 | # | ||
| 4 | # CPLUFF_FOUND - system has cpluff | ||
| 5 | # CPLUFF_INCLUDE_DIRS - the cpluff include directories | ||
| 6 | # | ||
| 7 | # and link Kodi against the cpluff libraries. | ||
| 8 | |||
| 9 | find_package(EXPAT REQUIRED) | ||
| 10 | if(CORE_SYSTEM_NAME MATCHES windows) | ||
| 11 | add_subdirectory(${CMAKE_SOURCE_DIR}/lib/cpluff) | ||
| 12 | set(CPLUFF_LIBRARIES $<TARGET_FILE:libcpluff> ${EXPAT_LIBRARIES}) | ||
| 13 | else() | ||
| 14 | string(REPLACE ";" " " defines "${CMAKE_C_FLAGS} ${SYSTEM_DEFINES} -I${EXPAT_INCLUDE_DIR}") | ||
| 15 | get_filename_component(expat_dir ${EXPAT_LIBRARY} DIRECTORY) | ||
| 16 | set(ldflags "-L${expat_dir}") | ||
| 17 | |||
| 18 | # iOS: Without specifying -arch, configure tries to use /bin/cpp as C-preprocessor | ||
| 19 | # http://stackoverflow.com/questions/38836754/cant-cross-compile-c-library-for-arm-ios | ||
| 20 | if(CORE_SYSTEM_NAME STREQUAL ios) | ||
| 21 | set(cppflags "-arch ${CPU}") | ||
| 22 | endif() | ||
| 23 | |||
| 24 | ExternalProject_Add(libcpluff SOURCE_DIR ${CMAKE_SOURCE_DIR}/lib/cpluff | ||
| 25 | BUILD_IN_SOURCE 1 | ||
| 26 | PREFIX ${CORE_BUILD_DIR}/cpluff | ||
| 27 | CONFIGURE_COMMAND AR=${CMAKE_AR} RANLIB=${CMAKE_RANLIB} CC=${CMAKE_C_COMPILER} ${CMAKE_SOURCE_DIR}/lib/cpluff/configure | ||
| 28 | --disable-nls | ||
| 29 | --enable-static | ||
| 30 | --disable-shared | ||
| 31 | --with-pic | ||
| 32 | --prefix=<INSTALL_DIR> | ||
| 33 | --libdir=<INSTALL_DIR>/lib | ||
| 34 | --host=${ARCH} | ||
| 35 | CFLAGS=${defines} | ||
| 36 | CPPFLAGS=${cppflags} | ||
| 37 | LDFLAGS=${ldflags} | ||
| 38 | BUILD_BYPRODUCTS <INSTALL_DIR>/lib/libcpluff.a) | ||
| 39 | ExternalProject_Add_Step(libcpluff autoreconf | ||
| 40 | DEPENDEES download update patch | ||
| 41 | DEPENDERS configure | ||
| 42 | COMMAND rm -f config.status | ||
| 43 | COMMAND PATH=${NATIVEPREFIX}/bin:$ENV{PATH} autoreconf -vif | ||
| 44 | WORKING_DIRECTORY <SOURCE_DIR>) | ||
| 45 | |||
| 46 | set(CPLUFF_LIBRARIES ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/cpluff/lib/libcpluff.a ${EXPAT_LIBRARIES}) | ||
| 47 | endif() | ||
| 48 | set(CPLUFF_INCLUDE_DIRS ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/cpluff/include) | ||
| 49 | set(CPLUFF_FOUND 1) | ||
| 50 | mark_as_advanced(CPLUFF_INCLUDE_DIRS CPLUFF_LIBRARIES) | ||
| 51 | set_target_properties(libcpluff PROPERTIES FOLDER "External Projects") | ||
diff --git a/cmake/modules/FindCrossGUID.cmake b/cmake/modules/FindCrossGUID.cmake index 7384747..613c2a4 100644 --- a/cmake/modules/FindCrossGUID.cmake +++ b/cmake/modules/FindCrossGUID.cmake | |||
| @@ -34,9 +34,6 @@ if(ENABLE_INTERNAL_CROSSGUID) | |||
| 34 | <SOURCE_DIR> && | 34 | <SOURCE_DIR> && |
| 35 | ${CMAKE_COMMAND} -E copy | 35 | ${CMAKE_COMMAND} -E copy |
| 36 | ${CMAKE_SOURCE_DIR}/tools/depends/target/crossguid/FindUUID.cmake | 36 | ${CMAKE_SOURCE_DIR}/tools/depends/target/crossguid/FindUUID.cmake |
| 37 | <SOURCE_DIR> && | ||
| 38 | ${CMAKE_COMMAND} -E copy | ||
| 39 | ${CMAKE_SOURCE_DIR}/tools/depends/target/crossguid/FindCXX11.cmake | ||
| 40 | <SOURCE_DIR> | 37 | <SOURCE_DIR> |
| 41 | BUILD_BYPRODUCTS ${CROSSGUID_LIBRARY}) | 38 | BUILD_BYPRODUCTS ${CROSSGUID_LIBRARY}) |
| 42 | set_target_properties(crossguid PROPERTIES FOLDER "External Projects") | 39 | set_target_properties(crossguid PROPERTIES FOLDER "External Projects") |
| @@ -49,7 +46,7 @@ if(ENABLE_INTERNAL_CROSSGUID) | |||
| 49 | set(CROSSGUID_LIBRARIES ${CROSSGUID_LIBRARY}) | 46 | set(CROSSGUID_LIBRARIES ${CROSSGUID_LIBRARY}) |
| 50 | set(CROSSGUID_INCLUDE_DIRS ${CROSSGUID_INCLUDE_DIR}) | 47 | set(CROSSGUID_INCLUDE_DIRS ${CROSSGUID_INCLUDE_DIR}) |
| 51 | else() | 48 | else() |
| 52 | find_path(CROSSGUID_INCLUDE_DIR NAMES guid.h) | 49 | find_path(CROSSGUID_INCLUDE_DIR NAMES guid.hpp guid.h) |
| 53 | 50 | ||
| 54 | find_library(CROSSGUID_LIBRARY_RELEASE NAMES crossguid) | 51 | find_library(CROSSGUID_LIBRARY_RELEASE NAMES crossguid) |
| 55 | find_library(CROSSGUID_LIBRARY_DEBUG NAMES crossguidd) | 52 | find_library(CROSSGUID_LIBRARY_DEBUG NAMES crossguidd) |
| @@ -65,6 +62,10 @@ else() | |||
| 65 | set(CROSSGUID_LIBRARIES ${CROSSGUID_LIBRARY}) | 62 | set(CROSSGUID_LIBRARIES ${CROSSGUID_LIBRARY}) |
| 66 | set(CROSSGUID_INCLUDE_DIRS ${CROSSGUID_INCLUDE_DIR}) | 63 | set(CROSSGUID_INCLUDE_DIRS ${CROSSGUID_INCLUDE_DIR}) |
| 67 | 64 | ||
| 65 | if(EXISTS "${CROSSGUID_INCLUDE_DIR}/guid.hpp") | ||
| 66 | set(CROSSGUID_DEFINITIONS -DHAVE_NEW_CROSSGUID) | ||
| 67 | endif() | ||
| 68 | |||
| 68 | add_custom_target(crossguid) | 69 | add_custom_target(crossguid) |
| 69 | set_target_properties(crossguid PROPERTIES FOLDER "External Projects") | 70 | set_target_properties(crossguid PROPERTIES FOLDER "External Projects") |
| 70 | endif() | 71 | endif() |
diff --git a/cmake/modules/FindDav1d.cmake b/cmake/modules/FindDav1d.cmake new file mode 100644 index 0000000..7625afa --- /dev/null +++ b/cmake/modules/FindDav1d.cmake | |||
| @@ -0,0 +1,82 @@ | |||
| 1 | #.rst: | ||
| 2 | # FindDav1d | ||
| 3 | # -------- | ||
| 4 | # Finds the dav1d library | ||
| 5 | # | ||
| 6 | # This will define the following variables:: | ||
| 7 | # | ||
| 8 | # DAV1D_FOUND - system has dav1d | ||
| 9 | # DAV1D_INCLUDE_DIRS - the dav1d include directories | ||
| 10 | # DAV1D_LIBRARIES - the dav1d libraries | ||
| 11 | |||
| 12 | if(PKG_CONFIG_FOUND) | ||
| 13 | pkg_check_modules(PC_DAV1D dav1d QUIET) | ||
| 14 | endif() | ||
| 15 | |||
| 16 | find_library(DAV1D_LIBRARY NAMES dav1d libdav1d | ||
| 17 | PATHS ${PC_DAV1D_LIBDIR}) | ||
| 18 | |||
| 19 | find_path(DAV1D_INCLUDE_DIR NAMES dav1d/dav1d.h | ||
| 20 | PATHS ${PC_DAV1D_INCLUDEDIR}) | ||
| 21 | |||
| 22 | set(DAV1D_VERSION ${PC_DAV1D_VERSION}) | ||
| 23 | |||
| 24 | if(ENABLE_INTERNAL_DAV1D) | ||
| 25 | include(ExternalProject) | ||
| 26 | |||
| 27 | # Extract version | ||
| 28 | file(STRINGS ${CMAKE_SOURCE_DIR}/tools/depends/target/dav1d/DAV1D-VERSION VER) | ||
| 29 | |||
| 30 | string(REGEX MATCH "VERSION=[^ ]*$.*" DAV1D_VER "${VER}") | ||
| 31 | list(GET DAV1D_VER 0 DAV1D_VER) | ||
| 32 | string(SUBSTRING "${DAV1D_VER}" 8 -1 DAV1D_VER) | ||
| 33 | |||
| 34 | # allow user to override the download URL with a local tarball | ||
| 35 | # needed for offline build envs | ||
| 36 | if(DAV1D_URL) | ||
| 37 | get_filename_component(DAV1D_URL "${DAV1D_URL}" ABSOLUTE) | ||
| 38 | else() | ||
| 39 | set(DAV1D_URL http://mirrors.kodi.tv/build-deps/sources/dav1d-${DAV1D_VER}.tar.gz) | ||
| 40 | endif() | ||
| 41 | |||
| 42 | if(VERBOSE) | ||
| 43 | message(STATUS "DAV1D_URL: ${DAV1D_URL}") | ||
| 44 | endif() | ||
| 45 | |||
| 46 | set(DAV1D_LIBRARY ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/lib/libdav1d.a) | ||
| 47 | set(DAV1D_INCLUDE_DIR ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/include) | ||
| 48 | set(DAV1D_VERSION ${DAV1D_VER}) | ||
| 49 | |||
| 50 | externalproject_add(dav1d | ||
| 51 | URL ${DAV1D_URL} | ||
| 52 | DOWNLOAD_NAME dav1d-${DAV1D_VER}.tar.gz | ||
| 53 | DOWNLOAD_DIR ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/download | ||
| 54 | PREFIX ${CORE_BUILD_DIR}/dav1d | ||
| 55 | CONFIGURE_COMMAND meson | ||
| 56 | --buildtype=release | ||
| 57 | --default-library=static | ||
| 58 | --prefix=${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR} | ||
| 59 | --libdir=lib | ||
| 60 | -Denable_asm=true | ||
| 61 | -Denable_tools=false | ||
| 62 | -Denable_examples=false | ||
| 63 | -Denable_tests=false | ||
| 64 | ../dav1d | ||
| 65 | BUILD_COMMAND ninja | ||
| 66 | INSTALL_COMMAND ninja install | ||
| 67 | BUILD_BYPRODUCTS ${DAV1D_LIBRARY}) | ||
| 68 | |||
| 69 | set_target_properties(dav1d PROPERTIES FOLDER "External Projects") | ||
| 70 | endif() | ||
| 71 | |||
| 72 | include(FindPackageHandleStandardArgs) | ||
| 73 | find_package_handle_standard_args(Dav1d | ||
| 74 | REQUIRED_VARS DAV1D_LIBRARY DAV1D_INCLUDE_DIR | ||
| 75 | VERSION_VAR DAV1D_VERSION) | ||
| 76 | |||
| 77 | if(DAV1D_FOUND) | ||
| 78 | set(DAV1D_INCLUDE_DIRS ${DAV1D_INCLUDE_DIR}) | ||
| 79 | set(DAV1D_LIBRARIES ${DAV1D_LIBRARY}) | ||
| 80 | endif() | ||
| 81 | |||
| 82 | mark_as_advanced(DAV1D_INCLUDE_DIR DAV1D_LIBRARY) | ||
diff --git a/cmake/modules/FindEpollShim.cmake b/cmake/modules/FindEpollShim.cmake new file mode 100644 index 0000000..61366d8 --- /dev/null +++ b/cmake/modules/FindEpollShim.cmake | |||
| @@ -0,0 +1,27 @@ | |||
| 1 | # FindEpollShim | ||
| 2 | # ------------- | ||
| 3 | # Finds the epoll-shim library | ||
| 4 | # | ||
| 5 | # This will define the following variables:: | ||
| 6 | # | ||
| 7 | # EPOLLSHIM_FOUND - the system has epoll-shim | ||
| 8 | # EPOLLSHIM_INCLUDE_DIR - the epoll-shim include directory | ||
| 9 | # EPOLLSHIM_LIBRARY - the epoll-shim library | ||
| 10 | |||
| 11 | if(PKG_CONFIG_FOUND) | ||
| 12 | pkg_check_modules(PC_EPOLLSHIM epoll-shim QUIET) | ||
| 13 | endif() | ||
| 14 | |||
| 15 | find_path(EPOLLSHIM_INCLUDE_DIR NAMES sys/epoll.h PATHS ${PC_EPOLLSHIM_INCLUDE_DIRS}) | ||
| 16 | find_library(EPOLLSHIM_LIBRARY NAMES epoll-shim PATHS ${PC_EPOLLSHIM_LIBDIR}) | ||
| 17 | |||
| 18 | include(FindPackageHandleStandardArgs) | ||
| 19 | find_package_handle_standard_args(EpollShim | ||
| 20 | REQUIRED_VARS EPOLLSHIM_LIBRARY EPOLLSHIM_INCLUDE_DIR) | ||
| 21 | |||
| 22 | if(EPOLLSHIM_FOUND) | ||
| 23 | set(EPOLLSHIM_INCLUDE_DIRS ${EPOLLSHIM_INCLUDE_DIR}) | ||
| 24 | set(EPOLLSHIM_LIBRARIES ${EPOLLSHIM_LIBRARY}) | ||
| 25 | endif() | ||
| 26 | |||
| 27 | mark_as_advanced(EPOLLSHIM_INCLUDE_DIR EPOLLSHIM_LIBRARY) | ||
diff --git a/cmake/modules/FindFFMPEG.cmake b/cmake/modules/FindFFMPEG.cmake index ef74671..81d2697 100644 --- a/cmake/modules/FindFFMPEG.cmake +++ b/cmake/modules/FindFFMPEG.cmake | |||
| @@ -33,14 +33,14 @@ | |||
| 33 | # | 33 | # |
| 34 | 34 | ||
| 35 | # required ffmpeg library versions | 35 | # required ffmpeg library versions |
| 36 | set(REQUIRED_FFMPEG_VERSION 4.0) | 36 | set(REQUIRED_FFMPEG_VERSION 4.3) |
| 37 | set(_avcodec_ver ">=58.18.100") | 37 | set(_avcodec_ver ">=58.91.100") |
| 38 | set(_avfilter_ver ">=7.16.100") | 38 | set(_avfilter_ver ">=7.85.100") |
| 39 | set(_avformat_ver ">=58.12.100") | 39 | set(_avformat_ver ">=58.45.100") |
| 40 | set(_avutil_ver ">=56.14.100") | 40 | set(_avutil_ver ">=56.51.100") |
| 41 | set(_swscale_ver ">=5.1.100") | 41 | set(_swscale_ver ">=5.7.100") |
| 42 | set(_swresample_ver ">=3.1.100") | 42 | set(_swresample_ver ">=3.7.100") |
| 43 | set(_postproc_ver ">=55.1.100") | 43 | set(_postproc_ver ">=55.7.100") |
| 44 | 44 | ||
| 45 | 45 | ||
| 46 | # Allows building with external ffmpeg not found in system paths, | 46 | # Allows building with external ffmpeg not found in system paths, |
| @@ -229,10 +229,16 @@ if(NOT FFMPEG_FOUND) | |||
| 229 | message(STATUS "FFMPEG_URL: ${FFMPEG_URL}") | 229 | message(STATUS "FFMPEG_URL: ${FFMPEG_URL}") |
| 230 | endif() | 230 | endif() |
| 231 | 231 | ||
| 232 | if (NOT DAV1D_FOUND) | ||
| 233 | message(STATUS "dav1d not found, internal ffmpeg build will be missing AV1 support!") | ||
| 234 | endif() | ||
| 235 | |||
| 232 | set(FFMPEG_OPTIONS -DENABLE_CCACHE=${ENABLE_CCACHE} | 236 | set(FFMPEG_OPTIONS -DENABLE_CCACHE=${ENABLE_CCACHE} |
| 233 | -DCCACHE_PROGRAM=${CCACHE_PROGRAM} | 237 | -DCCACHE_PROGRAM=${CCACHE_PROGRAM} |
| 234 | -DENABLE_VAAPI=${ENABLE_VAAPI} | 238 | -DENABLE_VAAPI=${ENABLE_VAAPI} |
| 235 | -DENABLE_VDPAU=${ENABLE_VDPAU}) | 239 | -DENABLE_VDPAU=${ENABLE_VDPAU} |
| 240 | -DENABLE_DAV1D=${DAV1D_FOUND} | ||
| 241 | -DEXTRA_FLAGS=${FFMPEG_EXTRA_FLAGS}) | ||
| 236 | 242 | ||
| 237 | if(KODI_DEPENDSBUILD) | 243 | if(KODI_DEPENDSBUILD) |
| 238 | set(CROSS_ARGS -DDEPENDS_PATH=${DEPENDS_PATH} | 244 | set(CROSS_ARGS -DDEPENDS_PATH=${DEPENDS_PATH} |
| @@ -265,6 +271,7 @@ if(NOT FFMPEG_FOUND) | |||
| 265 | -DCMAKE_EXE_LINKER_FLAGS=${LINKER_FLAGS} | 271 | -DCMAKE_EXE_LINKER_FLAGS=${LINKER_FLAGS} |
| 266 | ${CROSS_ARGS} | 272 | ${CROSS_ARGS} |
| 267 | ${FFMPEG_OPTIONS} | 273 | ${FFMPEG_OPTIONS} |
| 274 | -DPKG_CONFIG_PATH=${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/lib/pkgconfig | ||
| 268 | PATCH_COMMAND ${CMAKE_COMMAND} -E copy | 275 | PATCH_COMMAND ${CMAKE_COMMAND} -E copy |
| 269 | ${CMAKE_SOURCE_DIR}/tools/depends/target/ffmpeg/CMakeLists.txt | 276 | ${CMAKE_SOURCE_DIR}/tools/depends/target/ffmpeg/CMakeLists.txt |
| 270 | <SOURCE_DIR> && | 277 | <SOURCE_DIR> && |
| @@ -272,6 +279,10 @@ if(NOT FFMPEG_FOUND) | |||
| 272 | ${CMAKE_SOURCE_DIR}/tools/depends/target/ffmpeg/FindGnuTls.cmake | 279 | ${CMAKE_SOURCE_DIR}/tools/depends/target/ffmpeg/FindGnuTls.cmake |
| 273 | <SOURCE_DIR>) | 280 | <SOURCE_DIR>) |
| 274 | 281 | ||
| 282 | if (ENABLE_INTERNAL_DAV1D) | ||
| 283 | add_dependencies(ffmpeg dav1d) | ||
| 284 | endif() | ||
| 285 | |||
| 275 | find_program(BASH_COMMAND bash) | 286 | find_program(BASH_COMMAND bash) |
| 276 | if(NOT BASH_COMMAND) | 287 | if(NOT BASH_COMMAND) |
| 277 | message(FATAL_ERROR "Internal FFmpeg requires bash.") | 288 | message(FATAL_ERROR "Internal FFmpeg requires bash.") |
diff --git a/cmake/modules/FindFlatBuffers.cmake b/cmake/modules/FindFlatBuffers.cmake index 6f7e6a2..5ca67c5 100644 --- a/cmake/modules/FindFlatBuffers.cmake +++ b/cmake/modules/FindFlatBuffers.cmake | |||
| @@ -11,7 +11,7 @@ | |||
| 11 | 11 | ||
| 12 | if(ENABLE_INTERNAL_FLATBUFFERS) | 12 | if(ENABLE_INTERNAL_FLATBUFFERS) |
| 13 | include(ExternalProject) | 13 | include(ExternalProject) |
| 14 | file(STRINGS ${CMAKE_SOURCE_DIR}/tools/depends/native/flatbuffers-native/Makefile VER REGEX "^[ ]*VERSION[ ]*=.+$") | 14 | file(STRINGS ${CMAKE_SOURCE_DIR}/tools/depends/native/flatbuffers/Makefile VER REGEX "^[ ]*VERSION[ ]*=.+$") |
| 15 | string(REGEX REPLACE "^[ ]*VERSION[ ]*=[ ]*" "" FLATBUFFERS_VER "${VER}") | 15 | string(REGEX REPLACE "^[ ]*VERSION[ ]*=[ ]*" "" FLATBUFFERS_VER "${VER}") |
| 16 | 16 | ||
| 17 | # Allow user to override the download URL with a local tarball | 17 | # Allow user to override the download URL with a local tarball |
| @@ -43,7 +43,6 @@ if(ENABLE_INTERNAL_FLATBUFFERS) | |||
| 43 | -DFLATBUFFERS_BUILD_GRPCTEST=OFF | 43 | -DFLATBUFFERS_BUILD_GRPCTEST=OFF |
| 44 | -DFLATBUFFERS_BUILD_SHAREDLIB=OFF | 44 | -DFLATBUFFERS_BUILD_SHAREDLIB=OFF |
| 45 | "${EXTRA_ARGS}" | 45 | "${EXTRA_ARGS}" |
| 46 | PATCH_COMMAND patch -p1 < ${CORE_SOURCE_DIR}/tools/depends/native/flatbuffers-native/0001-Fix-compiler-warning.patch | ||
| 47 | BUILD_BYPRODUCTS ${FLATBUFFERS_FLATC_EXECUTABLE}) | 46 | BUILD_BYPRODUCTS ${FLATBUFFERS_FLATC_EXECUTABLE}) |
| 48 | set_target_properties(flatbuffers PROPERTIES FOLDER "External Projects" | 47 | set_target_properties(flatbuffers PROPERTIES FOLDER "External Projects" |
| 49 | INTERFACE_INCLUDE_DIRECTORIES ${FLATBUFFERS_INCLUDE_DIR}) | 48 | INTERFACE_INCLUDE_DIRECTORIES ${FLATBUFFERS_INCLUDE_DIR}) |
diff --git a/cmake/modules/FindFmt.cmake b/cmake/modules/FindFmt.cmake index 47cf8be..b426d8c 100644 --- a/cmake/modules/FindFmt.cmake +++ b/cmake/modules/FindFmt.cmake | |||
| @@ -39,6 +39,8 @@ if(ENABLE_INTERNAL_FMT) | |||
| 39 | DOWNLOAD_DIR ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/download | 39 | DOWNLOAD_DIR ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/download |
| 40 | PREFIX ${CORE_BUILD_DIR}/fmt | 40 | PREFIX ${CORE_BUILD_DIR}/fmt |
| 41 | CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR} | 41 | CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR} |
| 42 | -DCMAKE_CXX_EXTENSIONS=${CMAKE_CXX_EXTENSIONS} | ||
| 43 | -DCMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD} | ||
| 42 | -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} | 44 | -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} |
| 43 | -DCMAKE_INSTALL_LIBDIR=lib | 45 | -DCMAKE_INSTALL_LIBDIR=lib |
| 44 | -DFMT_DOC=OFF | 46 | -DFMT_DOC=OFF |
| @@ -57,12 +59,7 @@ if(ENABLE_INTERNAL_FMT) | |||
| 57 | 59 | ||
| 58 | else() | 60 | else() |
| 59 | 61 | ||
| 60 | if(CORE_SYSTEM_NAME STREQUAL windows OR CORE_SYSTEM_NAME STREQUAL windowsstore) | 62 | find_package(FMT 6.1.2 CONFIG REQUIRED QUIET) |
| 61 | # TODO: fix windows fmt package to include fmt-config.cmake and fmt-config-version.cmake | ||
| 62 | set(FMT_VERSION 3.0.1) | ||
| 63 | else() | ||
| 64 | find_package(FMT 3.0.1 CONFIG REQUIRED QUIET) | ||
| 65 | endif() | ||
| 66 | 63 | ||
| 67 | if(PKG_CONFIG_FOUND) | 64 | if(PKG_CONFIG_FOUND) |
| 68 | pkg_check_modules(PC_FMT libfmt QUIET) | 65 | pkg_check_modules(PC_FMT libfmt QUIET) |
diff --git a/cmake/modules/FindFriBidi.cmake b/cmake/modules/FindFriBidi.cmake index 91f3994..7a135e7 100644 --- a/cmake/modules/FindFriBidi.cmake +++ b/cmake/modules/FindFriBidi.cmake | |||
| @@ -17,7 +17,8 @@ if(PKG_CONFIG_FOUND) | |||
| 17 | pkg_check_modules(PC_FRIBIDI fribidi QUIET) | 17 | pkg_check_modules(PC_FRIBIDI fribidi QUIET) |
| 18 | endif() | 18 | endif() |
| 19 | 19 | ||
| 20 | find_path(FRIBIDI_INCLUDE_DIR NAMES fribidi/fribidi.h | 20 | find_path(FRIBIDI_INCLUDE_DIR NAMES fribidi.h |
| 21 | PATH_SUFFIXES fribidi | ||
| 21 | PATHS ${PC_FRIBIDI_INCLUDEDIR}) | 22 | PATHS ${PC_FRIBIDI_INCLUDEDIR}) |
| 22 | find_library(FRIBIDI_LIBRARY NAMES fribidi libfribidi | 23 | find_library(FRIBIDI_LIBRARY NAMES fribidi libfribidi |
| 23 | PATHS ${PC_FRIBIDI_LIBDIR}) | 24 | PATHS ${PC_FRIBIDI_LIBDIR}) |
diff --git a/cmake/modules/FindGIF.cmake b/cmake/modules/FindGIF.cmake index 1c616e0..7564a58 100644 --- a/cmake/modules/FindGIF.cmake +++ b/cmake/modules/FindGIF.cmake | |||
| @@ -16,15 +16,9 @@ | |||
| 16 | find_path(GIF_INCLUDE_DIR gif_lib.h) | 16 | find_path(GIF_INCLUDE_DIR gif_lib.h) |
| 17 | 17 | ||
| 18 | include(FindPackageHandleStandardArgs) | 18 | include(FindPackageHandleStandardArgs) |
| 19 | if(NOT WIN32) | 19 | find_library(GIF_LIBRARY NAMES gif) |
| 20 | find_library(GIF_LIBRARY NAMES gif) | 20 | find_package_handle_standard_args(GIF |
| 21 | find_package_handle_standard_args(GIF | 21 | REQUIRED_VARS GIF_LIBRARY GIF_INCLUDE_DIR) |
| 22 | REQUIRED_VARS GIF_LIBRARY GIF_INCLUDE_DIR) | ||
| 23 | else() | ||
| 24 | # Dynamically loaded DLL | ||
| 25 | find_package_handle_standard_args(GIF | ||
| 26 | REQUIRED_VARS GIF_INCLUDE_DIR) | ||
| 27 | endif() | ||
| 28 | 22 | ||
| 29 | if(GIF_FOUND) | 23 | if(GIF_FOUND) |
| 30 | set(GIF_LIBRARIES ${GIF_LIBRARY}) | 24 | set(GIF_LIBRARIES ${GIF_LIBRARY}) |
diff --git a/cmake/modules/FindGtest.cmake b/cmake/modules/FindGtest.cmake new file mode 100644 index 0000000..b59554b --- /dev/null +++ b/cmake/modules/FindGtest.cmake | |||
| @@ -0,0 +1,84 @@ | |||
| 1 | #.rst: | ||
| 2 | # FindGtest | ||
| 3 | # -------- | ||
| 4 | # Finds the gtest library | ||
| 5 | # | ||
| 6 | # This will define the following variables:: | ||
| 7 | # | ||
| 8 | # GTEST_FOUND - system has gtest | ||
| 9 | # GTEST_INCLUDE_DIRS - the gtest include directories | ||
| 10 | # GTEST_LIBRARIES - the gtest libraries | ||
| 11 | # | ||
| 12 | # and the following imported targets: | ||
| 13 | # | ||
| 14 | # Gtest::Gtest - The gtest library | ||
| 15 | |||
| 16 | if(ENABLE_INTERNAL_GTEST) | ||
| 17 | include(ExternalProject) | ||
| 18 | |||
| 19 | file(STRINGS ${CMAKE_SOURCE_DIR}/tools/depends/target/googletest/Makefile VER) | ||
| 20 | string(REGEX MATCH "VERSION=[^ ]*" GTEST_VERSION "${VER}") | ||
| 21 | list(GET GTEST_VERSION 0 GTEST_VERSION) | ||
| 22 | string(SUBSTRING "${GTEST_VERSION}" 8 -1 GTEST_VERSION) | ||
| 23 | |||
| 24 | # allow user to override the download URL with a local tarball | ||
| 25 | # needed for offline build envs | ||
| 26 | if(GTEST_URL) | ||
| 27 | get_filename_component(GTEST_URL "${GTEST_URL}" ABSOLUTE) | ||
| 28 | else() | ||
| 29 | set(GTEST_URL http://mirrors.kodi.tv/build-deps/sources/googletest-${GTEST_VERSION}.tar.gz) | ||
| 30 | endif() | ||
| 31 | |||
| 32 | if(VERBOSE) | ||
| 33 | message(STATUS "GTEST_URL: ${GTEST_URL}") | ||
| 34 | endif() | ||
| 35 | |||
| 36 | set(GTEST_LIBRARY ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/lib/libgtest.a) | ||
| 37 | set(GTEST_INCLUDE_DIR ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/include) | ||
| 38 | |||
| 39 | externalproject_add(gtest | ||
| 40 | URL ${GTEST_URL} | ||
| 41 | DOWNLOAD_DIR ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/download | ||
| 42 | PREFIX ${CORE_BUILD_DIR}/gtest | ||
| 43 | INSTALL_DIR ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR} | ||
| 44 | CMAKE_ARGS -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} -DBUILD_GMOCK=OFF -DINSTALL_GTEST=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=<INSTALL_DIR> -DCMAKE_INSTALL_LIBDIR=lib | ||
| 45 | BUILD_BYPRODUCTS ${GTEST_LIBRARY}) | ||
| 46 | set_target_properties(gtest PROPERTIES FOLDER "External Projects") | ||
| 47 | else() | ||
| 48 | if(PKG_CONFIG_FOUND) | ||
| 49 | pkg_check_modules(PC_GTEST gtest>=1.10.0 QUIET) | ||
| 50 | set(GTEST_VERSION ${PC_GTEST_VERSION}) | ||
| 51 | elseif(WIN32) | ||
| 52 | set(GTEST_VERSION 1.10.0) | ||
| 53 | endif() | ||
| 54 | |||
| 55 | find_path(GTEST_INCLUDE_DIR NAMES gtest/gtest.h | ||
| 56 | PATHS ${PC_GTEST_INCLUDEDIR}) | ||
| 57 | |||
| 58 | find_library(GTEST_LIBRARY_RELEASE NAMES gtest | ||
| 59 | PATHS ${PC_GTEST_LIBDIR}) | ||
| 60 | find_library(GTEST_LIBRARY_DEBUG NAMES gtestd | ||
| 61 | PATHS ${PC_GTEST_LIBDIR}) | ||
| 62 | |||
| 63 | include(SelectLibraryConfigurations) | ||
| 64 | select_library_configurations(GTEST) | ||
| 65 | endif() | ||
| 66 | |||
| 67 | include(FindPackageHandleStandardArgs) | ||
| 68 | find_package_handle_standard_args(Gtest | ||
| 69 | REQUIRED_VARS GTEST_LIBRARY GTEST_INCLUDE_DIR | ||
| 70 | VERSION_VAR GTEST_VERSION) | ||
| 71 | |||
| 72 | if(GTEST_FOUND) | ||
| 73 | set(GTEST_LIBRARIES ${GTEST_LIBRARY}) | ||
| 74 | set(GTEST_INCLUDE_DIRS ${GTEST_INCLUDE_DIR}) | ||
| 75 | endif() | ||
| 76 | |||
| 77 | if(NOT TARGET Gtest::Gtest) | ||
| 78 | add_library(Gtest::Gtest UNKNOWN IMPORTED) | ||
| 79 | set_target_properties(Gtest::Gtest PROPERTIES | ||
| 80 | IMPORTED_LOCATION "${GTEST_LIBRARY}" | ||
| 81 | INTERFACE_INCLUDE_DIRECTORIES "${GTEST_INCLUDE_DIR}") | ||
| 82 | endif() | ||
| 83 | |||
| 84 | mark_as_advanced(GTEST_INCLUDE_DIR GTEST_LIBRARY) | ||
diff --git a/cmake/modules/FindIso9660pp.cmake b/cmake/modules/FindIso9660pp.cmake new file mode 100644 index 0000000..5f84b55 --- /dev/null +++ b/cmake/modules/FindIso9660pp.cmake | |||
| @@ -0,0 +1,43 @@ | |||
| 1 | #.rst: | ||
| 2 | # FindIso9660pp | ||
| 3 | # -------- | ||
| 4 | # Finds the iso9660++ library | ||
| 5 | # | ||
| 6 | # This will define the following variables:: | ||
| 7 | # | ||
| 8 | # ISO9660PP_FOUND - system has iso9660++ | ||
| 9 | # ISO9660PP_INCLUDE_DIRS - the iso9660++ include directory | ||
| 10 | # ISO9660PP_LIBRARIES - the iso9660++ libraries | ||
| 11 | # ISO9660PP_DEFINITIONS - the iso9660++ definitions | ||
| 12 | |||
| 13 | if(PKG_CONFIG_FOUND) | ||
| 14 | pkg_check_modules(PC_ISO9660PP libiso9660++>=2.1.0 QUIET) | ||
| 15 | pkg_check_modules(PC_ISO9660 libiso9660>=2.1.0 QUIET) | ||
| 16 | endif() | ||
| 17 | |||
| 18 | find_path(ISO9660PP_INCLUDE_DIR NAMES cdio++/iso9660.hpp | ||
| 19 | PATHS ${PC_ISO9660PP_INCLUDEDIR}) | ||
| 20 | |||
| 21 | find_library(ISO9660PP_LIBRARY NAMES libiso9660++ iso9660++ | ||
| 22 | PATHS ${PC_ISO9660PP_LIBDIR}) | ||
| 23 | |||
| 24 | find_path(ISO9660_INCLUDE_DIR NAMES cdio/iso9660.h | ||
| 25 | PATHS ${PC_ISO9660_INCLUDEDIR}) | ||
| 26 | |||
| 27 | find_library(ISO9660_LIBRARY NAMES libiso9660 iso9660 | ||
| 28 | PATHS ${PC_ISO9660_LIBDIR}) | ||
| 29 | |||
| 30 | set(ISO9660PP_VERSION ${PC_ISO9660PP_VERSION}) | ||
| 31 | |||
| 32 | include(FindPackageHandleStandardArgs) | ||
| 33 | find_package_handle_standard_args(Iso9660pp | ||
| 34 | REQUIRED_VARS ISO9660PP_LIBRARY ISO9660PP_INCLUDE_DIR ISO9660_LIBRARY ISO9660_INCLUDE_DIR | ||
| 35 | VERSION_VAR ISO9660PP_VERSION) | ||
| 36 | |||
| 37 | if(ISO9660PP_FOUND) | ||
| 38 | set(ISO9660PP_LIBRARIES ${ISO9660PP_LIBRARY} ${ISO9660_LIBRARY}) | ||
| 39 | set(ISO9660PP_INCLUDE_DIRS ${ISO9660PP_INCLUDE_DIR} ${ISO9660_INCLUDE_DIR}) | ||
| 40 | set(ISO9660PP_DEFINITIONS -DHAS_ISO9660PP=1) | ||
| 41 | endif() | ||
| 42 | |||
| 43 | mark_as_advanced(ISO9660PP_INCLUDE_DIR ISO9660PP_LIBRARY ISO9660_INCLUDE_DIR ISO9660_LIBRARY) | ||
diff --git a/cmake/modules/FindLibDRM.cmake b/cmake/modules/FindLibDRM.cmake index 4b39de3..0d680f2 100644 --- a/cmake/modules/FindLibDRM.cmake +++ b/cmake/modules/FindLibDRM.cmake | |||
| @@ -8,6 +8,7 @@ | |||
| 8 | # LIBDRM_FOUND - system has LibDRM | 8 | # LIBDRM_FOUND - system has LibDRM |
| 9 | # LIBDRM_INCLUDE_DIRS - the LibDRM include directory | 9 | # LIBDRM_INCLUDE_DIRS - the LibDRM include directory |
| 10 | # LIBDRM_LIBRARIES - the LibDRM libraries | 10 | # LIBDRM_LIBRARIES - the LibDRM libraries |
| 11 | # LIBDRM_DEFINITIONS - the LibDRM definitions | ||
| 11 | # | 12 | # |
| 12 | # and the following imported targets:: | 13 | # and the following imported targets:: |
| 13 | # | 14 | # |
| @@ -30,9 +31,23 @@ find_package_handle_standard_args(LibDRM | |||
| 30 | REQUIRED_VARS LIBDRM_LIBRARY LIBDRM_INCLUDE_DIR | 31 | REQUIRED_VARS LIBDRM_LIBRARY LIBDRM_INCLUDE_DIR |
| 31 | VERSION_VAR LIBDRM_VERSION) | 32 | VERSION_VAR LIBDRM_VERSION) |
| 32 | 33 | ||
| 34 | include(CheckCSourceCompiles) | ||
| 35 | set(CMAKE_REQUIRED_INCLUDES ${LIBDRM_INCLUDE_DIR}) | ||
| 36 | check_c_source_compiles("#include <drm_mode.h> | ||
| 37 | |||
| 38 | int main() | ||
| 39 | { | ||
| 40 | struct hdr_output_metadata test; | ||
| 41 | return test.metadata_type; | ||
| 42 | } | ||
| 43 | " LIBDRM_HAS_HDR_OUTPUT_METADATA) | ||
| 44 | |||
| 33 | if(LIBDRM_FOUND) | 45 | if(LIBDRM_FOUND) |
| 34 | set(LIBDRM_LIBRARIES ${LIBDRM_LIBRARY}) | 46 | set(LIBDRM_LIBRARIES ${LIBDRM_LIBRARY}) |
| 35 | set(LIBDRM_INCLUDE_DIRS ${LIBDRM_INCLUDE_DIR}) | 47 | set(LIBDRM_INCLUDE_DIRS ${LIBDRM_INCLUDE_DIR}) |
| 48 | if(LIBDRM_HAS_HDR_OUTPUT_METADATA) | ||
| 49 | set(LIBDRM_DEFINITIONS -DHAVE_HDR_OUTPUT_METADATA=1) | ||
| 50 | endif() | ||
| 36 | 51 | ||
| 37 | if(NOT TARGET LIBDRM::LIBDRM) | 52 | if(NOT TARGET LIBDRM::LIBDRM) |
| 38 | add_library(LIBDRM::LIBDRM UNKNOWN IMPORTED) | 53 | add_library(LIBDRM::LIBDRM UNKNOWN IMPORTED) |
diff --git a/cmake/modules/FindLibDvd.cmake b/cmake/modules/FindLibDvd.cmake index bd08b94..44e7e92 100644 --- a/cmake/modules/FindLibDvd.cmake +++ b/cmake/modules/FindLibDvd.cmake | |||
| @@ -89,6 +89,8 @@ else() | |||
| 89 | set(HOST_ARCH aarch64-linux-android) | 89 | set(HOST_ARCH aarch64-linux-android) |
| 90 | elseif(ARCH STREQUAL i486-linux) | 90 | elseif(ARCH STREQUAL i486-linux) |
| 91 | set(HOST_ARCH i686-linux-android) | 91 | set(HOST_ARCH i686-linux-android) |
| 92 | elseif(ARCH STREQUAL x86_64) | ||
| 93 | set(HOST_ARCH x86_64-linux-android) | ||
| 92 | endif() | 94 | endif() |
| 93 | elseif(CORE_SYSTEM_NAME STREQUAL windowsstore) | 95 | elseif(CORE_SYSTEM_NAME STREQUAL windowsstore) |
| 94 | set(LIBDVD_ADDITIONAL_ARGS "-DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME}" "-DCMAKE_SYSTEM_VERSION=${CMAKE_SYSTEM_VERSION}") | 96 | set(LIBDVD_ADDITIONAL_ARGS "-DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME}" "-DCMAKE_SYSTEM_VERSION=${CMAKE_SYSTEM_VERSION}") |
| @@ -233,6 +235,7 @@ else() | |||
| 233 | set(LIBDVD_TARGET_DIR dlls) | 235 | set(LIBDVD_TARGET_DIR dlls) |
| 234 | endif() | 236 | endif() |
| 235 | copy_file_to_buildtree(${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/libdvd/bin/libdvdnav.dll DIRECTORY ${LIBDVD_TARGET_DIR}) | 237 | copy_file_to_buildtree(${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/libdvd/bin/libdvdnav.dll DIRECTORY ${LIBDVD_TARGET_DIR}) |
| 238 | add_dependencies(export-files dvdnav) | ||
| 236 | endif() | 239 | endif() |
| 237 | 240 | ||
| 238 | set(LIBDVD_INCLUDE_DIRS ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/libdvd/include) | 241 | set(LIBDVD_INCLUDE_DIRS ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/libdvd/include) |
diff --git a/cmake/modules/FindLibUSB.cmake b/cmake/modules/FindLibUSB.cmake index 17cf6ec..7bf3a92 100644 --- a/cmake/modules/FindLibUSB.cmake +++ b/cmake/modules/FindLibUSB.cmake | |||
| @@ -24,7 +24,7 @@ find_library(LIBUSB_LIBRARY NAMES usb | |||
| 24 | set(LIBUSB_VERSION ${PC_LIBUSB_VERSION}) | 24 | set(LIBUSB_VERSION ${PC_LIBUSB_VERSION}) |
| 25 | 25 | ||
| 26 | include(FindPackageHandleStandardArgs) | 26 | include(FindPackageHandleStandardArgs) |
| 27 | find_package_handle_standard_args(LIBUSB | 27 | find_package_handle_standard_args(LibUSB |
| 28 | REQUIRED_VARS LIBUSB_LIBRARY LIBUSB_INCLUDE_DIR | 28 | REQUIRED_VARS LIBUSB_LIBRARY LIBUSB_INCLUDE_DIR |
| 29 | VERSION_VAR LIBUSB_VERSION) | 29 | VERSION_VAR LIBUSB_VERSION) |
| 30 | 30 | ||
diff --git a/cmake/modules/FindMariaDBClient.cmake b/cmake/modules/FindMariaDBClient.cmake index 7530ab5..374aeeb 100644 --- a/cmake/modules/FindMariaDBClient.cmake +++ b/cmake/modules/FindMariaDBClient.cmake | |||
| @@ -28,11 +28,11 @@ endif() | |||
| 28 | 28 | ||
| 29 | find_path(MARIADBCLIENT_INCLUDE_DIR NAMES mariadb/mysql.h mariadb/server/mysql.h | 29 | find_path(MARIADBCLIENT_INCLUDE_DIR NAMES mariadb/mysql.h mariadb/server/mysql.h |
| 30 | PATHS ${PC_MARIADBCLIENT_INCLUDEDIR}) | 30 | PATHS ${PC_MARIADBCLIENT_INCLUDEDIR}) |
| 31 | find_library(MARIADBCLIENT_LIBRARY_RELEASE NAMES mariadbclient mariadb | 31 | find_library(MARIADBCLIENT_LIBRARY_RELEASE NAMES mariadbclient mariadb libmariadb |
| 32 | PATHS ${PC_MARIADBCLIENT_LIBDIR} | 32 | PATHS ${PC_MARIADBCLIENT_LIBDIR} |
| 33 | PATH_SUFFIXES mariadb | 33 | PATH_SUFFIXES mariadb |
| 34 | ${EXTRA_FIND_ARGS}) | 34 | ${EXTRA_FIND_ARGS}) |
| 35 | find_library(MARIADBCLIENT_LIBRARY_DEBUG NAMES mariadbclient mariadb | 35 | find_library(MARIADBCLIENT_LIBRARY_DEBUG NAMES mariadbclient mariadb libmariadbd |
| 36 | PATHS ${PC_MARIADBCLIENT_LIBDIR} | 36 | PATHS ${PC_MARIADBCLIENT_LIBDIR} |
| 37 | PATH_SUFFIXES mariadb | 37 | PATH_SUFFIXES mariadb |
| 38 | ${EXTRA_FIND_ARGS}) | 38 | ${EXTRA_FIND_ARGS}) |
diff --git a/cmake/modules/FindNFS.cmake b/cmake/modules/FindNFS.cmake index c2414a1..d62d4e6 100644 --- a/cmake/modules/FindNFS.cmake +++ b/cmake/modules/FindNFS.cmake | |||
| @@ -36,6 +36,44 @@ if(NFS_FOUND) | |||
| 36 | set(NFS_INCLUDE_DIRS ${NFS_INCLUDE_DIR}) | 36 | set(NFS_INCLUDE_DIRS ${NFS_INCLUDE_DIR}) |
| 37 | set(NFS_DEFINITIONS -DHAS_FILESYSTEM_NFS=1) | 37 | set(NFS_DEFINITIONS -DHAS_FILESYSTEM_NFS=1) |
| 38 | 38 | ||
| 39 | set(CMAKE_REQUIRED_INCLUDES "${NFS_INCLUDE_DIR}") | ||
| 40 | set(CMAKE_REQUIRED_LIBRARIES ${NFS_LIBRARY}) | ||
| 41 | if(CMAKE_SYSTEM_NAME MATCHES "Windows") | ||
| 42 | set(NFS_CXX_INCLUDE "#include <Winsock2.h>") | ||
| 43 | set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} "ws2_32.lib") | ||
| 44 | endif() | ||
| 45 | |||
| 46 | # Check for nfs_set_timeout | ||
| 47 | check_cxx_source_compiles(" | ||
| 48 | ${NFS_CXX_INCLUDE} | ||
| 49 | #include <nfsc/libnfs.h> | ||
| 50 | int main() | ||
| 51 | { | ||
| 52 | nfs_set_timeout(NULL, 0); | ||
| 53 | } | ||
| 54 | " NFS_SET_TIMEOUT) | ||
| 55 | |||
| 56 | if(NFS_SET_TIMEOUT) | ||
| 57 | list(APPEND NFS_DEFINITIONS -DHAS_NFS_SET_TIMEOUT) | ||
| 58 | endif() | ||
| 59 | |||
| 60 | # Check for mount_getexports_timeout | ||
| 61 | check_cxx_source_compiles(" | ||
| 62 | ${NFS_CXX_INCLUDE} | ||
| 63 | #include <nfsc/libnfs.h> | ||
| 64 | int main() | ||
| 65 | { | ||
| 66 | mount_getexports_timeout(NULL, 0); | ||
| 67 | } | ||
| 68 | " NFS_MOUNT_GETEXPORTS_TIMEOUT) | ||
| 69 | |||
| 70 | if(NFS_MOUNT_GETEXPORTS_TIMEOUT) | ||
| 71 | list(APPEND NFS_DEFINITIONS -DHAS_NFS_MOUNT_GETEXPORTS_TIMEOUT) | ||
| 72 | endif() | ||
| 73 | |||
| 74 | unset(CMAKE_REQUIRED_INCLUDES) | ||
| 75 | unset(CMAKE_REQUIRED_LIBRARIES) | ||
| 76 | |||
| 39 | if(NOT TARGET NFS::NFS) | 77 | if(NOT TARGET NFS::NFS) |
| 40 | add_library(NFS::NFS UNKNOWN IMPORTED) | 78 | add_library(NFS::NFS UNKNOWN IMPORTED) |
| 41 | if(NFS_LIBRARY) | 79 | if(NFS_LIBRARY) |
diff --git a/cmake/modules/FindOpenGLES.cmake b/cmake/modules/FindOpenGLES.cmake index 0191d9e..43a1367 100644 --- a/cmake/modules/FindOpenGLES.cmake +++ b/cmake/modules/FindOpenGLES.cmake | |||
| @@ -18,7 +18,7 @@ if(PKG_CONFIG_FOUND) | |||
| 18 | pkg_check_modules(PC_OPENGLES ${_brcmprefix}glesv2 QUIET) | 18 | pkg_check_modules(PC_OPENGLES ${_brcmprefix}glesv2 QUIET) |
| 19 | endif() | 19 | endif() |
| 20 | 20 | ||
| 21 | if(NOT CORE_SYSTEM_NAME STREQUAL ios) | 21 | if(NOT CORE_SYSTEM_NAME STREQUAL darwin_embedded) |
| 22 | find_path(OPENGLES_INCLUDE_DIR GLES2/gl2.h | 22 | find_path(OPENGLES_INCLUDE_DIR GLES2/gl2.h |
| 23 | PATHS ${PC_OPENGLES_INCLUDEDIR}) | 23 | PATHS ${PC_OPENGLES_INCLUDEDIR}) |
| 24 | find_library(OPENGLES_gl_LIBRARY NAMES ${_brcmprefix}GLESv2 | 24 | find_library(OPENGLES_gl_LIBRARY NAMES ${_brcmprefix}GLESv2 |
diff --git a/cmake/modules/FindPlist.cmake b/cmake/modules/FindPlist.cmake index cd143e9..2c86b74 100644 --- a/cmake/modules/FindPlist.cmake +++ b/cmake/modules/FindPlist.cmake | |||
| @@ -23,20 +23,13 @@ find_path(PLIST_INCLUDE_DIR plist/plist.h | |||
| 23 | 23 | ||
| 24 | set(PLIST_VERSION ${PC_PLIST_VERSION}) | 24 | set(PLIST_VERSION ${PC_PLIST_VERSION}) |
| 25 | 25 | ||
| 26 | find_library(PLIST_LIBRARY NAMES plist libplist | ||
| 27 | PATHS ${PC_PLIST_LIBDIR}) | ||
| 28 | |||
| 26 | include(FindPackageHandleStandardArgs) | 29 | include(FindPackageHandleStandardArgs) |
| 27 | if(NOT WIN32) | 30 | find_package_handle_standard_args(Plist |
| 28 | find_library(PLIST_LIBRARY NAMES plist | 31 | REQUIRED_VARS PLIST_LIBRARY PLIST_INCLUDE_DIR |
| 29 | PATHS ${PC_PLIST_LIBDIR}) | 32 | VERSION_VAR PLIST_VERSION) |
| 30 | |||
| 31 | find_package_handle_standard_args(Plist | ||
| 32 | REQUIRED_VARS PLIST_LIBRARY PLIST_INCLUDE_DIR | ||
| 33 | VERSION_VAR PLIST_VERSION) | ||
| 34 | else() | ||
| 35 | # Dynamically loaded DLL | ||
| 36 | find_package_handle_standard_args(Plist | ||
| 37 | REQUIRED_VARS PLIST_INCLUDE_DIR | ||
| 38 | VERSION_VAR PLIST_VERSION) | ||
| 39 | endif() | ||
| 40 | 33 | ||
| 41 | if(PLIST_FOUND) | 34 | if(PLIST_FOUND) |
| 42 | set(PLIST_LIBRARIES ${PLIST_LIBRARY}) | 35 | set(PLIST_LIBRARIES ${PLIST_LIBRARY}) |
diff --git a/cmake/modules/FindPython.cmake b/cmake/modules/FindPython.cmake index 213b17c..e39d4e5 100644 --- a/cmake/modules/FindPython.cmake +++ b/cmake/modules/FindPython.cmake | |||
| @@ -6,12 +6,12 @@ | |||
| 6 | # PYTHON_LIBRARIES - The python libraries | 6 | # PYTHON_LIBRARIES - The python libraries |
| 7 | 7 | ||
| 8 | if(PKG_CONFIG_FOUND) | 8 | if(PKG_CONFIG_FOUND) |
| 9 | pkg_check_modules(PC_PYTHON python>=2.7 QUIET) | 9 | pkg_check_modules(PC_PYTHON python3>=3.5 QUIET) |
| 10 | endif() | 10 | endif() |
| 11 | 11 | ||
| 12 | find_program(PYTHON_EXECUTABLE python ONLY_CMAKE_FIND_ROOT_PATH) | 12 | find_program(PYTHON_EXECUTABLE python3 ONLY_CMAKE_FIND_ROOT_PATH) |
| 13 | find_library(PYTHON_LIBRARY NAMES python2.7 PATHS ${PC_PYTHON_LIBDIR}) | 13 | find_library(PYTHON_LIBRARY NAMES python3.8 python3.7 python3.6 python3.5 PATHS ${PC_PYTHON_LIBDIR}) |
| 14 | find_path(PYTHON_INCLUDE_DIR NAMES Python.h PATHS ${PC_PYTHON_INCLUDE_DIRS} ${DEPENDS_PATH}/include/python2.7) | 14 | find_path(PYTHON_INCLUDE_DIR NAMES Python.h PATHS ${PC_PYTHON_INCLUDE_DIRS} PATH_SUFFIXES python3.8 python3.7 python3.6 python3.5) |
| 15 | 15 | ||
| 16 | if(KODI_DEPENDSBUILD) | 16 | if(KODI_DEPENDSBUILD) |
| 17 | find_library(FFI_LIBRARY ffi REQUIRED) | 17 | find_library(FFI_LIBRARY ffi REQUIRED) |
| @@ -25,7 +25,7 @@ if(KODI_DEPENDSBUILD) | |||
| 25 | 25 | ||
| 26 | set(PYTHON_LIBRARIES ${PYTHON_LIBRARY} ${FFI_LIBRARY} ${EXPAT_LIBRARY} ${INTL_LIBRARY} ${GMP_LIBRARY} ${PYTHON_DEP_LIBRARIES}) | 26 | set(PYTHON_LIBRARIES ${PYTHON_LIBRARY} ${FFI_LIBRARY} ${EXPAT_LIBRARY} ${INTL_LIBRARY} ${GMP_LIBRARY} ${PYTHON_DEP_LIBRARIES}) |
| 27 | else() | 27 | else() |
| 28 | find_package(PythonLibs 2.7 REQUIRED) | 28 | find_package(PythonLibs 3.5 REQUIRED) |
| 29 | list(APPEND PYTHON_LIBRARIES ${PC_PYTHON_STATIC_LIBRARIES}) | 29 | list(APPEND PYTHON_LIBRARIES ${PC_PYTHON_STATIC_LIBRARIES}) |
| 30 | endif() | 30 | endif() |
| 31 | 31 | ||
diff --git a/cmake/modules/FindSSE.cmake b/cmake/modules/FindSSE.cmake index 08e3630..d9d5c7a 100644 --- a/cmake/modules/FindSSE.cmake +++ b/cmake/modules/FindSSE.cmake | |||
| @@ -141,6 +141,7 @@ include(FindPackageHandleStandardArgs) | |||
| 141 | find_package_handle_standard_args(SSE | 141 | find_package_handle_standard_args(SSE |
| 142 | REQUIRED_VARS _SSE_TRUE _SSE_OK | 142 | REQUIRED_VARS _SSE_TRUE _SSE_OK |
| 143 | FAIL_MESSAGE "Could not find hardware support for SSE") | 143 | FAIL_MESSAGE "Could not find hardware support for SSE") |
| 144 | set(FPHSA_NAME_MISMATCHED ON) | ||
| 144 | find_package_handle_standard_args(SSE2 | 145 | find_package_handle_standard_args(SSE2 |
| 145 | REQUIRED_VARS _SSE2_TRUE _SSE2_OK | 146 | REQUIRED_VARS _SSE2_TRUE _SSE2_OK |
| 146 | FAIL_MESSAGE "Could not find hardware support for SSE2") | 147 | FAIL_MESSAGE "Could not find hardware support for SSE2") |
| @@ -162,6 +163,7 @@ find_package_handle_standard_args(AVX | |||
| 162 | find_package_handle_standard_args(AVX2 | 163 | find_package_handle_standard_args(AVX2 |
| 163 | REQUIRED_VARS _AVX2_TRUE _AVX2_OK | 164 | REQUIRED_VARS _AVX2_TRUE _AVX2_OK |
| 164 | FAIL_MESSAGE "Could not find hardware support for AVX2") | 165 | FAIL_MESSAGE "Could not find hardware support for AVX2") |
| 166 | unset(FPHSA_NAME_MISMATCHED) | ||
| 165 | 167 | ||
| 166 | mark_as_advanced(SSE2_FOUND SSE3_FOUND SSSE3_FOUND SSE4_1_FOUND SSE4_2_FOUND AVX_FOUND AVX2_FOUND) | 168 | mark_as_advanced(SSE2_FOUND SSE3_FOUND SSSE3_FOUND SSE4_1_FOUND SSE4_2_FOUND AVX_FOUND AVX2_FOUND) |
| 167 | 169 | ||
diff --git a/cmake/modules/FindSWIG.cmake b/cmake/modules/FindSWIG.cmake index f9b27c2..fba544b 100644 --- a/cmake/modules/FindSWIG.cmake +++ b/cmake/modules/FindSWIG.cmake | |||
| @@ -8,7 +8,7 @@ | |||
| 8 | # SWIG_FOUND - system has SWIG | 8 | # SWIG_FOUND - system has SWIG |
| 9 | # SWIG_EXECUTABLE - the SWIG executable | 9 | # SWIG_EXECUTABLE - the SWIG executable |
| 10 | 10 | ||
| 11 | find_program(SWIG_EXECUTABLE NAMES swig3.0 swig2.0 swig | 11 | find_program(SWIG_EXECUTABLE NAMES swig4.0 swig3.0 swig2.0 swig |
| 12 | PATH_SUFFIXES swig) | 12 | PATH_SUFFIXES swig) |
| 13 | if(SWIG_EXECUTABLE) | 13 | if(SWIG_EXECUTABLE) |
| 14 | execute_process(COMMAND ${SWIG_EXECUTABLE} -swiglib | 14 | execute_process(COMMAND ${SWIG_EXECUTABLE} -swiglib |
diff --git a/cmake/modules/FindShairplay.cmake b/cmake/modules/FindShairplay.cmake index bbb3372..506cffd 100644 --- a/cmake/modules/FindShairplay.cmake +++ b/cmake/modules/FindShairplay.cmake | |||
| @@ -17,32 +17,26 @@ | |||
| 17 | find_path(SHAIRPLAY_INCLUDE_DIR shairplay/raop.h) | 17 | find_path(SHAIRPLAY_INCLUDE_DIR shairplay/raop.h) |
| 18 | 18 | ||
| 19 | include(FindPackageHandleStandardArgs) | 19 | include(FindPackageHandleStandardArgs) |
| 20 | if(NOT WIN32) | 20 | find_library(SHAIRPLAY_LIBRARY NAMES shairplay libshairplay) |
| 21 | find_library(SHAIRPLAY_LIBRARY NAMES shairplay) | 21 | |
| 22 | 22 | if(SHAIRPLAY_INCLUDE_DIR AND SHAIRPLAY_LIBRARY) | |
| 23 | if(SHAIRPLAY_INCLUDE_DIR AND SHAIRPLAY_LIBRARY) | 23 | include(CheckCSourceCompiles) |
| 24 | include(CheckCSourceCompiles) | 24 | set(CMAKE_REQUIRED_INCLUDES ${SHAIRPLAY_INCLUDE_DIR}) |
| 25 | set(CMAKE_REQUIRED_INCLUDES ${SHAIRPLAY_INCLUDE_DIRS}) | 25 | set(CMAKE_REQUIRED_LIBRARIES ${SHAIRPLAY_LIBRARIES}) |
| 26 | set(CMAKE_REQUIRED_LIBRARIES ${SHAIRPLAY_LIBRARIES}) | 26 | check_c_source_compiles("#include <shairplay/raop.h> |
| 27 | check_c_source_compiles("#include <shairplay/raop.h> | 27 | |
| 28 | 28 | int main() | |
| 29 | int main() | 29 | { |
| 30 | { | 30 | struct raop_callbacks_s foo; |
| 31 | struct raop_callbacks_s foo; | 31 | foo.cls; |
| 32 | foo.cls; | 32 | return 0; |
| 33 | return 0; | 33 | } |
| 34 | } | 34 | " HAVE_SHAIRPLAY_CALLBACK_CLS) |
| 35 | " HAVE_SHAIRPLAY_CALLBACK_CLS) | ||
| 36 | endif() | ||
| 37 | |||
| 38 | find_package_handle_standard_args(Shairplay | ||
| 39 | REQUIRED_VARS SHAIRPLAY_LIBRARY SHAIRPLAY_INCLUDE_DIR HAVE_SHAIRPLAY_CALLBACK_CLS) | ||
| 40 | else() | ||
| 41 | # Dynamically loaded DLL | ||
| 42 | find_package_handle_standard_args(Shairplay | ||
| 43 | REQUIRED_VARS SHAIRPLAY_INCLUDE_DIR) | ||
| 44 | endif() | 35 | endif() |
| 45 | 36 | ||
| 37 | find_package_handle_standard_args(Shairplay | ||
| 38 | REQUIRED_VARS SHAIRPLAY_LIBRARY SHAIRPLAY_INCLUDE_DIR HAVE_SHAIRPLAY_CALLBACK_CLS) | ||
| 39 | |||
| 46 | if(SHAIRPLAY_FOUND) | 40 | if(SHAIRPLAY_FOUND) |
| 47 | set(SHAIRPLAY_LIBRARIES ${SHAIRPLAY_LIBRARY}) | 41 | set(SHAIRPLAY_LIBRARIES ${SHAIRPLAY_LIBRARY}) |
| 48 | set(SHAIRPLAY_INCLUDE_DIRS ${SHAIRPLAY_INCLUDE_DIR}) | 42 | set(SHAIRPLAY_INCLUDE_DIRS ${SHAIRPLAY_INCLUDE_DIR}) |
diff --git a/cmake/modules/FindSmbClient.cmake b/cmake/modules/FindSmbClient.cmake index 70492ff..fde48ab 100644 --- a/cmake/modules/FindSmbClient.cmake +++ b/cmake/modules/FindSmbClient.cmake | |||
| @@ -32,6 +32,9 @@ find_package_handle_standard_args(SmbClient | |||
| 32 | 32 | ||
| 33 | if(SMBCLIENT_FOUND) | 33 | if(SMBCLIENT_FOUND) |
| 34 | set(SMBCLIENT_LIBRARIES ${SMBCLIENT_LIBRARY}) | 34 | set(SMBCLIENT_LIBRARIES ${SMBCLIENT_LIBRARY}) |
| 35 | if(${SMBCLIENT_LIBRARY} MATCHES ".+\.a$" AND PC_SMBCLIENT_STATIC_LIBRARIES) | ||
| 36 | list(APPEND SMBCLIENT_LIBRARIES ${PC_SMBCLIENT_STATIC_LIBRARIES}) | ||
| 37 | endif() | ||
| 35 | set(SMBCLIENT_INCLUDE_DIRS ${SMBCLIENT_INCLUDE_DIR}) | 38 | set(SMBCLIENT_INCLUDE_DIRS ${SMBCLIENT_INCLUDE_DIR}) |
| 36 | set(SMBCLIENT_DEFINITIONS -DHAS_FILESYSTEM_SMB=1) | 39 | set(SMBCLIENT_DEFINITIONS -DHAS_FILESYSTEM_SMB=1) |
| 37 | 40 | ||
diff --git a/cmake/modules/FindSpdlog.cmake b/cmake/modules/FindSpdlog.cmake new file mode 100644 index 0000000..270e486 --- /dev/null +++ b/cmake/modules/FindSpdlog.cmake | |||
| @@ -0,0 +1,107 @@ | |||
| 1 | # FindSpdlog | ||
| 2 | # ------- | ||
| 3 | # Finds the Spdlog library | ||
| 4 | # | ||
| 5 | # This will define the following variables: | ||
| 6 | # | ||
| 7 | # SPDLOG_FOUND - system has Spdlog | ||
| 8 | # SPDLOG_INCLUDE_DIRS - the Spdlog include directory | ||
| 9 | # SPDLOG_LIBRARIES - the Spdlog libraries | ||
| 10 | # SPDLOG_DEFINITIONS - the Spdlog compile definitions | ||
| 11 | # | ||
| 12 | # and the following imported targets: | ||
| 13 | # | ||
| 14 | # Spdlog::Spdlog - The Spdlog library | ||
| 15 | |||
| 16 | if(ENABLE_INTERNAL_SPDLOG) | ||
| 17 | include(ExternalProject) | ||
| 18 | file(STRINGS ${CMAKE_SOURCE_DIR}/tools/depends/target/libspdlog/Makefile VER REGEX "^[ ]*VERSION[ ]*=.+$") | ||
| 19 | string(REGEX REPLACE "^[ ]*VERSION[ ]*=[ ]*" "" SPDLOG_VERSION "${VER}") | ||
| 20 | |||
| 21 | # allow user to override the download URL with a local tarball | ||
| 22 | # needed for offline build envs | ||
| 23 | if(SPDLOG_URL) | ||
| 24 | get_filename_component(SPDLOG_URL "${SPDLOG_URL}" ABSOLUTE) | ||
| 25 | else() | ||
| 26 | set(SPDLOG_URL http://mirrors.kodi.tv/build-deps/sources/spdlog-${SPDLOG_VERSION}.tar.gz) | ||
| 27 | endif() | ||
| 28 | if(VERBOSE) | ||
| 29 | message(STATUS "SPDLOG_URL: ${SPDLOG_URL}") | ||
| 30 | endif() | ||
| 31 | |||
| 32 | if(APPLE) | ||
| 33 | set(EXTRA_ARGS "-DCMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES}") | ||
| 34 | endif() | ||
| 35 | |||
| 36 | set(SPDLOG_LIBRARY ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/lib/libspdlog.a) | ||
| 37 | set(SPDLOG_INCLUDE_DIR ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/include) | ||
| 38 | |||
| 39 | externalproject_add(spdlog | ||
| 40 | URL ${SPDLOG_URL} | ||
| 41 | DOWNLOAD_DIR ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/download | ||
| 42 | PATCH_COMMAND patch -p1 -i ${CMAKE_SOURCE_DIR}/tools/depends/target/libspdlog/0001-fix_fmt_version.patch | ||
| 43 | PREFIX ${CORE_BUILD_DIR}/spdlog | ||
| 44 | CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR} | ||
| 45 | -DCMAKE_CXX_EXTENSIONS=${CMAKE_CXX_EXTENSIONS} | ||
| 46 | -DCMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD} | ||
| 47 | -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} | ||
| 48 | -DCMAKE_INSTALL_LIBDIR=lib | ||
| 49 | -DSPDLOG_BUILD_EXAMPLE=OFF | ||
| 50 | -DSPDLOG_BUILD_TESTS=OFF | ||
| 51 | -DSPDLOG_BUILD_BENCH=OFF | ||
| 52 | -DSPDLOG_FMT_EXTERNAL=ON | ||
| 53 | -DCMAKE_PREFIX_PATH=${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR} | ||
| 54 | "${EXTRA_ARGS}" | ||
| 55 | BUILD_BYPRODUCTS ${SPDLOG_LIBRARY}) | ||
| 56 | set_target_properties(spdlog PROPERTIES FOLDER "External Projects") | ||
| 57 | |||
| 58 | if(ENABLE_INTERNAL_FMT) | ||
| 59 | add_dependencies(spdlog fmt) | ||
| 60 | endif() | ||
| 61 | else() | ||
| 62 | find_package(spdlog 1.5.0 CONFIG REQUIRED QUIET) | ||
| 63 | |||
| 64 | if(PKG_CONFIG_FOUND) | ||
| 65 | pkg_check_modules(PC_SPDLOG spdlog QUIET) | ||
| 66 | set(SPDLOG_VERSION ${PC_SPDLOG_VERSION}) | ||
| 67 | endif() | ||
| 68 | |||
| 69 | find_path(SPDLOG_INCLUDE_DIR NAMES spdlog/spdlog.h | ||
| 70 | PATHS ${PC_SPDLOG_INCLUDEDIR}) | ||
| 71 | |||
| 72 | find_library(SPDLOG_LIBRARY_RELEASE NAMES spdlog | ||
| 73 | PATHS ${PC_SPDLOG_LIBDIR}) | ||
| 74 | find_library(SPDLOG_LIBRARY_DEBUG NAMES spdlogd | ||
| 75 | PATHS ${PC_SPDLOG_LIBDIR}) | ||
| 76 | |||
| 77 | include(SelectLibraryConfigurations) | ||
| 78 | select_library_configurations(SPDLOG) | ||
| 79 | endif() | ||
| 80 | |||
| 81 | include(FindPackageHandleStandardArgs) | ||
| 82 | find_package_handle_standard_args(Spdlog | ||
| 83 | REQUIRED_VARS SPDLOG_LIBRARY SPDLOG_INCLUDE_DIR | ||
| 84 | VERSION_VAR SPDLOG_VERSION) | ||
| 85 | |||
| 86 | if(SPDLOG_FOUND) | ||
| 87 | set(SPDLOG_LIBRARIES ${SPDLOG_LIBRARY}) | ||
| 88 | set(SPDLOG_INCLUDE_DIRS ${SPDLOG_INCLUDE_DIR}) | ||
| 89 | set(SPDLOG_DEFINITIONS -DSPDLOG_FMT_EXTERNAL | ||
| 90 | -DSPDLOG_DEBUG_ON | ||
| 91 | -DSPDLOG_NO_ATOMIC_LEVELS | ||
| 92 | -DSPDLOG_ENABLE_PATTERN_PADDING) | ||
| 93 | if(WIN32) | ||
| 94 | list(APPEND SPDLOG_DEFINITIONS -DSPDLOG_WCHAR_FILENAMES | ||
| 95 | -DSPDLOG_WCHAR_TO_UTF8_SUPPORT) | ||
| 96 | endif() | ||
| 97 | |||
| 98 | if(NOT TARGET Spdlog::Spdlog) | ||
| 99 | add_library(Spdlog::Spdlog UNKNOWN IMPORTED) | ||
| 100 | set_target_properties(Spdlog::Spdlog PROPERTIES | ||
| 101 | IMPORTED_LOCATION "${SPDLOG_LIBRARY}" | ||
| 102 | INTERFACE_INCLUDE_DIRECTORIES "${SPDLOG_INCLUDE_DIR}" | ||
| 103 | INTERFACE_COMPILE_DEFINITIONS "${SPDLOG_DEFINITIONS}") | ||
| 104 | endif() | ||
| 105 | endif() | ||
| 106 | |||
| 107 | mark_as_advanced(SPDLOG_INCLUDE_DIR SPDLOG_LIBRARY) | ||
diff --git a/cmake/modules/FindUdfread.cmake b/cmake/modules/FindUdfread.cmake new file mode 100644 index 0000000..20fb322 --- /dev/null +++ b/cmake/modules/FindUdfread.cmake | |||
| @@ -0,0 +1,78 @@ | |||
| 1 | #.rst: | ||
| 2 | # FindUdfread | ||
| 3 | # -------- | ||
| 4 | # Finds the udfread library | ||
| 5 | # | ||
| 6 | # This will define the following variables:: | ||
| 7 | # | ||
| 8 | # UDFREAD_FOUND - system has udfread | ||
| 9 | # UDFREAD_INCLUDE_DIRS - the udfread include directory | ||
| 10 | # UDFREAD_LIBRARIES - the udfread libraries | ||
| 11 | # UDFREAD_DEFINITIONS - the udfread definitions | ||
| 12 | |||
| 13 | if(PKG_CONFIG_FOUND) | ||
| 14 | pkg_check_modules(PC_UDFREAD udfread>=1.0.0 QUIET) | ||
| 15 | endif() | ||
| 16 | |||
| 17 | find_path(UDFREAD_INCLUDE_DIR NAMES udfread/udfread.h | ||
| 18 | PATHS ${PC_UDFREAD_INCLUDEDIR}) | ||
| 19 | |||
| 20 | find_library(UDFREAD_LIBRARY NAMES udfread libudfread | ||
| 21 | PATHS ${PC_UDFREAD_LIBDIR}) | ||
| 22 | |||
| 23 | set(UDFREAD_VERSION ${PC_UDFREAD_VERSION}) | ||
| 24 | |||
| 25 | if(ENABLE_INTERNAL_UDFREAD) | ||
| 26 | include(ExternalProject) | ||
| 27 | |||
| 28 | # Extract version | ||
| 29 | file(STRINGS ${CMAKE_SOURCE_DIR}/tools/depends/target/libudfread/UDFREAD-VERSION VER) | ||
| 30 | |||
| 31 | string(REGEX MATCH "VERSION=[^ ]*$.*" UDFREAD_VER "${VER}") | ||
| 32 | list(GET UDFREAD_VER 0 UDFREAD_VER) | ||
| 33 | string(SUBSTRING "${UDFREAD_VER}" 8 -1 UDFREAD_VER) | ||
| 34 | |||
| 35 | # allow user to override the download URL with a local tarball | ||
| 36 | # needed for offline build envs | ||
| 37 | if(UDFREAD_URL) | ||
| 38 | get_filename_component(UDFREAD_URL "${UDFREAD_URL}" ABSOLUTE) | ||
| 39 | else() | ||
| 40 | set(UDFREAD_URL http://mirrors.kodi.tv/build-deps/sources/libudfread-${UDFREAD_VER}.tar.gz) | ||
| 41 | endif() | ||
| 42 | |||
| 43 | if(VERBOSE) | ||
| 44 | message(STATUS "UDFREAD_URL: ${UDFREAD_URL}") | ||
| 45 | endif() | ||
| 46 | |||
| 47 | set(UDFREAD_LIBRARY ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/lib/libudfread.a) | ||
| 48 | set(UDFREAD_INCLUDE_DIR ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/include) | ||
| 49 | set(UDFREAD_VERSION ${UDFREAD_VER}) | ||
| 50 | |||
| 51 | externalproject_add(udfread | ||
| 52 | URL ${UDFREAD_URL} | ||
| 53 | DOWNLOAD_NAME libudfread-${UDFREAD_VER}.tar.gz | ||
| 54 | DOWNLOAD_DIR ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/download | ||
| 55 | PREFIX ${CORE_BUILD_DIR}/libudfread | ||
| 56 | CONFIGURE_COMMAND autoreconf -vif && | ||
| 57 | ./configure | ||
| 58 | --enable-static | ||
| 59 | --disable-shared | ||
| 60 | --prefix=${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR} | ||
| 61 | BUILD_BYPRODUCTS ${UDFREAD_LIBRARY} | ||
| 62 | BUILD_IN_SOURCE 1) | ||
| 63 | |||
| 64 | set_target_properties(udfread PROPERTIES FOLDER "External Projects") | ||
| 65 | endif() | ||
| 66 | |||
| 67 | include(FindPackageHandleStandardArgs) | ||
| 68 | find_package_handle_standard_args(Udfread | ||
| 69 | REQUIRED_VARS UDFREAD_LIBRARY UDFREAD_INCLUDE_DIR | ||
| 70 | VERSION_VAR UDFREAD_VERSION) | ||
| 71 | |||
| 72 | if(UDFREAD_FOUND) | ||
| 73 | set(UDFREAD_LIBRARIES ${UDFREAD_LIBRARY}) | ||
| 74 | set(UDFREAD_INCLUDE_DIRS ${UDFREAD_INCLUDE_DIR}) | ||
| 75 | set(UDFREAD_DEFINITIONS -DHAS_UDFREAD=1) | ||
| 76 | endif() | ||
| 77 | |||
| 78 | mark_as_advanced(UDFREAD_INCLUDE_DIR UDFREAD_LIBRARY) | ||
