From 2577b55681a97f3eec3fb0e3b5a4fb7f2cb18b8a Mon Sep 17 00:00:00 2001 From: manuel Date: Thu, 30 Aug 2018 00:42:04 +0200 Subject: sync with upstream --- cmake/modules/FindAML.cmake | 2 +- cmake/modules/FindASS.cmake | 2 +- cmake/modules/FindAlsa.cmake | 2 +- cmake/modules/FindAvahi.cmake | 2 +- cmake/modules/FindBluetooth.cmake | 2 +- cmake/modules/FindBluray.cmake | 21 +++------ cmake/modules/FindCEC.cmake | 21 +++------ cmake/modules/FindCWiid.cmake | 2 +- cmake/modules/FindCdio.cmake | 2 +- cmake/modules/FindCurl.cmake | 2 +- cmake/modules/FindDBus.cmake | 2 +- cmake/modules/FindEGL.cmake | 2 +- cmake/modules/FindFFMPEG.cmake | 28 +++++++---- cmake/modules/FindFlatBuffers.cmake | 72 ++++++++++++++++++++++++++++ cmake/modules/FindFmt.cmake | 15 +++--- cmake/modules/FindFreeType.cmake | 2 +- cmake/modules/FindFriBidi.cmake | 2 +- cmake/modules/FindGBM.cmake | 28 ++++++++++- cmake/modules/FindGIF.cmake | 2 +- cmake/modules/FindGLX.cmake | 2 +- cmake/modules/FindIconv.cmake | 2 +- cmake/modules/FindLCMS2.cmake | 2 +- cmake/modules/FindLibDRM.cmake | 4 +- cmake/modules/FindLibDvd.cmake | 11 ++--- cmake/modules/FindLibInput.cmake | 36 ++++++++++++++ cmake/modules/FindLibUSB.cmake | 2 +- cmake/modules/FindLircClient.cmake | 2 +- cmake/modules/FindLzo2.cmake | 2 +- cmake/modules/FindMDNS.cmake | 2 +- cmake/modules/FindMariaDBClient.cmake | 2 +- cmake/modules/FindMicroHttpd.cmake | 2 +- cmake/modules/FindMir.cmake | 33 ------------- cmake/modules/FindMySqlClient.cmake | 2 +- cmake/modules/FindNFS.cmake | 2 +- cmake/modules/FindOpenGLES.cmake | 2 +- cmake/modules/FindOpenGl.cmake | 2 +- cmake/modules/FindPCRE.cmake | 2 +- cmake/modules/FindPlist.cmake | 2 +- cmake/modules/FindSSE.cmake | 4 +- cmake/modules/FindSSH.cmake | 47 ------------------- cmake/modules/FindSWIG.cmake | 2 +- cmake/modules/FindSdl.cmake | 2 +- cmake/modules/FindShairplay.cmake | 2 +- cmake/modules/FindSmbClient.cmake | 2 +- cmake/modules/FindSndio.cmake | 2 +- cmake/modules/FindSqlite3.cmake | 2 +- cmake/modules/FindTagLib.cmake | 2 +- cmake/modules/FindTinyXML.cmake | 2 +- cmake/modules/FindUDEV.cmake | 2 +- cmake/modules/FindUUID.cmake | 2 +- cmake/modules/FindVAAPI.cmake | 2 +- cmake/modules/FindVDPAU.cmake | 2 +- cmake/modules/FindWaylandProtocols.cmake | 2 +- cmake/modules/FindWaylandpp.cmake | 50 ++++++++++++++------ cmake/modules/FindX.cmake | 2 +- cmake/modules/FindXRandR.cmake | 2 +- cmake/modules/FindXSLT.cmake | 2 +- cmake/modules/FindXkbcommon.cmake | 39 ++++++++++++---- cmake/modules/FindYajl.cmake | 2 +- cmake/modules/FindZip.cmake | 2 +- cmake/modules/Findfstrcmp.cmake | 80 ++++++++++++++++++++++++++++++++ 61 files changed, 372 insertions(+), 209 deletions(-) create mode 100644 cmake/modules/FindFlatBuffers.cmake create mode 100644 cmake/modules/FindLibInput.cmake delete mode 100644 cmake/modules/FindMir.cmake delete mode 100644 cmake/modules/FindSSH.cmake create mode 100644 cmake/modules/Findfstrcmp.cmake (limited to 'cmake/modules') diff --git a/cmake/modules/FindAML.cmake b/cmake/modules/FindAML.cmake index 602f5d9..89d1fd9 100644 --- a/cmake/modules/FindAML.cmake +++ b/cmake/modules/FindAML.cmake @@ -3,7 +3,7 @@ # ------- # Finds the AML codec # -# This will will define the following variables:: +# This will define the following variables:: # # AML_FOUND - system has AML # AML_INCLUDE_DIRS - the AML include directory diff --git a/cmake/modules/FindASS.cmake b/cmake/modules/FindASS.cmake index 2d592fa..cb9d732 100644 --- a/cmake/modules/FindASS.cmake +++ b/cmake/modules/FindASS.cmake @@ -3,7 +3,7 @@ # ------- # Finds the ASS library # -# This will will define the following variables:: +# This will define the following variables:: # # ASS_FOUND - system has ASS # ASS_INCLUDE_DIRS - the ASS include directory diff --git a/cmake/modules/FindAlsa.cmake b/cmake/modules/FindAlsa.cmake index ae05817..fdc7db8 100644 --- a/cmake/modules/FindAlsa.cmake +++ b/cmake/modules/FindAlsa.cmake @@ -3,7 +3,7 @@ # -------- # Finds the Alsa library # -# This will will define the following variables:: +# This will define the following variables:: # # ALSA_FOUND - system has Alsa # ALSA_INCLUDE_DIRS - the Alsa include directory diff --git a/cmake/modules/FindAvahi.cmake b/cmake/modules/FindAvahi.cmake index 068b292..e0e6689 100644 --- a/cmake/modules/FindAvahi.cmake +++ b/cmake/modules/FindAvahi.cmake @@ -3,7 +3,7 @@ # --------- # Finds the avahi library # -# This will will define the following variables:: +# This will define the following variables:: # # AVAHI_FOUND - system has avahi # AVAHI_INCLUDE_DIRS - the avahi include directory diff --git a/cmake/modules/FindBluetooth.cmake b/cmake/modules/FindBluetooth.cmake index a69980d..7ca99bb 100644 --- a/cmake/modules/FindBluetooth.cmake +++ b/cmake/modules/FindBluetooth.cmake @@ -3,7 +3,7 @@ # --------- # Finds the Bluetooth library # -# This will will define the following variables:: +# This will define the following variables:: # # BLUETOOTH_FOUND - system has Bluetooth # BLUETOOTH_INCLUDE_DIRS - the Bluetooth include directory diff --git a/cmake/modules/FindBluray.cmake b/cmake/modules/FindBluray.cmake index 3c29f54..58a9a91 100644 --- a/cmake/modules/FindBluray.cmake +++ b/cmake/modules/FindBluray.cmake @@ -3,7 +3,7 @@ # ---------- # Finds the libbluray library # -# This will will define the following variables:: +# This will define the following variables:: # # BLURAY_FOUND - system has libbluray # BLURAY_INCLUDE_DIRS - the libbluray include directory @@ -30,20 +30,13 @@ if(NOT BLURAY_VERSION AND EXISTS ${BLURAY_INCLUDE_DIR}/libbluray/bluray-version. unset(_bluray_version_str) endif() -include(FindPackageHandleStandardArgs) -if(NOT WIN32) - find_library(BLURAY_LIBRARY NAMES bluray - PATHS ${PC_BLURAY_LIBDIR}) +find_library(BLURAY_LIBRARY NAMES bluray libbluray + PATHS ${PC_BLURAY_LIBDIR}) - find_package_handle_standard_args(Bluray - REQUIRED_VARS BLURAY_LIBRARY BLURAY_INCLUDE_DIR BLURAY_VERSION - VERSION_VAR BLURAY_VERSION) -else() - # Dynamically loaded DLL - find_package_handle_standard_args(Bluray - REQUIRED_VARS BLURAY_INCLUDE_DIR - VERSION_VAR BLURAY_VERSION) -endif() +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(Bluray + REQUIRED_VARS BLURAY_LIBRARY BLURAY_INCLUDE_DIR BLURAY_VERSION + VERSION_VAR BLURAY_VERSION) if(BLURAY_FOUND) set(BLURAY_LIBRARIES ${BLURAY_LIBRARY}) diff --git a/cmake/modules/FindCEC.cmake b/cmake/modules/FindCEC.cmake index bd6fd1d..00b2e12 100644 --- a/cmake/modules/FindCEC.cmake +++ b/cmake/modules/FindCEC.cmake @@ -3,7 +3,7 @@ # ------- # Finds the libCEC library # -# This will will define the following variables:: +# This will define the following variables:: # # CEC_FOUND - system has libCEC # CEC_INCLUDE_DIRS - the libCEC include directory @@ -33,20 +33,13 @@ if(NOT CEC_FIND_VERSION) set(CEC_FIND_VERSION 4.0.0) endif() -include(FindPackageHandleStandardArgs) -if(NOT WIN32) - find_library(CEC_LIBRARY NAMES cec - PATHS ${PC_CEC_LIBDIR}) +find_library(CEC_LIBRARY NAMES cec + PATHS ${PC_CEC_LIBDIR}) - find_package_handle_standard_args(CEC - REQUIRED_VARS CEC_LIBRARY CEC_INCLUDE_DIR - VERSION_VAR CEC_VERSION) -else() - # Dynamically loaded DLL - find_package_handle_standard_args(CEC - REQUIRED_VARS CEC_INCLUDE_DIR - VERSION_VAR CEC_VERSION) -endif() +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(CEC + REQUIRED_VARS CEC_LIBRARY CEC_INCLUDE_DIR + VERSION_VAR CEC_VERSION) if(CEC_FOUND) set(CEC_LIBRARIES ${CEC_LIBRARY}) diff --git a/cmake/modules/FindCWiid.cmake b/cmake/modules/FindCWiid.cmake index 88cfbef..af9e391 100644 --- a/cmake/modules/FindCWiid.cmake +++ b/cmake/modules/FindCWiid.cmake @@ -3,7 +3,7 @@ # --------- # Finds the CWiid library # -# This will will define the following variables:: +# This will define the following variables:: # # CWIID_FOUND - system has CWiid # CWIID_INCLUDE_DIRS - the CWiid include directory diff --git a/cmake/modules/FindCdio.cmake b/cmake/modules/FindCdio.cmake index cce7f2a..91ba7bc 100644 --- a/cmake/modules/FindCdio.cmake +++ b/cmake/modules/FindCdio.cmake @@ -3,7 +3,7 @@ # -------- # Finds the cdio library # -# This will will define the following variables:: +# This will define the following variables:: # # CDIO_FOUND - system has cdio # CDIO_INCLUDE_DIRS - the cdio include directory diff --git a/cmake/modules/FindCurl.cmake b/cmake/modules/FindCurl.cmake index 17c1f01..6ccf44a 100644 --- a/cmake/modules/FindCurl.cmake +++ b/cmake/modules/FindCurl.cmake @@ -3,7 +3,7 @@ # -------- # Finds the Curl library # -# This will will define the following variables:: +# This will define the following variables:: # # CURL_FOUND - system has Curl # CURL_INCLUDE_DIRS - the Curl include directory diff --git a/cmake/modules/FindDBus.cmake b/cmake/modules/FindDBus.cmake index 9ea4f8f..df3edc5 100644 --- a/cmake/modules/FindDBus.cmake +++ b/cmake/modules/FindDBus.cmake @@ -3,7 +3,7 @@ # ------- # Finds the DBUS library # -# This will will define the following variables:: +# This will define the following variables:: # # DBUS_FOUND - system has DBUS # DBUS_INCLUDE_DIRS - the DBUS include directory diff --git a/cmake/modules/FindEGL.cmake b/cmake/modules/FindEGL.cmake index 331ac39..0b73eb8 100644 --- a/cmake/modules/FindEGL.cmake +++ b/cmake/modules/FindEGL.cmake @@ -3,7 +3,7 @@ # ------- # Finds the EGL library # -# This will will define the following variables:: +# This will define the following variables:: # # EGL_FOUND - system has EGL # EGL_INCLUDE_DIRS - the EGL include directory diff --git a/cmake/modules/FindFFMPEG.cmake b/cmake/modules/FindFFMPEG.cmake index e2fbe8d..ef74671 100644 --- a/cmake/modules/FindFFMPEG.cmake +++ b/cmake/modules/FindFFMPEG.cmake @@ -18,7 +18,7 @@ # usage: -DWITH_FFMPEG=/path/to/ffmpeg_install_prefix # # -------- -# This module will will define the following variables: +# This module will define the following variables: # # FFMPEG_FOUND - system has FFmpeg # FFMPEG_INCLUDE_DIRS - FFmpeg include directory @@ -33,14 +33,14 @@ # # required ffmpeg library versions -set(REQUIRED_FFMPEG_VERSION 3.4) -set(_avcodec_ver ">=57.107.100") -set(_avfilter_ver ">=6.107.100") -set(_avformat_ver ">=57.83.100") -set(_avutil_ver ">=55.78.100") -set(_swscale_ver ">=4.8.100") -set(_swresample_ver ">=2.9.100") -set(_postproc_ver ">=54.7.100") +set(REQUIRED_FFMPEG_VERSION 4.0) +set(_avcodec_ver ">=58.18.100") +set(_avfilter_ver ">=7.16.100") +set(_avformat_ver ">=58.12.100") +set(_avutil_ver ">=56.14.100") +set(_swscale_ver ">=5.1.100") +set(_swresample_ver ">=3.1.100") +set(_postproc_ver ">=55.1.100") # Allows building with external ffmpeg not found in system paths, @@ -229,6 +229,11 @@ if(NOT FFMPEG_FOUND) message(STATUS "FFMPEG_URL: ${FFMPEG_URL}") endif() + set(FFMPEG_OPTIONS -DENABLE_CCACHE=${ENABLE_CCACHE} + -DCCACHE_PROGRAM=${CCACHE_PROGRAM} + -DENABLE_VAAPI=${ENABLE_VAAPI} + -DENABLE_VDPAU=${ENABLE_VDPAU}) + if(KODI_DEPENDSBUILD) set(CROSS_ARGS -DDEPENDS_PATH=${DEPENDS_PATH} -DPKG_CONFIG_EXECUTABLE=${PKG_CONFIG_EXECUTABLE} @@ -237,6 +242,8 @@ if(NOT FFMPEG_FOUND) -DOS=${OS} -DCMAKE_AR=${CMAKE_AR}) endif() + set(LINKER_FLAGS ${CMAKE_EXE_LINKER_FLAGS}) + list(APPEND LINKER_FLAGS ${SYSTEM_LDFLAGS}) externalproject_add(ffmpeg URL ${FFMPEG_URL} @@ -255,8 +262,9 @@ if(NOT FFMPEG_FOUND) -DENABLE_CCACHE=${ENABLE_CCACHE} -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS} -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS} - -DCMAKE_EXE_LINKER_FLAGS=${CMAKE_EXE_LINKER_FLAGS} + -DCMAKE_EXE_LINKER_FLAGS=${LINKER_FLAGS} ${CROSS_ARGS} + ${FFMPEG_OPTIONS} PATCH_COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/tools/depends/target/ffmpeg/CMakeLists.txt && diff --git a/cmake/modules/FindFlatBuffers.cmake b/cmake/modules/FindFlatBuffers.cmake new file mode 100644 index 0000000..6f7e6a2 --- /dev/null +++ b/cmake/modules/FindFlatBuffers.cmake @@ -0,0 +1,72 @@ +# FindFlatBuffers +# -------- +# Find the FlatBuffers schema compiler and headers +# +# This will define the following variables: +# +# FLATBUFFERS_FOUND - system has FlatBuffers compiler and headers +# FLATBUFFERS_FLATC_EXECUTABLE - the flatc compiler executable +# FLATBUFFERS_INCLUDE_DIRS - the FlatFuffers include directory +# FLATBUFFERS_MESSAGES_INCLUDE_DIR - the directory for generated headers + +if(ENABLE_INTERNAL_FLATBUFFERS) + include(ExternalProject) + file(STRINGS ${CMAKE_SOURCE_DIR}/tools/depends/native/flatbuffers-native/Makefile VER REGEX "^[ ]*VERSION[ ]*=.+$") + string(REGEX REPLACE "^[ ]*VERSION[ ]*=[ ]*" "" FLATBUFFERS_VER "${VER}") + + # Allow user to override the download URL with a local tarball + # Needed for offline build envs + if(FLATBUFFERS_URL) + get_filename_component(FLATBUFFERS_URL "${FLATBUFFERS_URL}" ABSOLUTE) + else() + set(FLATBUFFERS_URL http://mirrors.kodi.tv/build-deps/sources/flatbuffers-${FLATBUFFERS_VER}.tar.gz) + endif() + if(VERBOSE) + message(STATUS "FLATBUFFERS_URL: ${FLATBUFFERS_URL}") + endif() + + set(FLATBUFFERS_FLATC_EXECUTABLE ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/bin/flatc CACHE INTERNAL "FlatBuffer compiler") + set(FLATBUFFERS_INCLUDE_DIR ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/include CACHE INTERNAL "FlatBuffer include dir") + + externalproject_add(flatbuffers + URL ${FLATBUFFERS_URL} + DOWNLOAD_DIR ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/download + PREFIX ${CORE_BUILD_DIR}/flatbuffers + CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR} + -DCMAKE_BUILD_TYPE=Release + -DFLATBUFFERS_CODE_COVERAGE=OFF + -DFLATBUFFERS_BUILD_TESTS=OFF + -DFLATBUFFERS_INSTALL=ON + -DFLATBUFFERS_BUILD_FLATLIB=OFF + -DFLATBUFFERS_BUILD_FLATC=ON + -DFLATBUFFERS_BUILD_FLATHASH=OFF + -DFLATBUFFERS_BUILD_GRPCTEST=OFF + -DFLATBUFFERS_BUILD_SHAREDLIB=OFF + "${EXTRA_ARGS}" + PATCH_COMMAND patch -p1 < ${CORE_SOURCE_DIR}/tools/depends/native/flatbuffers-native/0001-Fix-compiler-warning.patch + BUILD_BYPRODUCTS ${FLATBUFFERS_FLATC_EXECUTABLE}) + set_target_properties(flatbuffers PROPERTIES FOLDER "External Projects" + INTERFACE_INCLUDE_DIRECTORIES ${FLATBUFFERS_INCLUDE_DIR}) +else() + find_program(FLATBUFFERS_FLATC_EXECUTABLE NAMES flatc) + find_path(FLATBUFFERS_INCLUDE_DIR NAMES flatbuffers/flatbuffers.h) +endif() + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(FlatBuffers + REQUIRED_VARS FLATBUFFERS_FLATC_EXECUTABLE FLATBUFFERS_INCLUDE_DIR + VERSION_VAR FLATBUFFERS_VER) + +if(FLATBUFFERS_FOUND) + set(FLATBUFFERS_MESSAGES_INCLUDE_DIR ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/cores/RetroPlayer/messages CACHE INTERNAL "Generated FlatBuffer headers") + set(FLATBUFFERS_INCLUDE_DIRS ${FLATBUFFERS_INCLUDE_DIR} ${FLATBUFFERS_MESSAGES_INCLUDE_DIR}) + + if(NOT TARGET flatbuffers) + add_library(flatbuffers UNKNOWN IMPORTED) + set_target_properties(flatbuffers PROPERTIES + FOLDER "External Projects" + INTERFACE_INCLUDE_DIRECTORIES ${FLATBUFFERS_INCLUDE_DIR}) + endif() +endif() + +mark_as_advanced(FLATBUFFERS_FLATC_EXECUTABLE FLATBUFFERS_INCLUDE_DIR) diff --git a/cmake/modules/FindFmt.cmake b/cmake/modules/FindFmt.cmake index 5e47509..df18d85 100644 --- a/cmake/modules/FindFmt.cmake +++ b/cmake/modules/FindFmt.cmake @@ -30,7 +30,7 @@ if(ENABLE_INTERNAL_FMT) if(APPLE) set(EXTRA_ARGS "-DCMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES}") - endif() + endif() set(FMT_LIBRARY ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/lib/libfmt.a) set(FMT_INCLUDE_DIR ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/include) @@ -90,14 +90,13 @@ if(FMT_FOUND) set(FMT_LIBRARIES ${FMT_LIBRARY}) set(FMT_INCLUDE_DIRS ${FMT_INCLUDE_DIR}) - if(NOT TARGET Fmt::Fmt) - add_library(Fmt::Fmt UNKNOWN IMPORTED) - set_target_properties(Fmt::Fmt PROPERTIES - IMPORTED_LOCATION "${FMT_LIBRARY}" - INTERFACE_INCLUDE_DIRECTORIES "${FMT_INCLUDE_DIR}") + if(NOT TARGET fmt) + add_library(fmt UNKNOWN IMPORTED) + set_target_properties(fmt PROPERTIES + IMPORTED_LOCATION "${FMT_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES "${FMT_INCLUDE_DIR}") endif() endif() -mark_as_advanced(FMT_INCLUDE_DIR FMT_LIBRARY) - endif() +mark_as_advanced(FMT_INCLUDE_DIR FMT_LIBRARY) diff --git a/cmake/modules/FindFreeType.cmake b/cmake/modules/FindFreeType.cmake index fb4c668..8a39555 100644 --- a/cmake/modules/FindFreeType.cmake +++ b/cmake/modules/FindFreeType.cmake @@ -3,7 +3,7 @@ # ------------ # Finds the FreeType library # -# This will will define the following variables:: +# This will define the following variables:: # # FREETYPE_FOUND - system has FreeType # FREETYPE_INCLUDE_DIRS - the FreeType include directory diff --git a/cmake/modules/FindFriBidi.cmake b/cmake/modules/FindFriBidi.cmake index dcaeb48..91f3994 100644 --- a/cmake/modules/FindFriBidi.cmake +++ b/cmake/modules/FindFriBidi.cmake @@ -3,7 +3,7 @@ # ----------- # Finds the GNU FriBidi library # -# This will will define the following variables:: +# This will define the following variables:: # # FRIBIDI_FOUND - system has FriBidi # FRIBIDI_INCLUDE_DIRS - the FriBidi include directory diff --git a/cmake/modules/FindGBM.cmake b/cmake/modules/FindGBM.cmake index ac95241..37a26a7 100644 --- a/cmake/modules/FindGBM.cmake +++ b/cmake/modules/FindGBM.cmake @@ -2,7 +2,7 @@ # ---------- # Finds the GBM library # -# This will will define the following variables:: +# This will define the following variables:: # # GBM_FOUND - system has GBM # GBM_INCLUDE_DIRS - the GBM include directory @@ -29,11 +29,35 @@ find_package_handle_standard_args(GBM REQUIRED_VARS GBM_LIBRARY GBM_INCLUDE_DIR VERSION_VAR GBM_VERSION) +include(CheckCSourceCompiles) +set(CMAKE_REQUIRED_LIBRARIES ${GBM_LIBRARY}) +check_c_source_compiles("#include + + int main() + { + gbm_bo_map(NULL, 0, 0, 0, 0, GBM_BO_TRANSFER_WRITE, NULL, NULL); + } + " GBM_HAS_BO_MAP) + +check_c_source_compiles("#include + + int main() + { + gbm_surface_create_with_modifiers(NULL, 0, 0, 0, NULL, 0); + } + " GBM_HAS_MODIFIERS) + if(GBM_FOUND) set(GBM_LIBRARIES ${GBM_LIBRARY}) set(GBM_INCLUDE_DIRS ${GBM_INCLUDE_DIR}) set(GBM_DEFINITIONS -DHAVE_GBM=1) - if(NOT TARGET GBM::GBM) + if(GBM_HAS_BO_MAP) + list(APPEND GBM_DEFINITIONS -DHAS_GBM_BO_MAP=1) + endif() + if(GBM_HAS_MODIFIERS) + list(APPEND GBM_DEFINITIONS -DHAS_GBM_MODIFIERS=1) + endif() + if(NOT TARGET GBM::GBM) add_library(GBM::GBM UNKNOWN IMPORTED) set_target_properties(GBM::GBM PROPERTIES IMPORTED_LOCATION "${GBM_LIBRARY}" diff --git a/cmake/modules/FindGIF.cmake b/cmake/modules/FindGIF.cmake index 8649bd4..1c616e0 100644 --- a/cmake/modules/FindGIF.cmake +++ b/cmake/modules/FindGIF.cmake @@ -3,7 +3,7 @@ # ------- # Finds the libgif library # -# This will will define the following variables:: +# This will define the following variables:: # # GIF_FOUND - system has libgif # GIF_INCLUDE_DIRS - the libgif include directory diff --git a/cmake/modules/FindGLX.cmake b/cmake/modules/FindGLX.cmake index 77c8fce..ab74dfd 100644 --- a/cmake/modules/FindGLX.cmake +++ b/cmake/modules/FindGLX.cmake @@ -3,7 +3,7 @@ # ----- # Finds the GLX library # -# This will will define the following variables:: +# This will define the following variables:: # # GLX_FOUND - system has GLX # GLX_INCLUDE_DIRS - the GLX include directory diff --git a/cmake/modules/FindIconv.cmake b/cmake/modules/FindIconv.cmake index 8ee01fb..ae7d8d7 100644 --- a/cmake/modules/FindIconv.cmake +++ b/cmake/modules/FindIconv.cmake @@ -3,7 +3,7 @@ # -------- # Finds the ICONV library # -# This will will define the following variables:: +# This will define the following variables:: # # ICONV_FOUND - system has ICONV # ICONV_INCLUDE_DIRS - the ICONV include directory diff --git a/cmake/modules/FindLCMS2.cmake b/cmake/modules/FindLCMS2.cmake index 5ec7a77..7cc1497 100644 --- a/cmake/modules/FindLCMS2.cmake +++ b/cmake/modules/FindLCMS2.cmake @@ -3,7 +3,7 @@ # ----------- # Finds the LCMS Color Management library # -# This will will define the following variables:: +# This will define the following variables:: # # LCMS2_FOUND - system has LCMS Color Management # LCMS2_INCLUDE_DIRS - the LCMS Color Management include directory diff --git a/cmake/modules/FindLibDRM.cmake b/cmake/modules/FindLibDRM.cmake index 35d632e..ec30920 100644 --- a/cmake/modules/FindLibDRM.cmake +++ b/cmake/modules/FindLibDRM.cmake @@ -3,7 +3,7 @@ # ---------- # Finds the LibDRM library # -# This will will define the following variables:: +# This will define the following variables:: # # LIBDRM_FOUND - system has LibDRM # LIBDRM_INCLUDE_DIRS - the LibDRM include directory @@ -14,7 +14,7 @@ # LibDRM::LibDRM - The LibDRM library if(PKG_CONFIG_FOUND) - pkg_check_modules(PC_LIBDRM libdrm QUIET) + pkg_check_modules(PC_LIBDRM libdrm>=2.4.71 QUIET) endif() find_path(LIBDRM_INCLUDE_DIR NAMES drm.h diff --git a/cmake/modules/FindLibDvd.cmake b/cmake/modules/FindLibDvd.cmake index 5c72826..bd08b94 100644 --- a/cmake/modules/FindLibDvd.cmake +++ b/cmake/modules/FindLibDvd.cmake @@ -76,9 +76,6 @@ else() endforeach() set(DVDREAD_CFLAGS "${DVDREAD_CFLAGS} -I${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/libdvd/include") - if(CMAKE_CROSSCOMPILING) - set(EXTRA_FLAGS "CC=${CMAKE_C_COMPILER}") - endif() if(APPLE) set(CMAKE_LD_FLAGS "-framework IOKit -framework CoreFoundation") @@ -113,7 +110,7 @@ else() --with-pic --prefix= --libdir=/lib - "${EXTRA_FLAGS}" + "CC=${CMAKE_C_COMPILER}" "CFLAGS=${CMAKE_C_FLAGS} ${DVDREAD_CFLAGS}" "LDFLAGS=${CMAKE_LD_FLAGS}" BUILD_BYPRODUCTS ${DVDCSS_LIBRARY}) @@ -154,7 +151,7 @@ else() --with-pic --prefix= --libdir=/lib - "${EXTRA_FLAGS}" + "CC=${CMAKE_C_COMPILER}" "CFLAGS=${CMAKE_C_FLAGS} ${DVDREAD_CFLAGS}" "LDFLAGS=${CMAKE_LD_FLAGS}" BUILD_BYPRODUCTS ${DVDREAD_LIBRARY}) @@ -198,7 +195,7 @@ else() --with-pic --prefix=${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/libdvd --libdir=${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/libdvd/lib - "${EXTRA_FLAGS}" + "CC=${CMAKE_C_COMPILER}" "LDFLAGS=${CMAKE_LD_FLAGS} -L${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/libdvd/lib" "CFLAGS=${CMAKE_C_FLAGS} ${DVDREAD_CFLAGS}" "DVDREAD_CFLAGS=${DVDREAD_CFLAGS}" @@ -245,4 +242,4 @@ else() endif() set(LIBDVD_LIBRARIES ${LIBDVD_LIBRARIES} CACHE STRING "libdvd libraries" FORCE) set(LIBDVD_FOUND 1 CACHE BOOL "libdvd found" FORCE) -endif() \ No newline at end of file +endif() diff --git a/cmake/modules/FindLibInput.cmake b/cmake/modules/FindLibInput.cmake new file mode 100644 index 0000000..069df5f --- /dev/null +++ b/cmake/modules/FindLibInput.cmake @@ -0,0 +1,36 @@ +#.rst: +# FindLibinput +# -------- +# Finds the libinput library +# +# This will define the following variables:: +# +# LIBINPUT_FOUND - system has libinput +# LIBINPUT_INCLUDE_DIRS - the libinput include directory +# LIBINPUT_LIBRARIES - the libinput libraries +# LIBINPUT_DEFINITIONS - the libinput compile definitions +# + +if(PKG_CONFIG_FOUND) + pkg_check_modules(PC_LIBINPUT libinput QUIET) +endif() + +find_path(LIBINPUT_INCLUDE_DIR NAMES libinput.h + PATHS ${PC_LIBINPUT_INCLUDEDIR}) + +find_library(LIBINPUT_LIBRARY NAMES input + PATHS ${PC_LIBINPUT_LIBDIR}) + +set(LIBINPUT_VERSION ${PC_LIBINPUT_VERSION}) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(LibInput + REQUIRED_VARS LIBINPUT_LIBRARY LIBINPUT_INCLUDE_DIR + VERSION_VAR LIBINPUT_VERSION) + +if(LIBINPUT_FOUND) + set(LIBINPUT_INCLUDE_DIRS ${LIBINPUT_INCLUDE_DIR}) + set(LIBINPUT_LIBRARIES ${LIBINPUT_LIBRARY}) +endif() + +mark_as_advanced(LIBINPUT_INCLUDE_DIR LIBINPUT_LIBRARY) diff --git a/cmake/modules/FindLibUSB.cmake b/cmake/modules/FindLibUSB.cmake index e976bf4..17cf6ec 100644 --- a/cmake/modules/FindLibUSB.cmake +++ b/cmake/modules/FindLibUSB.cmake @@ -3,7 +3,7 @@ # ---------- # Finds the USB library # -# This will will define the following variables:: +# This will define the following variables:: # # LIBUSB_FOUND - system has LibUSB # LIBUSB_INCLUDE_DIRS - the USB include directory diff --git a/cmake/modules/FindLircClient.cmake b/cmake/modules/FindLircClient.cmake index 528c38e..c469af5 100644 --- a/cmake/modules/FindLircClient.cmake +++ b/cmake/modules/FindLircClient.cmake @@ -2,7 +2,7 @@ # ----------- # Finds the liblirc_client library # -# This will will define the following variables:: +# This will define the following variables:: # # LIRCCLIENT_FOUND - if false, do not try to link to lirc_client # LIRCCLIENT_INCLUDE_DIRS - where to find lirc/lirc_client.h diff --git a/cmake/modules/FindLzo2.cmake b/cmake/modules/FindLzo2.cmake index 4f7313f..5e3e686 100644 --- a/cmake/modules/FindLzo2.cmake +++ b/cmake/modules/FindLzo2.cmake @@ -3,7 +3,7 @@ # -------- # Finds the Lzo2 library # -# This will will define the following variables:: +# This will define the following variables:: # # LZO2_FOUND - system has Lzo2 # LZO2_INCLUDE_DIRS - the Lzo2 include directory diff --git a/cmake/modules/FindMDNS.cmake b/cmake/modules/FindMDNS.cmake index 9294708..c2574c8 100644 --- a/cmake/modules/FindMDNS.cmake +++ b/cmake/modules/FindMDNS.cmake @@ -3,7 +3,7 @@ # -------- # Finds the mDNS library # -# This will will define the following variables:: +# This will define the following variables:: # # MDNS_FOUND - system has mDNS # MDNS_INCLUDE_DIRS - the mDNS include directory diff --git a/cmake/modules/FindMariaDBClient.cmake b/cmake/modules/FindMariaDBClient.cmake index 1e5e736..8a28670 100644 --- a/cmake/modules/FindMariaDBClient.cmake +++ b/cmake/modules/FindMariaDBClient.cmake @@ -3,7 +3,7 @@ # --------------- # Finds the MariaDBClient library # -# This will will define the following variables:: +# This will define the following variables:: # # MARIADBCLIENT_FOUND - system has MariaDBClient # MARIADBCLIENT_INCLUDE_DIRS - the MariaDBClient include directory diff --git a/cmake/modules/FindMicroHttpd.cmake b/cmake/modules/FindMicroHttpd.cmake index d04878c..e6127f3 100644 --- a/cmake/modules/FindMicroHttpd.cmake +++ b/cmake/modules/FindMicroHttpd.cmake @@ -3,7 +3,7 @@ # -------------- # Finds the MicroHttpd library # -# This will will define the following variables:: +# This will define the following variables:: # # MICROHTTPD_FOUND - system has MicroHttpd # MICROHTTPD_INCLUDE_DIRS - the MicroHttpd include directory diff --git a/cmake/modules/FindMir.cmake b/cmake/modules/FindMir.cmake deleted file mode 100644 index e66ff02..0000000 --- a/cmake/modules/FindMir.cmake +++ /dev/null @@ -1,33 +0,0 @@ -# FindMir -# ------- -# Finds the Mir library -# -# This will will define the following variables:: -# -# MIR_FOUND - the system has Mir -# MIR_INCLUDE_DIRS - the Mir include directory -# MIR_LIBRARIES - the Mir libraries -# MIR_DEFINITIONS - the Mir definitions - - -if(PKG_CONFIG_FOUND) - pkg_check_modules (PC_MIR mirclient>=0.26.2 QUIET) -endif() - -find_path(MIR_INCLUDE_DIR NAMES mir_toolkit/mir_client_library.h - PATHS ${PC_MIR_INCLUDE_DIRS}) - -find_library(MIR_LIBRARY NAMES mirclient - PATHS ${PC_MIR_LIBRARIES} ${PC_MIR_LIBRARY_DIRS}) - -include (FindPackageHandleStandardArgs) -find_package_handle_standard_args (Mir - REQUIRED_VARS MIR_LIBRARY MIR_INCLUDE_DIR) - -if (MIR_FOUND) - set(MIR_LIBRARIES ${MIR_LIBRARY}) - set(MIR_INCLUDE_DIRS ${PC_MIR_INCLUDE_DIRS}) - set(MIR_DEFINITIONS -DHAVE_MIR=1) -endif() - -mark_as_advanced (MIR_LIBRARY MIR_INCLUDE_DIR) diff --git a/cmake/modules/FindMySqlClient.cmake b/cmake/modules/FindMySqlClient.cmake index 50db582..05d3f57 100644 --- a/cmake/modules/FindMySqlClient.cmake +++ b/cmake/modules/FindMySqlClient.cmake @@ -3,7 +3,7 @@ # --------------- # Finds the MySqlClient library # -# This will will define the following variables:: +# This will define the following variables:: # # MYSQLCLIENT_FOUND - system has MySqlClient # MYSQLCLIENT_INCLUDE_DIRS - the MySqlClient include directory diff --git a/cmake/modules/FindNFS.cmake b/cmake/modules/FindNFS.cmake index b304bf3..36727c0 100644 --- a/cmake/modules/FindNFS.cmake +++ b/cmake/modules/FindNFS.cmake @@ -3,7 +3,7 @@ # ------- # Finds the libnfs library # -# This will will define the following variables:: +# This will define the following variables:: # # NFS_FOUND - system has libnfs # NFS_INCLUDE_DIRS - the libnfs include directory diff --git a/cmake/modules/FindOpenGLES.cmake b/cmake/modules/FindOpenGLES.cmake index fac21bc..0191d9e 100644 --- a/cmake/modules/FindOpenGLES.cmake +++ b/cmake/modules/FindOpenGLES.cmake @@ -3,7 +3,7 @@ # ------------ # Finds the OpenGLES2 library # -# This will will define the following variables:: +# This will define the following variables:: # # OPENGLES_FOUND - system has OpenGLES # OPENGLES_INCLUDE_DIRS - the OpenGLES include directory diff --git a/cmake/modules/FindOpenGl.cmake b/cmake/modules/FindOpenGl.cmake index af1c433..cb695a6 100644 --- a/cmake/modules/FindOpenGl.cmake +++ b/cmake/modules/FindOpenGl.cmake @@ -3,7 +3,7 @@ # ---------- # Finds the FindOpenGl library # -# This will will define the following variables:: +# This will define the following variables:: # # OPENGL_FOUND - system has OpenGl # OPENGL_INCLUDE_DIRS - the OpenGl include directory diff --git a/cmake/modules/FindPCRE.cmake b/cmake/modules/FindPCRE.cmake index 8babed3..d549d19 100644 --- a/cmake/modules/FindPCRE.cmake +++ b/cmake/modules/FindPCRE.cmake @@ -3,7 +3,7 @@ # -------- # Finds the PCRECPP library # -# This will will define the following variables:: +# This will define the following variables:: # # PCRE_FOUND - system has libpcrecpp # PCRE_INCLUDE_DIRS - the libpcrecpp include directory diff --git a/cmake/modules/FindPlist.cmake b/cmake/modules/FindPlist.cmake index 0664c10..cd143e9 100644 --- a/cmake/modules/FindPlist.cmake +++ b/cmake/modules/FindPlist.cmake @@ -3,7 +3,7 @@ # --------- # Finds the Plist library # -# This will will define the following variables:: +# This will define the following variables:: # # PLIST_FOUND - system has Plist library # PLIST_INCLUDE_DIRS - the Plist library include directory diff --git a/cmake/modules/FindSSE.cmake b/cmake/modules/FindSSE.cmake index b860dca..08e3630 100644 --- a/cmake/modules/FindSSE.cmake +++ b/cmake/modules/FindSSE.cmake @@ -1,4 +1,4 @@ -# Check if SSE instructions are available on the machine where +# Check if SSE instructions are available on the machine where # the project is compiled. include(TestCXXAcceptsFlag) @@ -74,7 +74,7 @@ elseif(CMAKE_SYSTEM_NAME MATCHES "FreeBSD") string(REGEX REPLACE "^.*(AVX2).*$" "\\1" _SSE_THERE ${CPUINFO}) string(COMPARE EQUAL "AVX2" "${_SSE_THERE}" _AVX2_TRUE) CHECK_CXX_ACCEPTS_FLAG("-mavx2" _AVX2_OK) - endif() + endif() elseif(CMAKE_SYSTEM_NAME MATCHES "Android") if(CPU MATCHES "x86_64" OR CPU MATCHES "i.86") set(_SSE_TRUE TRUE) diff --git a/cmake/modules/FindSSH.cmake b/cmake/modules/FindSSH.cmake deleted file mode 100644 index bf3837e..0000000 --- a/cmake/modules/FindSSH.cmake +++ /dev/null @@ -1,47 +0,0 @@ -#.rst: -# FindSSH -# ------- -# Finds the SSH library -# -# This will will define the following variables:: -# -# SSH_FOUND - system has SSH -# SSH_INCLUDE_DIRS - the SSH include directory -# SSH_LIBRARIES - the SSH libraries -# SSH_DEFINITIONS - the SSH definitions -# -# and the following imported targets:: -# -# SSH::SSH - The SSH library - -if(PKG_CONFIG_FOUND) - pkg_check_modules(PC_SSH libssh>=0.6 QUIET) -endif() - -find_path(SSH_INCLUDE_DIR NAMES libssh/libssh.h - PATHS ${PC_SSH_INCLUDEDIR}) -find_library(SSH_LIBRARY NAMES ssh - PATHS ${PC_SSH_LIBDIR}) - -set(SSH_VERSION ${PC_SSH_VERSION}) - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(SSH - REQUIRED_VARS SSH_LIBRARY SSH_INCLUDE_DIR - VERSION_VAR SSH_VERSION) - -if(SSH_FOUND) - set(SSH_LIBRARIES ${SSH_LIBRARY}) - set(SSH_INCLUDE_DIRS ${SSH_INCLUDE_DIR}) - set(SSH_DEFINITIONS -DHAS_FILESYSTEM_SFTP=1) - - if(NOT TARGET SSH::SSH) - add_library(SSH::SSH UNKNOWN IMPORTED) - set_target_properties(SSH::SSH PROPERTIES - IMPORTED_LOCATION "${SSH_LIBRARY}" - INTERFACE_INCLUDE_DIRECTORIES "${SSH_INCLUDE_DIR}" - INTERFACE_COMPILE_DEFINITIONS HAS_FILESYSTEM_SFTP=1) - endif() -endif() - -mark_as_advanced(SSH_INCLUDE_DIR SSH_LIBRARY) diff --git a/cmake/modules/FindSWIG.cmake b/cmake/modules/FindSWIG.cmake index 523b49b..f9b27c2 100644 --- a/cmake/modules/FindSWIG.cmake +++ b/cmake/modules/FindSWIG.cmake @@ -3,7 +3,7 @@ # -------- # Finds the SWIG executable # -# This will will define the following variables:: +# This will define the following variables:: # # SWIG_FOUND - system has SWIG # SWIG_EXECUTABLE - the SWIG executable diff --git a/cmake/modules/FindSdl.cmake b/cmake/modules/FindSdl.cmake index 81c1793..60959cb 100644 --- a/cmake/modules/FindSdl.cmake +++ b/cmake/modules/FindSdl.cmake @@ -3,7 +3,7 @@ # ------- # Finds the SDL library # -# This will will define the following variables:: +# This will define the following variables:: # # SDL_FOUND - system has SDL # SDL_INCLUDE_DIRS - the SDL include directory diff --git a/cmake/modules/FindShairplay.cmake b/cmake/modules/FindShairplay.cmake index 699fb7a..bbb3372 100644 --- a/cmake/modules/FindShairplay.cmake +++ b/cmake/modules/FindShairplay.cmake @@ -3,7 +3,7 @@ # ------------- # Finds the Shairplay library # -# This will will define the following variables:: +# This will define the following variables:: # # SHAIRPLAY_FOUND - system has Shairplay # SHAIRPLAY_INCLUDE_DIRS - the Shairplay include directory diff --git a/cmake/modules/FindSmbClient.cmake b/cmake/modules/FindSmbClient.cmake index 9a8b197..70492ff 100644 --- a/cmake/modules/FindSmbClient.cmake +++ b/cmake/modules/FindSmbClient.cmake @@ -3,7 +3,7 @@ # ------------- # Finds the SMB Client library # -# This will will define the following variables:: +# This will define the following variables:: # # SMBCLIENT_FOUND - system has SmbClient # SMBCLIENT_INCLUDE_DIRS - the SmbClient include directory diff --git a/cmake/modules/FindSndio.cmake b/cmake/modules/FindSndio.cmake index 5f08acd..992c0b1 100644 --- a/cmake/modules/FindSndio.cmake +++ b/cmake/modules/FindSndio.cmake @@ -3,7 +3,7 @@ # --------- # Finds the Sndio Library # -# This will will define the following variables: +# This will define the following variables: # # SNDIO_FOUND - system has sndio # SNDIO_INCLUDE_DIRS - sndio include directory diff --git a/cmake/modules/FindSqlite3.cmake b/cmake/modules/FindSqlite3.cmake index abde0cf..8fd9719 100644 --- a/cmake/modules/FindSqlite3.cmake +++ b/cmake/modules/FindSqlite3.cmake @@ -3,7 +3,7 @@ # ----------- # Finds the SQLite3 library # -# This will will define the following variables:: +# This will define the following variables:: # # SQLITE3_FOUND - system has SQLite3 # SQLITE3_INCLUDE_DIRS - the SQLite3 include directory diff --git a/cmake/modules/FindTagLib.cmake b/cmake/modules/FindTagLib.cmake index 8c8c2f3..ac7b7ec 100644 --- a/cmake/modules/FindTagLib.cmake +++ b/cmake/modules/FindTagLib.cmake @@ -3,7 +3,7 @@ # ---------- # Finds the TagLib library # -# This will will define the following variables:: +# This will define the following variables:: # # TAGLIB_FOUND - system has TagLib # TAGLIB_INCLUDE_DIRS - the TagLib include directory diff --git a/cmake/modules/FindTinyXML.cmake b/cmake/modules/FindTinyXML.cmake index 1220a94..5e9539e 100644 --- a/cmake/modules/FindTinyXML.cmake +++ b/cmake/modules/FindTinyXML.cmake @@ -3,7 +3,7 @@ # ----------- # Finds the TinyXML library # -# This will will define the following variables:: +# This will define the following variables:: # # TINYXML_FOUND - system has TinyXML # TINYXML_INCLUDE_DIRS - the TinyXML include directory diff --git a/cmake/modules/FindUDEV.cmake b/cmake/modules/FindUDEV.cmake index 422c437..a884025 100644 --- a/cmake/modules/FindUDEV.cmake +++ b/cmake/modules/FindUDEV.cmake @@ -3,7 +3,7 @@ # ------- # Finds the UDEV library # -# This will will define the following variables:: +# This will define the following variables:: # # UDEV_FOUND - system has UDEV # UDEV_INCLUDE_DIRS - the UDEV include directory diff --git a/cmake/modules/FindUUID.cmake b/cmake/modules/FindUUID.cmake index 173fac2..0c2ff5a 100644 --- a/cmake/modules/FindUUID.cmake +++ b/cmake/modules/FindUUID.cmake @@ -3,7 +3,7 @@ # -------- # Finds the libuuid library # -# This will will define the following variables:: +# This will define the following variables:: # # UUID_FOUND - system has libuuid # UUID_INCLUDE_DIRS - the libuuid include directory diff --git a/cmake/modules/FindVAAPI.cmake b/cmake/modules/FindVAAPI.cmake index 157cec4..2111e4f 100644 --- a/cmake/modules/FindVAAPI.cmake +++ b/cmake/modules/FindVAAPI.cmake @@ -3,7 +3,7 @@ # --------- # Finds the VAAPI library # -# This will will define the following variables:: +# This will define the following variables:: # # VAAPI_FOUND - system has VAAPI # VAAPI_INCLUDE_DIRS - the VAAPI include directory diff --git a/cmake/modules/FindVDPAU.cmake b/cmake/modules/FindVDPAU.cmake index b99e03f..b2c5482 100644 --- a/cmake/modules/FindVDPAU.cmake +++ b/cmake/modules/FindVDPAU.cmake @@ -3,7 +3,7 @@ # --------- # Finds the VDPAU library # -# This will will define the following variables:: +# This will define the following variables:: # # VDPAU_FOUND - system has VDPAU # VDPAU_INCLUDE_DIRS - the VDPAU include directory diff --git a/cmake/modules/FindWaylandProtocols.cmake b/cmake/modules/FindWaylandProtocols.cmake index 0b96ff0..e74bb80 100644 --- a/cmake/modules/FindWaylandProtocols.cmake +++ b/cmake/modules/FindWaylandProtocols.cmake @@ -2,7 +2,7 @@ # -------------------- # Find wayland-protocols # -# This will will define the following variables:: +# This will define the following variables:: # # WAYLAND_PROTOCOLS_DIR - directory containing the additional Wayland protocols # from the wayland-protocols package diff --git a/cmake/modules/FindWaylandpp.cmake b/cmake/modules/FindWaylandpp.cmake index 336e613..3cfc282 100644 --- a/cmake/modules/FindWaylandpp.cmake +++ b/cmake/modules/FindWaylandpp.cmake @@ -2,7 +2,7 @@ # ------------- # Finds the waylandpp library # -# This will will define the following variables:: +# This will define the following variables:: # # WAYLANDPP_FOUND - the system has waylandpp # WAYLANDPP_INCLUDE_DIRS - the waylandpp include directory @@ -10,15 +10,27 @@ # WAYLANDPP_DEFINITIONS - the waylandpp definitions # WAYLANDPP_SCANNER - path to wayland-scanner++ -pkg_check_modules(WAYLANDPP wayland-client++ wayland-egl++ wayland-cursor++) -pkg_check_modules(PC_WAYLANDPP_SCANNER wayland-scanner++) -if(WAYLANDPP_FOUND) +pkg_check_modules(PC_WAYLANDPP wayland-client++ wayland-egl++ wayland-cursor++ QUIET) +pkg_check_modules(PC_WAYLANDPP_SCANNER wayland-scanner++ QUIET) +if(PC_WAYLANDPP_FOUND) pkg_get_variable(PC_WAYLANDPP_PKGDATADIR wayland-client++ pkgdatadir) endif() if(PC_WAYLANDPP_SCANNER_FOUND) pkg_get_variable(PC_WAYLANDPP_SCANNER wayland-scanner++ wayland_scannerpp) endif() +find_path(WAYLANDPP_INCLUDE_DIR wayland-client.hpp PATHS ${PC_WAYLANDPP_INCLUDEDIR}) + +find_library(WAYLANDPP_CLIENT_LIBRARY NAMES wayland-client++ + PATHS ${PC_WAYLANDPP_LIBRARY_DIRS}) + +find_library(WAYLANDPP_CURSOR_LIBRARY NAMES wayland-cursor++ + PATHS ${PC_WAYLANDPP_LIBRARY_DIRS}) + +find_library(WAYLANDPP_EGL NAMES wayland-egl++ + PATHS ${PC_WAYLANDPP_LIBRARY_DIRS}) + + # Promote to cache variables so all code can access it set(WAYLANDPP_PROTOCOLS_DIR "${PC_WAYLANDPP_PKGDATADIR}/protocols" CACHE INTERNAL "") @@ -27,13 +39,23 @@ set(WAYLANDPP_PROTOCOLS_DIR "${PC_WAYLANDPP_PKGDATADIR}/protocols" CACHE INTERNA find_program(WAYLANDPP_SCANNER wayland-scanner++ PATHS ${PC_WAYLANDPP_SCANNER}) include (FindPackageHandleStandardArgs) -find_package_handle_standard_args (Waylandpp - REQUIRED_VARS - WAYLANDPP_FOUND - WAYLANDPP_SCANNER - VERSION_VAR - WAYLANDPP_wayland-client++_VERSION) - -set(WAYLANDPP_DEFINITIONS -DHAVE_WAYLAND=1) -# Also pass on library directories -set(WAYLANDPP_LIBRARIES ${WAYLANDPP_LDFLAGS}) +find_package_handle_standard_args(Waylandpp + REQUIRED_VARS WAYLANDPP_INCLUDE_DIR + WAYLANDPP_CLIENT_LIBRARY + WAYLANDPP_CURSOR_LIBRARY + WAYLANDPP_EGL + WAYLANDPP_SCANNER + VERSION_VAR WAYLANDPP_wayland-client++_VERSION) + +if(WAYLANDPP_FOUND) + set(WAYLANDPP_INCLUDE_DIRS ${WAYLANDPP_INCLUDE_DIR}) + set(WAYLANDPP_LIBRARIES ${WAYLANDPP_CLIENT_LIBRARY} + ${WAYLANDPP_CURSOR_LIBRARY} + ${WAYLANDPP_EGL}) + set(WAYLANDPP_DEFINITIONS -DHAVE_WAYLAND=1) +endif() + +mark_as_advanced(WAYLANDPP_INCLUDE_DIR + WAYLANDPP_CLIENT_LIBRARY + WAYLANDPP_CURSOR_LIBRARY + WAYLANDPP_EGL WAYLANDPP_SCANNER) diff --git a/cmake/modules/FindX.cmake b/cmake/modules/FindX.cmake index 19bb770..a52f86f 100644 --- a/cmake/modules/FindX.cmake +++ b/cmake/modules/FindX.cmake @@ -3,7 +3,7 @@ # ----- # Finds the X11 library # -# This will will define the following variables:: +# This will define the following variables:: # # X_FOUND - system has X11 # X_INCLUDE_DIRS - the X11 include directory diff --git a/cmake/modules/FindXRandR.cmake b/cmake/modules/FindXRandR.cmake index 9feaedc..12f3478 100644 --- a/cmake/modules/FindXRandR.cmake +++ b/cmake/modules/FindXRandR.cmake @@ -3,7 +3,7 @@ # ---------- # Finds the XRandR library # -# This will will define the following variables:: +# This will define the following variables:: # # XRANDR_FOUND - system has XRANDR # XRANDR_INCLUDE_DIRS - the XRANDR include directory diff --git a/cmake/modules/FindXSLT.cmake b/cmake/modules/FindXSLT.cmake index f7fea9e..3637214 100644 --- a/cmake/modules/FindXSLT.cmake +++ b/cmake/modules/FindXSLT.cmake @@ -3,7 +3,7 @@ # -------- # Finds the XSLT library # -# This will will define the following variables:: +# This will define the following variables:: # # XSLT_FOUND - system has XSLT # XSLT_INCLUDE_DIRS - the XSLT include directory diff --git a/cmake/modules/FindXkbcommon.cmake b/cmake/modules/FindXkbcommon.cmake index 2a84fe5..40cbb31 100644 --- a/cmake/modules/FindXkbcommon.cmake +++ b/cmake/modules/FindXkbcommon.cmake @@ -2,20 +2,39 @@ # ----------- # Finds the libxkbcommon library # -# This will will define the following variables:: +# This will define the following variables:: # # XKBCOMMON_FOUND - the system has libxkbcommon # XKBCOMMON_INCLUDE_DIRS - the libxkbcommon include directory # XKBCOMMON_LIBRARIES - the libxkbcommon libraries -# XKBCOMMON_DEFINITIONS - the libxkbcommon definitions -pkg_check_modules (XKBCOMMON xkbcommon) +if(PKG_CONFIG_FOUND) + pkg_check_modules(PC_XKBCOMMON xkbcommon QUIET) +endif() -include (FindPackageHandleStandardArgs) -find_package_handle_standard_args (Xkbcommon - REQUIRED_VARS - XKBCOMMON_FOUND) -set(XKBCOMMON_DEFINITIONS -DHAVE_XKBCOMMON=1) -set(XKBCOMMON_LIBRARIES ${XKBCOMMON_LDFLAGS}) -set(XKBCOMMON_INCLUDE_DIRS ${XKBCOMMON_INCLUDEDIR}) +find_path(XKBCOMMON_INCLUDE_DIR NAMES xkbcommon/xkbcommon.h + PATHS ${PC_XKBCOMMON_INCLUDEDIR}) +find_library(XKBCOMMON_LIBRARY NAMES xkbcommon + PATHS ${PC_XKBCOMMON_LIBDIR}) + +set(XKBCOMMON_VERSION ${PC_XKBCOMMON_VERSION}) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(Xkbcommon + REQUIRED_VARS XKBCOMMON_LIBRARY XKBCOMMON_INCLUDE_DIR + VERSION_VAR XKBCOMMON_VERSION) + +if(XKBCOMMON_FOUND) + set(XKBCOMMON_INCLUDE_DIRS ${XKBCOMMON_INCLUDE_DIR}) + set(XKBCOMMON_LIBRARIES ${XKBCOMMON_LIBRARY}) + + if(NOT TARGET XKBCOMMON::XKBCOMMON) + add_library(XKBCOMMON::XKBCOMMON UNKNOWN IMPORTED) + set_target_properties(XKBCOMMON::XKBCOMMON PROPERTIES + IMPORTED_LOCATION "${XKBCOMMON_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES "${XKBCOMMON_INCLUDE_DIR}") + endif() +endif() + +mark_as_advanced(XKBCOMMON_INCLUDE_DIR XKBCOMMON_LIBRARY) diff --git a/cmake/modules/FindYajl.cmake b/cmake/modules/FindYajl.cmake index c73a67b..d8793e6 100644 --- a/cmake/modules/FindYajl.cmake +++ b/cmake/modules/FindYajl.cmake @@ -3,7 +3,7 @@ # -------- # Finds the Yajl library # -# This will will define the following variables:: +# This will define the following variables:: # # YAJL_FOUND - system has Yajl # YAJL_INCLUDE_DIRS - Yajl include directory diff --git a/cmake/modules/FindZip.cmake b/cmake/modules/FindZip.cmake index ecac262..6ddf478 100644 --- a/cmake/modules/FindZip.cmake +++ b/cmake/modules/FindZip.cmake @@ -3,7 +3,7 @@ # ----------- # Finds the Zip library # -# This will will define the following variables:: +# This will define the following variables:: # # ZIP_FOUND - system has Zip # ZIP_INCLUDE_DIRS - the Zip include directory diff --git a/cmake/modules/Findfstrcmp.cmake b/cmake/modules/Findfstrcmp.cmake new file mode 100644 index 0000000..f0c15d3 --- /dev/null +++ b/cmake/modules/Findfstrcmp.cmake @@ -0,0 +1,80 @@ +#.rst: +# Findfstrcmp +# -------- +# Finds the fstrcmp library +# +# This will define the following variables:: +# +# FSTRCMP_FOUND - system has libfstrcmp +# FSTRCMP_INCLUDE_DIRS - the libfstrcmp include directory +# FSTRCMP_LIBRARIES - the libfstrcmp libraries +# + +if(ENABLE_INTERNAL_FSTRCMP) + include(ExternalProject) + file(STRINGS ${CMAKE_SOURCE_DIR}/tools/depends/target/libfstrcmp/Makefile VER) + string(REGEX MATCH "VERSION=[^ ]*" FSTRCMP_VER "${VER}") + list(GET FSTRCMP_VER 0 FSTRCMP_VER) + string(SUBSTRING "${FSTRCMP_VER}" 8 -1 FSTRCMP_VER) + + # allow user to override the download URL with a local tarball + # needed for offline build envs + if(FSTRCMP_URL) + get_filename_component(FSTRCMP_URL "${FSTRCMP_URL}" ABSOLUTE) + else() + set(FSTRCMP_URL http://mirrors.kodi.tv/build-deps/sources/fstrcmp-${FSTRCMP_VER}.tar.gz) + endif() + if(VERBOSE) + message(STATUS "FSTRCMPURL: ${FSTRCMP_URL}") + endif() + + set(FSTRCMP_LIBRARY ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/lib/libfstrcmp.a) + set(FSTRCMP_INCLUDE_DIR ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/include) + externalproject_add(fstrcmp + URL ${FSTRCMP_URL} + DOWNLOAD_DIR ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/download + PREFIX ${CORE_BUILD_DIR}/fstrcmp + CONFIGURE_COMMAND autoreconf -vif && ./configure --prefix ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR} + BUILD_BYPRODUCTS ${FSTRCMP_LIBRARY} + BUILD_IN_SOURCE 1) + set_target_properties(fstrcmp PROPERTIES FOLDER "External Projects") + + include(FindPackageHandleStandardArgs) + find_package_handle_standard_args(fstrcmp + REQUIRED_VARS FSTRCMP_LIBRARY FSTRCMP_INCLUDE_DIR + VERSION_VAR FSTRCMP_VER) + + set(FSTRCMP_LIBRARIES -Wl,-Bstatic ${FSTRCMP_LIBRARY} -Wl,-Bdynamic) + set(FSTRCMP_INCLUDE_DIRS ${FSTRCMP_INCLUDE_DIR}) +else() + if(PKG_CONFIG_FOUND) + pkg_check_modules(PC_FSTRCMP fstrcmp QUIET) + endif() + + find_path(FSTRCMP_INCLUDE_DIR NAMES fstrcmp.h + PATHS ${PC_FSTRCMP_INCLUDEDIR}) + + find_library(FSTRCMP_LIBRARY NAMES fstrcmp + PATHS ${PC_FSTRCMP_LIBDIR}) + + set(FSTRCMP_VERSION ${PC_FSTRCMP_VERSION}) + + include(FindPackageHandleStandardArgs) + find_package_handle_standard_args(fstrcmp + REQUIRED_VARS FSTRCMP_LIBRARY FSTRCMP_INCLUDE_DIR + VERSION_VAR FSTRCMP_VERSION) + + if(FSTRCMP_FOUND) + set(FSTRCMP_INCLUDE_DIRS ${FSTRCMP_INCLUDE_DIR}) + set(FSTRCMP_LIBRARIES ${FSTRCMP_LIBRARY}) + endif() + + if(NOT TARGET fstrcmp) + add_library(fstrcmp UNKNOWN IMPORTED) + set_target_properties(fstrcmp PROPERTIES + IMPORTED_LOCATION "${FSTRCMP_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES "${FSTRCMP_INCLUDE_DIR}") + endif() +endif() + +mark_as_advanced(FSTRCMP_INCLUDE_DIR FSTRCMP_LIBRARY) -- cgit v1.2.3