diff options
| author | manuel <manuel@mausz.at> | 2018-04-17 00:15:38 +0200 |
|---|---|---|
| committer | manuel <manuel@mausz.at> | 2018-04-17 00:15:38 +0200 |
| commit | b3d195f0188758a14875a5a2f270e4fd190a679f (patch) | |
| tree | cbe6a2d51afd7be095e29fd612107044cf1f391e /cmake/modules | |
| parent | a51f51db67e3eab80ac2ed28d403a6d77f7acc45 (diff) | |
| download | kodi-pvr-build-b3d195f0188758a14875a5a2f270e4fd190a679f.tar.gz kodi-pvr-build-b3d195f0188758a14875a5a2f270e4fd190a679f.tar.bz2 kodi-pvr-build-b3d195f0188758a14875a5a2f270e4fd190a679f.zip | |
sync with upstream
Diffstat (limited to 'cmake/modules')
| -rw-r--r-- | cmake/modules/FindAML.cmake | 14 | ||||
| -rw-r--r-- | cmake/modules/FindAlsa.cmake | 2 | ||||
| -rw-r--r-- | cmake/modules/FindCdio.cmake | 2 | ||||
| -rw-r--r-- | cmake/modules/FindCpluff.cmake | 33 | ||||
| -rw-r--r-- | cmake/modules/FindCurl.cmake | 34 | ||||
| -rw-r--r-- | cmake/modules/FindFFMPEG.cmake | 12 | ||||
| -rw-r--r-- | cmake/modules/FindLircClient.cmake | 36 | ||||
| -rw-r--r-- | cmake/modules/FindMariaDBClient.cmake | 69 | ||||
| -rw-r--r-- | cmake/modules/FindMicroHttpd.cmake | 2 | ||||
| -rw-r--r-- | cmake/modules/FindMir.cmake | 2 | ||||
| -rw-r--r-- | cmake/modules/FindSSH.cmake | 2 | ||||
| -rw-r--r-- | cmake/modules/FindWaylandProtocols.cmake | 24 | ||||
| -rw-r--r-- | cmake/modules/FindWaylandpp.cmake | 73 | ||||
| -rw-r--r-- | cmake/modules/FindXkbcommon.cmake | 26 |
14 files changed, 197 insertions, 134 deletions
diff --git a/cmake/modules/FindAML.cmake b/cmake/modules/FindAML.cmake index 5b9a859..602f5d9 100644 --- a/cmake/modules/FindAML.cmake +++ b/cmake/modules/FindAML.cmake | |||
| @@ -20,9 +20,23 @@ include(FindPackageHandleStandardArgs) | |||
| 20 | find_package_handle_standard_args(AML | 20 | find_package_handle_standard_args(AML |
| 21 | REQUIRED_VARS AML_INCLUDE_DIR) | 21 | REQUIRED_VARS AML_INCLUDE_DIR) |
| 22 | 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 | |||
| 23 | if(AML_FOUND) | 34 | if(AML_FOUND) |
| 24 | set(AML_INCLUDE_DIRS ${AML_INCLUDE_DIR}) | 35 | set(AML_INCLUDE_DIRS ${AML_INCLUDE_DIR}) |
| 25 | set(AML_DEFINITIONS -DHAS_LIBAMCODEC=1) | 36 | set(AML_DEFINITIONS -DHAS_LIBAMCODEC=1) |
| 37 | if(AML_HAS_VP9) | ||
| 38 | list(APPEND AML_DEFINITIONS -DHAS_LIBAMCODEC_VP9=1) | ||
| 39 | endif() | ||
| 26 | 40 | ||
| 27 | if(NOT TARGET AML::AML) | 41 | if(NOT TARGET AML::AML) |
| 28 | add_library(AML::AML UNKNOWN IMPORTED) | 42 | add_library(AML::AML UNKNOWN IMPORTED) |
diff --git a/cmake/modules/FindAlsa.cmake b/cmake/modules/FindAlsa.cmake index bed4faa..ae05817 100644 --- a/cmake/modules/FindAlsa.cmake +++ b/cmake/modules/FindAlsa.cmake | |||
| @@ -15,7 +15,7 @@ | |||
| 15 | # ALSA::ALSA - The Alsa library | 15 | # ALSA::ALSA - The Alsa library |
| 16 | 16 | ||
| 17 | if(PKG_CONFIG_FOUND) | 17 | if(PKG_CONFIG_FOUND) |
| 18 | pkg_check_modules(PC_ALSA alsa QUIET) | 18 | pkg_check_modules(PC_ALSA alsa>=1.0.27 QUIET) |
| 19 | endif() | 19 | endif() |
| 20 | 20 | ||
| 21 | find_path(ALSA_INCLUDE_DIR NAMES alsa/asoundlib.h | 21 | find_path(ALSA_INCLUDE_DIR NAMES alsa/asoundlib.h |
diff --git a/cmake/modules/FindCdio.cmake b/cmake/modules/FindCdio.cmake index 64f4bb8..cce7f2a 100644 --- a/cmake/modules/FindCdio.cmake +++ b/cmake/modules/FindCdio.cmake | |||
| @@ -14,7 +14,7 @@ | |||
| 14 | # CDIO::CDIO - The cdio library | 14 | # CDIO::CDIO - The cdio library |
| 15 | 15 | ||
| 16 | if(PKG_CONFIG_FOUND) | 16 | if(PKG_CONFIG_FOUND) |
| 17 | pkg_check_modules(PC_CDIO libcdio libiso9660 QUIET) | 17 | pkg_check_modules(PC_CDIO libcdio>=0.78 libiso9660 QUIET) |
| 18 | endif() | 18 | endif() |
| 19 | 19 | ||
| 20 | find_path(CDIO_INCLUDE_DIR NAMES cdio/cdio.h | 20 | find_path(CDIO_INCLUDE_DIR NAMES cdio/cdio.h |
diff --git a/cmake/modules/FindCpluff.cmake b/cmake/modules/FindCpluff.cmake index 913d7ae..9e29e17 100644 --- a/cmake/modules/FindCpluff.cmake +++ b/cmake/modules/FindCpluff.cmake | |||
| @@ -6,8 +6,11 @@ | |||
| 6 | # | 6 | # |
| 7 | # and link Kodi against the cpluff libraries. | 7 | # and link Kodi against the cpluff libraries. |
| 8 | 8 | ||
| 9 | if(NOT WIN32) | 9 | find_package(EXPAT REQUIRED) |
| 10 | 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() | ||
| 11 | string(REPLACE ";" " " defines "${CMAKE_C_FLAGS} ${SYSTEM_DEFINES} -I${EXPAT_INCLUDE_DIR}") | 14 | string(REPLACE ";" " " defines "${CMAKE_C_FLAGS} ${SYSTEM_DEFINES} -I${EXPAT_INCLUDE_DIR}") |
| 12 | get_filename_component(expat_dir ${EXPAT_LIBRARY} DIRECTORY) | 15 | get_filename_component(expat_dir ${EXPAT_LIBRARY} DIRECTORY) |
| 13 | set(ldflags "-L${expat_dir}") | 16 | set(ldflags "-L${expat_dir}") |
| @@ -31,7 +34,8 @@ if(NOT WIN32) | |||
| 31 | --host=${ARCH} | 34 | --host=${ARCH} |
| 32 | CFLAGS=${defines} | 35 | CFLAGS=${defines} |
| 33 | CPPFLAGS=${cppflags} | 36 | CPPFLAGS=${cppflags} |
| 34 | LDFLAGS=${ldflags}) | 37 | LDFLAGS=${ldflags} |
| 38 | BUILD_BYPRODUCTS <INSTALL_DIR>/lib/libcpluff.a) | ||
| 35 | ExternalProject_Add_Step(libcpluff autoreconf | 39 | ExternalProject_Add_Step(libcpluff autoreconf |
| 36 | DEPENDEES download update patch | 40 | DEPENDEES download update patch |
| 37 | DEPENDERS configure | 41 | DEPENDERS configure |
| @@ -39,24 +43,9 @@ if(NOT WIN32) | |||
| 39 | COMMAND PATH=${NATIVEPREFIX}/bin:$ENV{PATH} autoreconf -vif | 43 | COMMAND PATH=${NATIVEPREFIX}/bin:$ENV{PATH} autoreconf -vif |
| 40 | WORKING_DIRECTORY <SOURCE_DIR>) | 44 | WORKING_DIRECTORY <SOURCE_DIR>) |
| 41 | 45 | ||
| 42 | set(ldflags "${ldflags};-lexpat") | 46 | set(CPLUFF_LIBRARIES ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/cpluff/lib/libcpluff.a ${EXPAT_LIBRARIES}) |
| 43 | core_link_library(${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/cpluff/lib/libcpluff.a | ||
| 44 | system/libcpluff libcpluff extras "${ldflags}") | ||
| 45 | set(CPLUFF_INCLUDE_DIRS ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/cpluff/include) | ||
| 46 | set(CPLUFF_FOUND 1) | ||
| 47 | mark_as_advanced(CPLUFF_INCLUDE_DIRS CPLUFF_FOUND) | ||
| 48 | else() | ||
| 49 | find_path(CPLUFF_INCLUDE_DIR cpluff.h) | ||
| 50 | |||
| 51 | include(FindPackageHandleStandardArgs) | ||
| 52 | find_package_handle_standard_args(Cpluff | ||
| 53 | REQUIRED_VARS CPLUFF_INCLUDE_DIR) | ||
| 54 | |||
| 55 | if(CPLUFF_FOUND) | ||
| 56 | set(CPLUFF_INCLUDE_DIRS ${CPLUFF_INCLUDE_DIR}) | ||
| 57 | endif() | ||
| 58 | mark_as_advanced(CPLUFF_INCLUDE_DIRS CPLUFF_FOUND) | ||
| 59 | |||
| 60 | add_custom_target(libcpluff) | ||
| 61 | endif() | 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) | ||
| 62 | set_target_properties(libcpluff PROPERTIES FOLDER "External Projects") | 51 | set_target_properties(libcpluff PROPERTIES FOLDER "External Projects") |
diff --git a/cmake/modules/FindCurl.cmake b/cmake/modules/FindCurl.cmake index d0759a6..17c1f01 100644 --- a/cmake/modules/FindCurl.cmake +++ b/cmake/modules/FindCurl.cmake | |||
| @@ -34,40 +34,6 @@ if(CURL_FOUND) | |||
| 34 | set(CURL_INCLUDE_DIRS ${CURL_INCLUDE_DIR}) | 34 | set(CURL_INCLUDE_DIRS ${CURL_INCLUDE_DIR}) |
| 35 | set(CURL_LIBRARIES ${CURL_LIBRARY}) | 35 | set(CURL_LIBRARIES ${CURL_LIBRARY}) |
| 36 | 36 | ||
| 37 | # Check whether OpenSSL inside libcurl is static. | ||
| 38 | if(UNIX) | ||
| 39 | if(NOT DEFINED HAS_CURL_STATIC) | ||
| 40 | get_filename_component(CURL_LIBRARY_DIR ${CURL_LIBRARY} DIRECTORY) | ||
| 41 | find_soname(CURL REQUIRED) | ||
| 42 | |||
| 43 | if(APPLE) | ||
| 44 | set(libchecker nm) | ||
| 45 | set(searchpattern "T [_]?CRYPTO_set_locking_call") | ||
| 46 | else() | ||
| 47 | set(libchecker readelf -s) | ||
| 48 | set(searchpattern "CRYPTO_set_locking_call") | ||
| 49 | endif() | ||
| 50 | execute_process( | ||
| 51 | COMMAND ${libchecker} ${CURL_LIBRARY_DIR}/${CURL_SONAME} | ||
| 52 | COMMAND grep -Eq ${searchpattern} | ||
| 53 | RESULT_VARIABLE HAS_CURL_STATIC) | ||
| 54 | unset(libchecker) | ||
| 55 | unset(searchpattern) | ||
| 56 | if(HAS_CURL_STATIC EQUAL 0) | ||
| 57 | set(HAS_CURL_STATIC TRUE) | ||
| 58 | else() | ||
| 59 | set(HAS_CURL_STATIC FALSE) | ||
| 60 | endif() | ||
| 61 | set(HAS_CURL_STATIC ${HAS_CURL_STATIC} CACHE INTERNAL | ||
| 62 | "OpenSSL is statically linked into Curl") | ||
| 63 | message(STATUS "OpenSSL is statically linked into Curl: ${HAS_CURL_STATIC}") | ||
| 64 | endif() | ||
| 65 | endif() | ||
| 66 | |||
| 67 | if(HAS_CURL_STATIC) | ||
| 68 | set(CURL_DEFINITIONS -DHAS_CURL_STATIC=1) | ||
| 69 | endif() | ||
| 70 | |||
| 71 | if(NOT TARGET Curl::Curl) | 37 | if(NOT TARGET Curl::Curl) |
| 72 | add_library(Curl::Curl UNKNOWN IMPORTED) | 38 | add_library(Curl::Curl UNKNOWN IMPORTED) |
| 73 | set_target_properties(Curl::Curl PROPERTIES | 39 | set_target_properties(Curl::Curl PROPERTIES |
diff --git a/cmake/modules/FindFFMPEG.cmake b/cmake/modules/FindFFMPEG.cmake index 689cf28..e2fbe8d 100644 --- a/cmake/modules/FindFFMPEG.cmake +++ b/cmake/modules/FindFFMPEG.cmake | |||
| @@ -67,7 +67,6 @@ endif() | |||
| 67 | # external FFMPEG | 67 | # external FFMPEG |
| 68 | if(NOT ENABLE_INTERNAL_FFMPEG OR KODI_DEPENDSBUILD) | 68 | if(NOT ENABLE_INTERNAL_FFMPEG OR KODI_DEPENDSBUILD) |
| 69 | if(FFMPEG_PATH) | 69 | if(FFMPEG_PATH) |
| 70 | set(ENV{PKG_CONFIG_PATH} "${FFMPEG_PATH}/lib/pkgconfig") | ||
| 71 | list(APPEND CMAKE_PREFIX_PATH ${FFMPEG_PATH}) | 70 | list(APPEND CMAKE_PREFIX_PATH ${FFMPEG_PATH}) |
| 72 | endif() | 71 | endif() |
| 73 | 72 | ||
| @@ -236,8 +235,6 @@ if(NOT FFMPEG_FOUND) | |||
| 236 | -DCROSSCOMPILING=${CMAKE_CROSSCOMPILING} | 235 | -DCROSSCOMPILING=${CMAKE_CROSSCOMPILING} |
| 237 | -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} | 236 | -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} |
| 238 | -DOS=${OS} | 237 | -DOS=${OS} |
| 239 | -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} | ||
| 240 | -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} | ||
| 241 | -DCMAKE_AR=${CMAKE_AR}) | 238 | -DCMAKE_AR=${CMAKE_AR}) |
| 242 | endif() | 239 | endif() |
| 243 | 240 | ||
| @@ -253,6 +250,9 @@ if(NOT FFMPEG_FOUND) | |||
| 253 | -DCORE_PLATFORM_NAME=${CORE_PLATFORM_NAME_LC} | 250 | -DCORE_PLATFORM_NAME=${CORE_PLATFORM_NAME_LC} |
| 254 | -DCPU=${CPU} | 251 | -DCPU=${CPU} |
| 255 | -DENABLE_NEON=${ENABLE_NEON} | 252 | -DENABLE_NEON=${ENABLE_NEON} |
| 253 | -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} | ||
| 254 | -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} | ||
| 255 | -DENABLE_CCACHE=${ENABLE_CCACHE} | ||
| 256 | -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS} | 256 | -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS} |
| 257 | -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS} | 257 | -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS} |
| 258 | -DCMAKE_EXE_LINKER_FLAGS=${CMAKE_EXE_LINKER_FLAGS} | 258 | -DCMAKE_EXE_LINKER_FLAGS=${CMAKE_EXE_LINKER_FLAGS} |
| @@ -264,8 +264,12 @@ if(NOT FFMPEG_FOUND) | |||
| 264 | ${CMAKE_SOURCE_DIR}/tools/depends/target/ffmpeg/FindGnuTls.cmake | 264 | ${CMAKE_SOURCE_DIR}/tools/depends/target/ffmpeg/FindGnuTls.cmake |
| 265 | <SOURCE_DIR>) | 265 | <SOURCE_DIR>) |
| 266 | 266 | ||
| 267 | find_program(BASH_COMMAND bash) | ||
| 268 | if(NOT BASH_COMMAND) | ||
| 269 | message(FATAL_ERROR "Internal FFmpeg requires bash.") | ||
| 270 | endif() | ||
| 267 | file(WRITE ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/ffmpeg/ffmpeg-link-wrapper | 271 | file(WRITE ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/ffmpeg/ffmpeg-link-wrapper |
| 268 | "#!/bin/bash | 272 | "#!${BASH_COMMAND} |
| 269 | if [[ $@ == *${APP_NAME_LC}.bin* || $@ == *${APP_NAME_LC}${APP_BINARY_SUFFIX}* || $@ == *${APP_NAME_LC}.so* || $@ == *${APP_NAME_LC}-test* ]] | 273 | if [[ $@ == *${APP_NAME_LC}.bin* || $@ == *${APP_NAME_LC}${APP_BINARY_SUFFIX}* || $@ == *${APP_NAME_LC}.so* || $@ == *${APP_NAME_LC}-test* ]] |
| 270 | then | 274 | then |
| 271 | avformat=`PKG_CONFIG_PATH=${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/lib/pkgconfig ${PKG_CONFIG_EXECUTABLE} --libs --static libavcodec` | 275 | avformat=`PKG_CONFIG_PATH=${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/lib/pkgconfig ${PKG_CONFIG_EXECUTABLE} --libs --static libavcodec` |
diff --git a/cmake/modules/FindLircClient.cmake b/cmake/modules/FindLircClient.cmake new file mode 100644 index 0000000..528c38e --- /dev/null +++ b/cmake/modules/FindLircClient.cmake | |||
| @@ -0,0 +1,36 @@ | |||
| 1 | # FindLircClient | ||
| 2 | # ----------- | ||
| 3 | # Finds the liblirc_client library | ||
| 4 | # | ||
| 5 | # This will will define the following variables:: | ||
| 6 | # | ||
| 7 | # LIRCCLIENT_FOUND - if false, do not try to link to lirc_client | ||
| 8 | # LIRCCLIENT_INCLUDE_DIRS - where to find lirc/lirc_client.h | ||
| 9 | # LIRCCLIENT_LIBRARYS - the library to link against | ||
| 10 | # LIRCCLIENT_DEFINITIONS - the lirc definitions | ||
| 11 | |||
| 12 | if(PKG_CONFIG_FOUND) | ||
| 13 | pkg_check_modules(PC_LIRC lirc QUIET) | ||
| 14 | endif() | ||
| 15 | |||
| 16 | find_path(LIRCCLIENT_INCLUDE_DIR lirc/lirc_client.h PATHS ${PC_LIRC_INCLUDEDIR}) | ||
| 17 | find_library(LIRCCLIENT_LIBRARY lirc_client PATHS ${PC_LIRC_LIBDIR}) | ||
| 18 | |||
| 19 | include(FindPackageHandleStandardArgs) | ||
| 20 | find_package_handle_standard_args(LircClient | ||
| 21 | REQUIRED_VARS LIRCCLIENT_LIBRARY LIRCCLIENT_INCLUDE_DIR) | ||
| 22 | |||
| 23 | if(LIRCCLIENT_FOUND) | ||
| 24 | set(LIRCCLIENT_LIBRARIES ${LIRCCLIENT_LIBRARY}) | ||
| 25 | set(LIRCCLIENT_INCLUDE_DIRS ${LIRCCLIENT_INCLUDE_DIR}) | ||
| 26 | set(LIRCCLIENT_DEFINITIONS -DHAS_LIRC=1) | ||
| 27 | |||
| 28 | if(NOT TARGET LIRCCLIENT::LIRCCLIENT) | ||
| 29 | add_library(LIRCCLIENT::LIRCCLIENT UNKNOWN IMPORTED) | ||
| 30 | set_target_properties(LIRCCLIENT::LIRCCLIENT PROPERTIES | ||
| 31 | IMPORTED_LOCATION "${LIRCCLIENT_LIBRARYS}" | ||
| 32 | INTERFACE_INCLUDE_DIRECTORIES "${LIRCCLIENT_INCLUDE_DIRS}") | ||
| 33 | endif() | ||
| 34 | endif() | ||
| 35 | |||
| 36 | mark_as_advanced(LIRCCLIENT_LIBRARY LIRCCLIENT_INCLUDE_DIR) \ No newline at end of file | ||
diff --git a/cmake/modules/FindMariaDBClient.cmake b/cmake/modules/FindMariaDBClient.cmake new file mode 100644 index 0000000..1e5e736 --- /dev/null +++ b/cmake/modules/FindMariaDBClient.cmake | |||
| @@ -0,0 +1,69 @@ | |||
| 1 | #.rst: | ||
| 2 | # FindMariaDBClient | ||
| 3 | # --------------- | ||
| 4 | # Finds the MariaDBClient library | ||
| 5 | # | ||
| 6 | # This will will define the following variables:: | ||
| 7 | # | ||
| 8 | # MARIADBCLIENT_FOUND - system has MariaDBClient | ||
| 9 | # MARIADBCLIENT_INCLUDE_DIRS - the MariaDBClient include directory | ||
| 10 | # MARIADBCLIENT_LIBRARIES - the MariaDBClient libraries | ||
| 11 | # MARIADBCLIENT_DEFINITIONS - the MariaDBClient compile definitions | ||
| 12 | # | ||
| 13 | # and the following imported targets:: | ||
| 14 | # | ||
| 15 | # MariaDBClient::MariaDBClient - The MariaDBClient library | ||
| 16 | |||
| 17 | # Don't find system wide installed version on Windows | ||
| 18 | if(WIN32) | ||
| 19 | set(EXTRA_FIND_ARGS NO_SYSTEM_ENVIRONMENT_PATH) | ||
| 20 | else() | ||
| 21 | set(EXTRA_FIND_ARGS) | ||
| 22 | endif() | ||
| 23 | |||
| 24 | find_path(MARIADBCLIENT_INCLUDE_DIR NAMES mariadb/mysql.h mariadb/server/mysql.h) | ||
| 25 | find_library(MARIADBCLIENT_LIBRARY_RELEASE NAMES mariadbclient libmariadb | ||
| 26 | PATH_SUFFIXES mariadb | ||
| 27 | ${EXTRA_FIND_ARGS}) | ||
| 28 | find_library(MARIADBCLIENT_LIBRARY_DEBUG NAMES mariadbclient libmariadb | ||
| 29 | PATH_SUFFIXES mariadb | ||
| 30 | ${EXTRA_FIND_ARGS}) | ||
| 31 | |||
| 32 | if(MARIADBCLIENT_INCLUDE_DIR AND EXISTS "${MARIADBCLIENT_INCLUDE_DIR}/mariadb/mariadb_version.h") | ||
| 33 | file(STRINGS "${MARIADBCLIENT_INCLUDE_DIR}/mariadb/mariadb_version.h" mariadb_version_str REGEX "^#define[\t ]+MARIADB_CLIENT_VERSION_STR[\t ]+\".*\".*") | ||
| 34 | string(REGEX REPLACE "^#define[\t ]+MARIADB_CLIENT_VERSION_STR[\t ]+\"([^\"]+)\".*" "\\1" MARIADBCLIENT_VERSION_STRING "${mariadb_version_str}") | ||
| 35 | unset(mariadb_version_str) | ||
| 36 | endif() | ||
| 37 | |||
| 38 | include(SelectLibraryConfigurations) | ||
| 39 | select_library_configurations(MARIADBCLIENT) | ||
| 40 | |||
| 41 | include(FindPackageHandleStandardArgs) | ||
| 42 | find_package_handle_standard_args(MariaDBClient | ||
| 43 | REQUIRED_VARS MARIADBCLIENT_LIBRARY MARIADBCLIENT_INCLUDE_DIR | ||
| 44 | VERSION_VAR MARIADBCLIENT_VERSION_STRING) | ||
| 45 | |||
| 46 | if(MARIADBCLIENT_FOUND) | ||
| 47 | set(MARIADBCLIENT_LIBRARIES ${MARIADBCLIENT_LIBRARY}) | ||
| 48 | set(MARIADBCLIENT_INCLUDE_DIRS ${MARIADBCLIENT_INCLUDE_DIR}) | ||
| 49 | set(MARIADBCLIENT_DEFINITIONS -DHAS_MARIADB=1) | ||
| 50 | |||
| 51 | if(NOT TARGET MariaDBClient::MariaDBClient) | ||
| 52 | add_library(MariaDBClient::MariaDBClient UNKNOWN IMPORTED) | ||
| 53 | if(MARIADBCLIENT_LIBRARY_RELEASE) | ||
| 54 | set_target_properties(MariaDBClient::MariaDBClient PROPERTIES | ||
| 55 | IMPORTED_CONFIGURATIONS RELEASE | ||
| 56 | IMPORTED_LOCATION "${MARIADBCLIENT_LIBRARY_RELEASE}") | ||
| 57 | endif() | ||
| 58 | if(MARIADBCLIENT_LIBRARY_DEBUG) | ||
| 59 | set_target_properties(MariaDBClient::MariaDBClient PROPERTIES | ||
| 60 | IMPORTED_CONFIGURATIONS DEBUG | ||
| 61 | IMPORTED_LOCATION "${MARIADBCLIENT_LIBRARY_DEBUG}") | ||
| 62 | endif() | ||
| 63 | set_target_properties(MariaDBClient::MariaDBClient PROPERTIES | ||
| 64 | INTERFACE_INCLUDE_DIRECTORIES "${MARIADBCLIENT_INCLUDE_DIR}" | ||
| 65 | INTERFACE_COMPILE_DEFINITIONS HAS_MARIADB=1) | ||
| 66 | endif() | ||
| 67 | endif() | ||
| 68 | |||
| 69 | mark_as_advanced(MARIADBCLIENT_INCLUDE_DIR MARIADBCLIENT_LIBRARY) | ||
diff --git a/cmake/modules/FindMicroHttpd.cmake b/cmake/modules/FindMicroHttpd.cmake index 232f8e5..d04878c 100644 --- a/cmake/modules/FindMicroHttpd.cmake +++ b/cmake/modules/FindMicroHttpd.cmake | |||
| @@ -15,7 +15,7 @@ | |||
| 15 | # MicroHttpd::MicroHttpd - The MicroHttpd library | 15 | # MicroHttpd::MicroHttpd - The MicroHttpd library |
| 16 | 16 | ||
| 17 | if(PKG_CONFIG_FOUND) | 17 | if(PKG_CONFIG_FOUND) |
| 18 | pkg_check_modules(PC_MICROHTTPD libmicrohttpd>=0.4 QUIET) | 18 | pkg_check_modules(PC_MICROHTTPD libmicrohttpd>=0.9.40 QUIET) |
| 19 | endif() | 19 | endif() |
| 20 | 20 | ||
| 21 | find_path(MICROHTTPD_INCLUDE_DIR NAMES microhttpd.h | 21 | find_path(MICROHTTPD_INCLUDE_DIR NAMES microhttpd.h |
diff --git a/cmake/modules/FindMir.cmake b/cmake/modules/FindMir.cmake index 47a441c..e66ff02 100644 --- a/cmake/modules/FindMir.cmake +++ b/cmake/modules/FindMir.cmake | |||
| @@ -21,7 +21,7 @@ find_library(MIR_LIBRARY NAMES mirclient | |||
| 21 | PATHS ${PC_MIR_LIBRARIES} ${PC_MIR_LIBRARY_DIRS}) | 21 | PATHS ${PC_MIR_LIBRARIES} ${PC_MIR_LIBRARY_DIRS}) |
| 22 | 22 | ||
| 23 | include (FindPackageHandleStandardArgs) | 23 | include (FindPackageHandleStandardArgs) |
| 24 | find_package_handle_standard_args (MIR | 24 | find_package_handle_standard_args (Mir |
| 25 | REQUIRED_VARS MIR_LIBRARY MIR_INCLUDE_DIR) | 25 | REQUIRED_VARS MIR_LIBRARY MIR_INCLUDE_DIR) |
| 26 | 26 | ||
| 27 | if (MIR_FOUND) | 27 | if (MIR_FOUND) |
diff --git a/cmake/modules/FindSSH.cmake b/cmake/modules/FindSSH.cmake index ee65210..bf3837e 100644 --- a/cmake/modules/FindSSH.cmake +++ b/cmake/modules/FindSSH.cmake | |||
| @@ -15,7 +15,7 @@ | |||
| 15 | # SSH::SSH - The SSH library | 15 | # SSH::SSH - The SSH library |
| 16 | 16 | ||
| 17 | if(PKG_CONFIG_FOUND) | 17 | if(PKG_CONFIG_FOUND) |
| 18 | pkg_check_modules(PC_SSH libssh QUIET) | 18 | pkg_check_modules(PC_SSH libssh>=0.6 QUIET) |
| 19 | endif() | 19 | endif() |
| 20 | 20 | ||
| 21 | find_path(SSH_INCLUDE_DIR NAMES libssh/libssh.h | 21 | find_path(SSH_INCLUDE_DIR NAMES libssh/libssh.h |
diff --git a/cmake/modules/FindWaylandProtocols.cmake b/cmake/modules/FindWaylandProtocols.cmake new file mode 100644 index 0000000..0b96ff0 --- /dev/null +++ b/cmake/modules/FindWaylandProtocols.cmake | |||
| @@ -0,0 +1,24 @@ | |||
| 1 | # FindWaylandProtocols | ||
| 2 | # -------------------- | ||
| 3 | # Find wayland-protocols | ||
| 4 | # | ||
| 5 | # This will will define the following variables:: | ||
| 6 | # | ||
| 7 | # WAYLAND_PROTOCOLS_DIR - directory containing the additional Wayland protocols | ||
| 8 | # from the wayland-protocols package | ||
| 9 | |||
| 10 | pkg_check_modules(PC_WAYLAND_PROTOCOLS wayland-protocols) | ||
| 11 | if(PC_WAYLAND_PROTOCOLS_FOUND) | ||
| 12 | pkg_get_variable(WAYLAND_PROTOCOLS_DIR wayland-protocols pkgdatadir) | ||
| 13 | endif() | ||
| 14 | |||
| 15 | # Promote to cache variables so all code can access it | ||
| 16 | set(WAYLAND_PROTOCOLS_DIR ${WAYLAND_PROTOCOLS_DIR} CACHE INTERNAL "") | ||
| 17 | |||
| 18 | include(FindPackageHandleStandardArgs) | ||
| 19 | find_package_handle_standard_args(WaylandProtocols | ||
| 20 | REQUIRED_VARS | ||
| 21 | PC_WAYLAND_PROTOCOLS_FOUND | ||
| 22 | WAYLAND_PROTOCOLS_DIR | ||
| 23 | VERSION_VAR | ||
| 24 | PC_WAYLAND_PROTOCOLS_VERSION) | ||
diff --git a/cmake/modules/FindWaylandpp.cmake b/cmake/modules/FindWaylandpp.cmake index 8a1cd74..336e613 100644 --- a/cmake/modules/FindWaylandpp.cmake +++ b/cmake/modules/FindWaylandpp.cmake | |||
| @@ -1,64 +1,39 @@ | |||
| 1 | # FindWaylandpp | 1 | # FindWaylandpp |
| 2 | # ----------- | 2 | # ------------- |
| 3 | # Finds the waylandpp library | 3 | # Finds the waylandpp library |
| 4 | # | 4 | # |
| 5 | # This will will define the following variables:: | 5 | # This will will define the following variables:: |
| 6 | # | 6 | # |
| 7 | # WAYLANDPP_FOUND - the system has Wayland | 7 | # WAYLANDPP_FOUND - the system has waylandpp |
| 8 | # WAYLANDPP_INCLUDE_DIRS - the Wayland include directory | 8 | # WAYLANDPP_INCLUDE_DIRS - the waylandpp include directory |
| 9 | # WAYLANDPP_LIBRARIES - the Wayland libraries | 9 | # WAYLANDPP_LIBRARIES - the waylandpp libraries |
| 10 | # WAYLANDPP_DEFINITIONS - the Wayland definitions | 10 | # WAYLANDPP_DEFINITIONS - the waylandpp definitions |
| 11 | 11 | # WAYLANDPP_SCANNER - path to wayland-scanner++ | |
| 12 | 12 | ||
| 13 | if(PKG_CONFIG_FOUND) | 13 | pkg_check_modules(WAYLANDPP wayland-client++ wayland-egl++ wayland-cursor++) |
| 14 | pkg_check_modules(PC_WAYLANDPP wayland-client++>=0.1 wayland-egl++ wayland-cursor++ wayland-scanner++ QUIET) | 14 | pkg_check_modules(PC_WAYLANDPP_SCANNER wayland-scanner++) |
| 15 | pkg_check_modules(PC_WAYLAND_PROTOCOLS wayland-protocols>=1.7 QUIET) | 15 | if(WAYLANDPP_FOUND) |
| 16 | # TODO: Remove check when CMake minimum version is bumped globally | 16 | pkg_get_variable(PC_WAYLANDPP_PKGDATADIR wayland-client++ pkgdatadir) |
| 17 | if(CMAKE_VERSION VERSION_EQUAL 3.4.0 OR CMAKE_VERSION VERSION_GREATER 3.4.0) | 17 | endif() |
| 18 | if(PC_WAYLANDPP_FOUND) | 18 | if(PC_WAYLANDPP_SCANNER_FOUND) |
| 19 | pkg_get_variable(PC_WAYLANDPP_SCANNER wayland-scanner++ wayland_scannerpp) | 19 | pkg_get_variable(PC_WAYLANDPP_SCANNER wayland-scanner++ wayland_scannerpp) |
| 20 | endif() | ||
| 21 | if(PC_WAYLAND_PROTOCOLS_FOUND) | ||
| 22 | pkg_get_variable(PC_WAYLAND_PROTOCOLS_DIR wayland-protocols pkgdatadir) | ||
| 23 | endif() | ||
| 24 | endif() | ||
| 25 | endif() | 20 | endif() |
| 26 | 21 | ||
| 27 | find_path(WAYLANDPP_INCLUDE_DIR NAMES wayland-client.hpp | 22 | # Promote to cache variables so all code can access it |
| 28 | PATHS ${PC_WAYLANDPP_INCLUDE_DIRS}) | 23 | set(WAYLANDPP_PROTOCOLS_DIR "${PC_WAYLANDPP_PKGDATADIR}/protocols" CACHE INTERNAL "") |
| 29 | |||
| 30 | find_library(WAYLANDPP_CLIENT_LIBRARY NAMES wayland-client++ | ||
| 31 | PATHS ${PC_WAYLANDPP_LIBRARIES} ${PC_WAYLANDPP_LIBRARY_DIRS}) | ||
| 32 | |||
| 33 | find_library(WAYLANDPP_CURSOR_LIBRARY NAMES wayland-cursor++ | ||
| 34 | PATHS ${PC_WAYLANDPP_LIBRARIES} ${PC_WAYLANDPP_LIBRARY_DIRS}) | ||
| 35 | |||
| 36 | find_library(WAYLANDPP_EGL_LIBRARY NAMES wayland-egl++ | ||
| 37 | PATHS ${PC_WAYLANDPP_LIBRARIES} ${PC_WAYLANDPP_LIBRARY_DIRS}) | ||
| 38 | |||
| 39 | find_program(WAYLANDPP_SCANNER NAMES wayland-scanner++ | ||
| 40 | PATHS ${PC_WAYLANDPP_SCANNER}) | ||
| 41 | 24 | ||
| 42 | find_path(WAYLAND_PROTOCOLS_DIR NAMES unstable/xdg-shell/xdg-shell-unstable-v6.xml | 25 | # wayland-scanner++ is from native/host system in case of cross-compilation, so |
| 43 | PATHS ${PC_WAYLAND_PROTOCOLS_DIR} | 26 | # it's ok if we don't find it with pkgconfig |
| 44 | DOC "Directory containing additional Wayland protocols") | 27 | find_program(WAYLANDPP_SCANNER wayland-scanner++ PATHS ${PC_WAYLANDPP_SCANNER}) |
| 45 | 28 | ||
| 46 | include (FindPackageHandleStandardArgs) | 29 | include (FindPackageHandleStandardArgs) |
| 47 | find_package_handle_standard_args (Waylandpp | 30 | find_package_handle_standard_args (Waylandpp |
| 48 | REQUIRED_VARS | 31 | REQUIRED_VARS |
| 49 | WAYLANDPP_INCLUDE_DIR | 32 | WAYLANDPP_FOUND |
| 50 | WAYLANDPP_CLIENT_LIBRARY | ||
| 51 | WAYLANDPP_CURSOR_LIBRARY | ||
| 52 | WAYLANDPP_EGL_LIBRARY | ||
| 53 | WAYLANDPP_SCANNER | 33 | WAYLANDPP_SCANNER |
| 54 | WAYLAND_PROTOCOLS_DIR | ||
| 55 | VERSION_VAR | 34 | VERSION_VAR |
| 56 | PC_WAYLANDPP_wayland-client++_VERSION) | 35 | WAYLANDPP_wayland-client++_VERSION) |
| 57 | |||
| 58 | if (WAYLANDPP_FOUND) | ||
| 59 | set(WAYLANDPP_LIBRARIES ${WAYLANDPP_CLIENT_LIBRARY} ${WAYLANDPP_CURSOR_LIBRARY} ${WAYLANDPP_EGL_LIBRARY}) | ||
| 60 | set(WAYLANDPP_INCLUDE_DIRS ${PC_WAYLANDPP_INCLUDE_DIRS}) | ||
| 61 | set(WAYLANDPP_DEFINITIONS -DHAVE_WAYLAND=1) | ||
| 62 | endif() | ||
| 63 | 36 | ||
| 64 | mark_as_advanced (WAYLANDPP_CLIENT_LIBRARY WAYLANDPP_CURSOR_LIBRARY WAYLANDPP_EGL_LIBRARY WAYLANDPP_INCLUDE_DIR) | 37 | set(WAYLANDPP_DEFINITIONS -DHAVE_WAYLAND=1) |
| 38 | # Also pass on library directories | ||
| 39 | set(WAYLANDPP_LIBRARIES ${WAYLANDPP_LDFLAGS}) | ||
diff --git a/cmake/modules/FindXkbcommon.cmake b/cmake/modules/FindXkbcommon.cmake index 88c6121..2a84fe5 100644 --- a/cmake/modules/FindXkbcommon.cmake +++ b/cmake/modules/FindXkbcommon.cmake | |||
| @@ -9,27 +9,13 @@ | |||
| 9 | # XKBCOMMON_LIBRARIES - the libxkbcommon libraries | 9 | # XKBCOMMON_LIBRARIES - the libxkbcommon libraries |
| 10 | # XKBCOMMON_DEFINITIONS - the libxkbcommon definitions | 10 | # XKBCOMMON_DEFINITIONS - the libxkbcommon definitions |
| 11 | 11 | ||
| 12 | 12 | pkg_check_modules (XKBCOMMON xkbcommon) | |
| 13 | if(PKG_CONFIG_FOUND) | ||
| 14 | pkg_check_modules (PC_XKBCOMMON xkbcommon QUIET) | ||
| 15 | endif() | ||
| 16 | |||
| 17 | find_path(XKBCOMMON_INCLUDE_DIR NAMES xkbcommon/xkbcommon.h | ||
| 18 | PATHS ${PC_XKBCOMMON_INCLUDE_DIRS}) | ||
| 19 | |||
| 20 | find_library(XKBCOMMON_LIBRARY NAMES xkbcommon | ||
| 21 | PATHS ${PC_XKBCOMMON_LIBRARIES} ${PC_XKBCOMMON_LIBRARY_DIRS}) | ||
| 22 | 13 | ||
| 23 | include (FindPackageHandleStandardArgs) | 14 | include (FindPackageHandleStandardArgs) |
| 24 | find_package_handle_standard_args (XKBCOMMON | 15 | find_package_handle_standard_args (Xkbcommon |
| 25 | REQUIRED_VARS | 16 | REQUIRED_VARS |
| 26 | XKBCOMMON_INCLUDE_DIR | 17 | XKBCOMMON_FOUND) |
| 27 | XKBCOMMON_LIBRARY) | ||
| 28 | |||
| 29 | if (XKBCOMMON_FOUND) | ||
| 30 | set(XKBCOMMON_LIBRARIES ${XKBCOMMON_LIBRARY}) | ||
| 31 | set(XKBCOMMON_INCLUDE_DIRS ${PC_XKBCOMMON_INCLUDE_DIRS}) | ||
| 32 | set(XKBCOMMON_DEFINITIONS -DHAVE_XKBCOMMON=1) | ||
| 33 | endif() | ||
| 34 | 18 | ||
| 35 | mark_as_advanced (XKBCOMMON_LIBRARY XKBCOMMON_INCLUDE_DIR) \ No newline at end of file | 19 | set(XKBCOMMON_DEFINITIONS -DHAVE_XKBCOMMON=1) |
| 20 | set(XKBCOMMON_LIBRARIES ${XKBCOMMON_LDFLAGS}) | ||
| 21 | set(XKBCOMMON_INCLUDE_DIRS ${XKBCOMMON_INCLUDEDIR}) | ||
