diff options
| author | manuel <manuel@mausz.at> | 2017-06-04 16:57:49 +0200 |
|---|---|---|
| committer | manuel <manuel@mausz.at> | 2017-06-04 16:57:49 +0200 |
| commit | f44ecaa4f27e7538ddcad66d40e543bffa2d2d86 (patch) | |
| tree | d8de60fc7e17edeb6f0921726c038ee54b281445 /project/cmake/modules | |
| parent | ae08c8b7221bc965ac40d70e53fc8fcddb050c46 (diff) | |
| download | kodi-pvr-build-f44ecaa4f27e7538ddcad66d40e543bffa2d2d86.tar.gz kodi-pvr-build-f44ecaa4f27e7538ddcad66d40e543bffa2d2d86.tar.bz2 kodi-pvr-build-f44ecaa4f27e7538ddcad66d40e543bffa2d2d86.zip | |
sync with upstream
Diffstat (limited to 'project/cmake/modules')
61 files changed, 0 insertions, 3617 deletions
diff --git a/project/cmake/modules/FindAML.cmake b/project/cmake/modules/FindAML.cmake deleted file mode 100644 index 5b9a859..0000000 --- a/project/cmake/modules/FindAML.cmake +++ /dev/null | |||
| @@ -1,35 +0,0 @@ | |||
| 1 | #.rst: | ||
| 2 | # FindAML | ||
| 3 | # ------- | ||
| 4 | # Finds the AML codec | ||
| 5 | # | ||
| 6 | # This will 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 | if(AML_FOUND) | ||
| 24 | set(AML_INCLUDE_DIRS ${AML_INCLUDE_DIR}) | ||
| 25 | set(AML_DEFINITIONS -DHAS_LIBAMCODEC=1) | ||
| 26 | |||
| 27 | if(NOT TARGET AML::AML) | ||
| 28 | add_library(AML::AML UNKNOWN IMPORTED) | ||
| 29 | set_target_properties(AML::AML PROPERTIES | ||
| 30 | INTERFACE_INCLUDE_DIRECTORIES "${AML_INCLUDE_DIR}" | ||
| 31 | INTERFACE_COMPILE_DEFINITIONS HAS_LIBAMCODEC=1) | ||
| 32 | endif() | ||
| 33 | endif() | ||
| 34 | |||
| 35 | mark_as_advanced(AMLCODEC_INCLUDE_DIR) | ||
diff --git a/project/cmake/modules/FindASS.cmake b/project/cmake/modules/FindASS.cmake deleted file mode 100644 index 2d592fa..0000000 --- a/project/cmake/modules/FindASS.cmake +++ /dev/null | |||
| @@ -1,44 +0,0 @@ | |||
| 1 | #.rst: | ||
| 2 | # FindASS | ||
| 3 | # ------- | ||
| 4 | # Finds the ASS library | ||
| 5 | # | ||
| 6 | # This will will define the following variables:: | ||
| 7 | # | ||
| 8 | # ASS_FOUND - system has ASS | ||
| 9 | # ASS_INCLUDE_DIRS - the ASS include directory | ||
| 10 | # ASS_LIBRARIES - the ASS libraries | ||
| 11 | # | ||
| 12 | # and the following imported targets:: | ||
| 13 | # | ||
| 14 | # ASS::ASS - The ASS library | ||
| 15 | |||
| 16 | if(PKG_CONFIG_FOUND) | ||
| 17 | pkg_check_modules(PC_ASS libass QUIET) | ||
| 18 | endif() | ||
| 19 | |||
| 20 | find_path(ASS_INCLUDE_DIR NAMES ass/ass.h | ||
| 21 | PATHS ${PC_ASS_INCLUDEDIR}) | ||
| 22 | find_library(ASS_LIBRARY NAMES ass libass | ||
| 23 | PATHS ${PC_ASS_LIBDIR}) | ||
| 24 | |||
| 25 | set(ASS_VERSION ${PC_ASS_VERSION}) | ||
| 26 | |||
| 27 | include(FindPackageHandleStandardArgs) | ||
| 28 | find_package_handle_standard_args(ASS | ||
| 29 | REQUIRED_VARS ASS_LIBRARY ASS_INCLUDE_DIR | ||
| 30 | VERSION_VAR ASS_VERSION) | ||
| 31 | |||
| 32 | if(ASS_FOUND) | ||
| 33 | set(ASS_LIBRARIES ${ASS_LIBRARY}) | ||
| 34 | set(ASS_INCLUDE_DIRS ${ASS_INCLUDE_DIR}) | ||
| 35 | |||
| 36 | if(NOT TARGET ASS::ASS) | ||
| 37 | add_library(ASS::ASS UNKNOWN IMPORTED) | ||
| 38 | set_target_properties(ASS::ASS PROPERTIES | ||
| 39 | IMPORTED_LOCATION "${ASS_LIBRARY}" | ||
| 40 | INTERFACE_INCLUDE_DIRECTORIES "${ASS_INCLUDE_DIR}") | ||
| 41 | endif() | ||
| 42 | endif() | ||
| 43 | |||
| 44 | mark_as_advanced(ASS_INCLUDE_DIR ASS_LIBRARY) | ||
diff --git a/project/cmake/modules/FindAlsa.cmake b/project/cmake/modules/FindAlsa.cmake deleted file mode 100644 index a282243..0000000 --- a/project/cmake/modules/FindAlsa.cmake +++ /dev/null | |||
| @@ -1,46 +0,0 @@ | |||
| 1 | #.rst: | ||
| 2 | # FindAlsa | ||
| 3 | # -------- | ||
| 4 | # Finds the Alsa library | ||
| 5 | # | ||
| 6 | # This will will define the following variables:: | ||
| 7 | # | ||
| 8 | # ALSA_FOUND - system has Alsa | ||
| 9 | # ALSA_INCLUDE_DIRS - the Alsa include directory | ||
| 10 | # ALSA_LIBRARIES - the Alsa libraries | ||
| 11 | # ALSA_DEFINITIONS - the Alsa compile definitions | ||
| 12 | # | ||
| 13 | # and the following imported targets:: | ||
| 14 | # | ||
| 15 | # ALSA::ALSA - The Alsa library | ||
| 16 | |||
| 17 | if(PKG_CONFIG_FOUND) | ||
| 18 | pkg_check_modules(PC_ALSA alsa QUIET) | ||
| 19 | endif() | ||
| 20 | |||
| 21 | find_path(ALSA_INCLUDE_DIR NAMES alsa/asoundlib.h | ||
| 22 | PATHS ${PC_ALSA_INCLUDEDIR}) | ||
| 23 | find_library(ALSA_LIBRARY NAMES asound | ||
| 24 | PATHS ${PC_ALSA_LIBDIR}) | ||
| 25 | |||
| 26 | set(ALSA_VERSION ${PC_ALSA_VERSION}) | ||
| 27 | |||
| 28 | include(FindPackageHandleStandardArgs) | ||
| 29 | find_package_handle_standard_args(ALSA | ||
| 30 | REQUIRED_VARS ALSA_LIBRARY ALSA_INCLUDE_DIR | ||
| 31 | VERSION_VAR ALSA_VERSION) | ||
| 32 | |||
| 33 | if(ALSA_FOUND) | ||
| 34 | set(ALSA_INCLUDE_DIRS "") # Don't want these added as 'timer.h' is a dangerous file | ||
| 35 | set(ALSA_LIBRARIES ${ALSA_LIBRARY}) | ||
| 36 | set(ALSA_DEFINITIONS -DHAVE_ALSA=1 -DUSE_ALSA=1) | ||
| 37 | |||
| 38 | if(NOT TARGET ALSA::ALSA) | ||
| 39 | add_library(ALSA::ALSA UNKNOWN IMPORTED) | ||
| 40 | set_target_properties(ALSA::ALSA PROPERTIES | ||
| 41 | IMPORTED_LOCATION "${ALSA_LIBRARY}" | ||
| 42 | INTERFACE_COMPILE_DEFINITIONS "${ALSA_DEFINITIONS}") | ||
| 43 | endif() | ||
| 44 | endif() | ||
| 45 | |||
| 46 | mark_as_advanced(ALSA_INCLUDE_DIR ALSA_LIBRARY) | ||
diff --git a/project/cmake/modules/FindAvahi.cmake b/project/cmake/modules/FindAvahi.cmake deleted file mode 100644 index 77c3e4d..0000000 --- a/project/cmake/modules/FindAvahi.cmake +++ /dev/null | |||
| @@ -1,63 +0,0 @@ | |||
| 1 | #.rst: | ||
| 2 | # FindAvahi | ||
| 3 | # --------- | ||
| 4 | # Finds the avahi library | ||
| 5 | # | ||
| 6 | # This will will define the following variables:: | ||
| 7 | # | ||
| 8 | # AVAHI_FOUND - system has avahi | ||
| 9 | # AVAHI_INCLUDE_DIRS - the avahi include directory | ||
| 10 | # AVAHI_LIBRARIES - the avahi libraries | ||
| 11 | # AVAHI_DEFINITIONS - the avahi definitions | ||
| 12 | # | ||
| 13 | # and the following imported targets:: | ||
| 14 | # | ||
| 15 | # Avahi::Avahi - The avahi library | ||
| 16 | |||
| 17 | if(PKG_CONFIG_FOUND) | ||
| 18 | pkg_check_modules(PC_AVAHI avahi-client QUIET) | ||
| 19 | endif() | ||
| 20 | |||
| 21 | find_path(AVAHI_CLIENT_INCLUDE_DIR NAMES avahi-client/client.h | ||
| 22 | PATHS ${PC_AVAHI_INCLUDEDIR}) | ||
| 23 | find_path(AVAHI_COMMON_INCLUDE_DIR NAMES avahi-common/defs.h | ||
| 24 | PATHS ${PC_AVAHI_INCLUDEDIR}) | ||
| 25 | find_library(AVAHI_CLIENT_LIBRARY NAMES avahi-client | ||
| 26 | PATHS ${PC_AVAHI_LIBDIR}) | ||
| 27 | find_library(AVAHI_COMMON_LIBRARY NAMES avahi-common | ||
| 28 | PATHS ${PC_AVAHI_LIBDIR}) | ||
| 29 | |||
| 30 | set(AVAHI_VERSION ${PC_AVAHI_VERSION}) | ||
| 31 | |||
| 32 | include(FindPackageHandleStandardArgs) | ||
| 33 | find_package_handle_standard_args(Avahi | ||
| 34 | REQUIRED_VARS AVAHI_CLIENT_LIBRARY AVAHI_COMMON_LIBRARY | ||
| 35 | AVAHI_CLIENT_INCLUDE_DIR AVAHI_COMMON_INCLUDE_DIR | ||
| 36 | VERSION_VAR AVAHI_VERSION) | ||
| 37 | |||
| 38 | if(AVAHI_FOUND) | ||
| 39 | set(AVAHI_INCLUDE_DIRS ${AVAHI_CLIENT_INCLUDE_DIR} | ||
| 40 | ${AVAHI_COMMON_INCLUDE_DIR}) | ||
| 41 | set(AVAHI_LIBRARIES ${AVAHI_CLIENT_LIBRARY} | ||
| 42 | ${AVAHI_COMMON_LIBRARY}) | ||
| 43 | set(AVAHI_DEFINITIONS -DHAVE_LIBAVAHI_CLIENT=1 -DHAVE_LIBAVAHI_COMMON=1) | ||
| 44 | |||
| 45 | if(NOT TARGET Avahi::Avahi) | ||
| 46 | add_library(Avahi::Avahi UNKNOWN IMPORTED) | ||
| 47 | set_target_properties(Avahi::Avahi PROPERTIES | ||
| 48 | IMPORTED_LOCATION "${AVAHI_CLIENT_LIBRARY}" | ||
| 49 | INTERFACE_INCLUDE_DIRECTORIES "${AVAHI_CLIENT_INCLUDE_DIR}" | ||
| 50 | INTERFACE_COMPILE_DEFINITIONS HAVE_LIBAVAHI_CLIENT=1) | ||
| 51 | endif() | ||
| 52 | if(NOT TARGET Avahi::AvahiCommon) | ||
| 53 | add_library(Avahi::AvahiCommon UNKNOWN IMPORTED) | ||
| 54 | set_target_properties(Avahi::AvahiCommon PROPERTIES | ||
| 55 | IMPORTED_LOCATION "${AVAHI_COMMON_LIBRARY}" | ||
| 56 | INTERFACE_INCLUDE_DIRECTORIES "${AVAHI_COMMON_INCLUDE_DIR}" | ||
| 57 | INTERFACE_COMPILE_DEFINITIONS HAVE_LIBAVAHI_COMMON=1 | ||
| 58 | INTERFACE_LINK_LIBRARIES Avahi::Avahi) | ||
| 59 | endif() | ||
| 60 | endif() | ||
| 61 | |||
| 62 | mark_as_advanced(AVAHI_CLIENT_INCLUDE_DIR AVAHI_COMMON_INCLUDE_DIR | ||
| 63 | AVAHI_CLIENT_LIBRARY AVAHI_COMMON_LIBRARY) | ||
diff --git a/project/cmake/modules/FindBluetooth.cmake b/project/cmake/modules/FindBluetooth.cmake deleted file mode 100644 index a69980d..0000000 --- a/project/cmake/modules/FindBluetooth.cmake +++ /dev/null | |||
| @@ -1,44 +0,0 @@ | |||
| 1 | #.rst: | ||
| 2 | # FindBluetooth | ||
| 3 | # --------- | ||
| 4 | # Finds the Bluetooth library | ||
| 5 | # | ||
| 6 | # This will will define the following variables:: | ||
| 7 | # | ||
| 8 | # BLUETOOTH_FOUND - system has Bluetooth | ||
| 9 | # BLUETOOTH_INCLUDE_DIRS - the Bluetooth include directory | ||
| 10 | # BLUETOOTH_LIBRARIES - the Bluetooth libraries | ||
| 11 | # | ||
| 12 | # and the following imported targets:: | ||
| 13 | # | ||
| 14 | # Bluetooth::Bluetooth - The Bluetooth library | ||
| 15 | |||
| 16 | if(PKG_CONFIG_FOUND) | ||
| 17 | pkg_check_modules(PC_BLUETOOTH bluez bluetooth QUIET) | ||
| 18 | endif() | ||
| 19 | |||
| 20 | find_path(BLUETOOTH_INCLUDE_DIR NAMES bluetooth/bluetooth.h | ||
| 21 | PATHS ${PC_BLUETOOTH_INCLUDEDIR}) | ||
| 22 | find_library(BLUETOOTH_LIBRARY NAMES bluetooth libbluetooth | ||
| 23 | PATHS ${PC_BLUETOOTH_LIBDIR}) | ||
| 24 | |||
| 25 | set(BLUETOOTH_VERSION ${PC_BLUETOOTH_VERSION}) | ||
| 26 | |||
| 27 | include(FindPackageHandleStandardArgs) | ||
| 28 | find_package_handle_standard_args(Bluetooth | ||
| 29 | REQUIRED_VARS BLUETOOTH_LIBRARY BLUETOOTH_INCLUDE_DIR | ||
| 30 | VERSION_VAR BLUETOOTH_VERSION) | ||
| 31 | |||
| 32 | if(BLUETOOTH_FOUND) | ||
| 33 | set(BLUETOOTH_INCLUDE_DIRS ${BLUETOOTH_INCLUDE_DIR}) | ||
| 34 | set(BLUETOOTH_LIBRARIES ${BLUETOOTH_LIBRARY}) | ||
| 35 | |||
| 36 | if(NOT TARGET Bluetooth::Bluetooth) | ||
| 37 | add_library(Bluetooth::Bluetooth UNKNOWN IMPORTED) | ||
| 38 | set_target_properties(Bluetooth::Bluetooth PROPERTIES | ||
| 39 | IMPORTED_LOCATION "${BLUETOOTH_LIBRARY}" | ||
| 40 | INTERFACE_INCLUDE_DIRECTORIES "${BLUETOOTH_INCLUDE_DIR}") | ||
| 41 | endif() | ||
| 42 | endif() | ||
| 43 | |||
| 44 | mark_as_advanced(BLUETOOTH_INCLUDE_DIR BLUETOOTH_LIBRARY) | ||
diff --git a/project/cmake/modules/FindBluray.cmake b/project/cmake/modules/FindBluray.cmake deleted file mode 100644 index b8422ed..0000000 --- a/project/cmake/modules/FindBluray.cmake +++ /dev/null | |||
| @@ -1,58 +0,0 @@ | |||
| 1 | #.rst: | ||
| 2 | # FindBluray | ||
| 3 | # ---------- | ||
| 4 | # Finds the libbluray library | ||
| 5 | # | ||
| 6 | # This will will define the following variables:: | ||
| 7 | # | ||
| 8 | # BLURAY_FOUND - system has libbluray | ||
| 9 | # BLURAY_INCLUDE_DIRS - the libbluray include directory | ||
| 10 | # BLURAY_LIBRARIES - the libbluray libraries | ||
| 11 | # BLURAY_DEFINITIONS - the libbluray compile definitions | ||
| 12 | # | ||
| 13 | # and the following imported targets:: | ||
| 14 | # | ||
| 15 | # Bluray::Bluray - The libblueray library | ||
| 16 | |||
| 17 | if(PKG_CONFIG_FOUND) | ||
| 18 | pkg_check_modules(PC_BLURAY libbluray>=0.7.0 QUIET) | ||
| 19 | endif() | ||
| 20 | |||
| 21 | find_path(BLURAY_INCLUDE_DIR libbluray/bluray.h | ||
| 22 | PATHS ${PC_BLURAY_INCLUDEDIR}) | ||
| 23 | |||
| 24 | set(BLURAY_VERSION ${PC_BLURAY_VERSION}) | ||
| 25 | |||
| 26 | include(FindPackageHandleStandardArgs) | ||
| 27 | if(NOT WIN32) | ||
| 28 | find_library(BLURAY_LIBRARY NAMES bluray | ||
| 29 | PATHS ${PC_BLURAY_LIBDIR}) | ||
| 30 | |||
| 31 | find_package_handle_standard_args(Bluray | ||
| 32 | REQUIRED_VARS BLURAY_LIBRARY BLURAY_INCLUDE_DIR | ||
| 33 | VERSION_VAR BLURAY_VERSION) | ||
| 34 | else() | ||
| 35 | # Dynamically loaded DLL | ||
| 36 | find_package_handle_standard_args(Bluray | ||
| 37 | REQUIRED_VARS BLURAY_INCLUDE_DIR | ||
| 38 | VERSION_VAR BLURAY_VERSION) | ||
| 39 | endif() | ||
| 40 | |||
| 41 | if(BLURAY_FOUND) | ||
| 42 | set(BLURAY_LIBRARIES ${BLURAY_LIBRARY}) | ||
| 43 | set(BLURAY_INCLUDE_DIRS ${BLURAY_INCLUDE_DIR}) | ||
| 44 | set(BLURAY_DEFINITIONS -DHAVE_LIBBLURAY=1) | ||
| 45 | |||
| 46 | if(NOT TARGET Bluray::Bluray) | ||
| 47 | add_library(Bluray::Bluray UNKNOWN IMPORTED) | ||
| 48 | if(BLURAY_LIBRARY) | ||
| 49 | set_target_properties(Bluray::Bluray PROPERTIES | ||
| 50 | IMPORTED_LOCATION "${BLURAY_LIBRARY}") | ||
| 51 | endif() | ||
| 52 | set_target_properties(Bluray::Bluray PROPERTIES | ||
| 53 | INTERFACE_INCLUDE_DIRECTORIES "${BLURAY_INCLUDE_DIR}" | ||
| 54 | INTERFACE_COMPILE_DEFINITIONS HAVE_LIBBLURAY=1) | ||
| 55 | endif() | ||
| 56 | endif() | ||
| 57 | |||
| 58 | mark_as_advanced(BLURAY_INCLUDE_DIR BLURAY_LIBRARY) | ||
diff --git a/project/cmake/modules/FindCAP.cmake b/project/cmake/modules/FindCAP.cmake deleted file mode 100644 index 04e8378..0000000 --- a/project/cmake/modules/FindCAP.cmake +++ /dev/null | |||
| @@ -1,44 +0,0 @@ | |||
| 1 | #.rst: | ||
| 2 | # FindCAP | ||
| 3 | # ----------- | ||
| 4 | # Finds the POSIX 1003.1e capabilities library | ||
| 5 | # | ||
| 6 | # This will define the following variables:: | ||
| 7 | # | ||
| 8 | # CAP_FOUND - system has LibCap | ||
| 9 | # CAP_INCLUDE_DIRS - the LibCap include directory | ||
| 10 | # CAP_LIBRARIES - the LibCap libraries | ||
| 11 | # | ||
| 12 | # and the following imported targets:: | ||
| 13 | # | ||
| 14 | # CAP::CAP - The LibCap library | ||
| 15 | |||
| 16 | if(PKG_CONFIG_FOUND) | ||
| 17 | pkg_check_modules(PC_CAP libcap QUIET) | ||
| 18 | endif() | ||
| 19 | |||
| 20 | find_path(CAP_INCLUDE_DIR NAMES sys/capability.h | ||
| 21 | PATHS ${PC_CAP_INCLUDEDIR}) | ||
| 22 | find_library(CAP_LIBRARY NAMES cap libcap | ||
| 23 | PATHS ${PC_CAP_LIBDIR}) | ||
| 24 | |||
| 25 | set(CAP_VERSION ${PC_CAP_VERSION}) | ||
| 26 | |||
| 27 | include(FindPackageHandleStandardArgs) | ||
| 28 | find_package_handle_standard_args(CAP | ||
| 29 | REQUIRED_VARS CAP_LIBRARY CAP_INCLUDE_DIR | ||
| 30 | VERSION_VAR CAP_VERSION) | ||
| 31 | |||
| 32 | if(CAP_FOUND) | ||
| 33 | set(CAP_LIBRARIES ${CAP_LIBRARY}) | ||
| 34 | set(CAP_INCLUDE_DIRS ${CAP_INCLUDE_DIR}) | ||
| 35 | |||
| 36 | if(NOT TARGET CAP::CAP) | ||
| 37 | add_library(CAP::CAP UNKNOWN IMPORTED) | ||
| 38 | set_target_properties(CAP::CAP PROPERTIES | ||
| 39 | IMPORTED_LOCATION "${CAP_LIBRARY}" | ||
| 40 | INTERFACE_INCLUDE_DIRECTORIES "${CAP_INCLUDE_DIR}") | ||
| 41 | endif() | ||
| 42 | endif() | ||
| 43 | |||
| 44 | mark_as_advanced(CAP_INCLUDE_DIR CAP_LIBRARY) | ||
diff --git a/project/cmake/modules/FindCCache.cmake b/project/cmake/modules/FindCCache.cmake deleted file mode 100644 index a7fd29f..0000000 --- a/project/cmake/modules/FindCCache.cmake +++ /dev/null | |||
| @@ -1,18 +0,0 @@ | |||
| 1 | #.rst: | ||
| 2 | # FindCCache | ||
| 3 | # ---------- | ||
| 4 | # Finds ccache and sets it up as compiler wrapper. | ||
| 5 | # This should ideally be called before the call to project(). | ||
| 6 | # | ||
| 7 | # See: https://crascit.com/2016/04/09/using-ccache-with-cmake/ | ||
| 8 | |||
| 9 | find_program(CCACHE_PROGRAM ccache) | ||
| 10 | |||
| 11 | include(FindPackageHandleStandardArgs) | ||
| 12 | find_package_handle_standard_args(CCACHE REQUIRED_VARS CCACHE_PROGRAM) | ||
| 13 | |||
| 14 | if(CCACHE_FOUND) | ||
| 15 | # Supports Unix Makefiles and Ninja | ||
| 16 | set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE_PROGRAM}") | ||
| 17 | set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK "${CCACHE_PROGRAM}") | ||
| 18 | endif() | ||
diff --git a/project/cmake/modules/FindCEC.cmake b/project/cmake/modules/FindCEC.cmake deleted file mode 100644 index bd6fd1d..0000000 --- a/project/cmake/modules/FindCEC.cmake +++ /dev/null | |||
| @@ -1,68 +0,0 @@ | |||
| 1 | #.rst: | ||
| 2 | # FindCEC | ||
| 3 | # ------- | ||
| 4 | # Finds the libCEC library | ||
| 5 | # | ||
| 6 | # This will will define the following variables:: | ||
| 7 | # | ||
| 8 | # CEC_FOUND - system has libCEC | ||
| 9 | # CEC_INCLUDE_DIRS - the libCEC include directory | ||
| 10 | # CEC_LIBRARIES - the libCEC libraries | ||
| 11 | # CEC_DEFINITIONS - the libCEC compile definitions | ||
| 12 | # | ||
| 13 | # and the following imported targets:: | ||
| 14 | # | ||
| 15 | # CEC::CEC - The libCEC library | ||
| 16 | |||
| 17 | if(PKG_CONFIG_FOUND) | ||
| 18 | pkg_check_modules(PC_CEC libcec QUIET) | ||
| 19 | endif() | ||
| 20 | |||
| 21 | find_path(CEC_INCLUDE_DIR NAMES libcec/cec.h libCEC/CEC.h | ||
| 22 | PATHS ${PC_CEC_INCLUDEDIR}) | ||
| 23 | |||
| 24 | if(PC_CEC_VERSION) | ||
| 25 | set(CEC_VERSION ${PC_CEC_VERSION}) | ||
| 26 | elseif(CEC_INCLUDE_DIR AND EXISTS "${CEC_INCLUDE_DIR}/libcec/version.h") | ||
| 27 | file(STRINGS "${CEC_INCLUDE_DIR}/libcec/version.h" cec_version_str REGEX "^[\t ]+LIBCEC_VERSION_TO_UINT\\(.*\\)") | ||
| 28 | string(REGEX REPLACE "^[\t ]+LIBCEC_VERSION_TO_UINT\\(([0-9]+), ([0-9]+), ([0-9]+)\\)" "\\1.\\2.\\3" CEC_VERSION "${cec_version_str}") | ||
| 29 | unset(cec_version_str) | ||
| 30 | endif() | ||
| 31 | |||
| 32 | if(NOT CEC_FIND_VERSION) | ||
| 33 | set(CEC_FIND_VERSION 4.0.0) | ||
| 34 | endif() | ||
| 35 | |||
| 36 | include(FindPackageHandleStandardArgs) | ||
| 37 | if(NOT WIN32) | ||
| 38 | find_library(CEC_LIBRARY NAMES cec | ||
| 39 | PATHS ${PC_CEC_LIBDIR}) | ||
| 40 | |||
| 41 | find_package_handle_standard_args(CEC | ||
| 42 | REQUIRED_VARS CEC_LIBRARY CEC_INCLUDE_DIR | ||
| 43 | VERSION_VAR CEC_VERSION) | ||
| 44 | else() | ||
| 45 | # Dynamically loaded DLL | ||
| 46 | find_package_handle_standard_args(CEC | ||
| 47 | REQUIRED_VARS CEC_INCLUDE_DIR | ||
| 48 | VERSION_VAR CEC_VERSION) | ||
| 49 | endif() | ||
| 50 | |||
| 51 | if(CEC_FOUND) | ||
| 52 | set(CEC_LIBRARIES ${CEC_LIBRARY}) | ||
| 53 | set(CEC_INCLUDE_DIRS ${CEC_INCLUDE_DIR}) | ||
| 54 | set(CEC_DEFINITIONS -DHAVE_LIBCEC=1) | ||
| 55 | |||
| 56 | if(NOT TARGET CEC::CEC) | ||
| 57 | add_library(CEC::CEC UNKNOWN IMPORTED) | ||
| 58 | if(CEC_LIBRARY) | ||
| 59 | set_target_properties(CEC::CEC PROPERTIES | ||
| 60 | IMPORTED_LOCATION "${CEC_LIBRARY}") | ||
| 61 | endif() | ||
| 62 | set_target_properties(CEC::CEC PROPERTIES | ||
| 63 | INTERFACE_INCLUDE_DIRECTORIES "${CEC_INCLUDE_DIR}" | ||
| 64 | INTERFACE_COMPILE_DEFINITIONS HAVE_LIBCEC=1) | ||
| 65 | endif() | ||
| 66 | endif() | ||
| 67 | |||
| 68 | mark_as_advanced(CEC_INCLUDE_DIR CEC_LIBRARY) | ||
diff --git a/project/cmake/modules/FindCWiid.cmake b/project/cmake/modules/FindCWiid.cmake deleted file mode 100644 index 88cfbef..0000000 --- a/project/cmake/modules/FindCWiid.cmake +++ /dev/null | |||
| @@ -1,44 +0,0 @@ | |||
| 1 | #.rst: | ||
| 2 | # FindCWiid | ||
| 3 | # --------- | ||
| 4 | # Finds the CWiid library | ||
| 5 | # | ||
| 6 | # This will will define the following variables:: | ||
| 7 | # | ||
| 8 | # CWIID_FOUND - system has CWiid | ||
| 9 | # CWIID_INCLUDE_DIRS - the CWiid include directory | ||
| 10 | # CWIID_LIBRARIES - the CWiid libraries | ||
| 11 | # | ||
| 12 | # and the following imported targets:: | ||
| 13 | # | ||
| 14 | # CWiid::CWiid - The CWiid library | ||
| 15 | |||
| 16 | if(PKG_CONFIG_FOUND) | ||
| 17 | pkg_check_modules(PC_CWIID cwiid QUIET) | ||
| 18 | endif() | ||
| 19 | |||
| 20 | find_path(CWIID_INCLUDE_DIR NAMES cwiid.h | ||
| 21 | PATHS ${PC_CWIID_INCLUDEDIR}) | ||
| 22 | find_library(CWIID_LIBRARY NAMES cwiid | ||
| 23 | PATHS ${PC_CWIID_LIBDIR}) | ||
| 24 | |||
| 25 | set(CWIID_VERSION ${PC_CWIID_VERSION}) | ||
| 26 | |||
| 27 | include(FindPackageHandleStandardArgs) | ||
| 28 | find_package_handle_standard_args(CWIID | ||
| 29 | REQUIRED_VARS CWIID_LIBRARY CWIID_INCLUDE_DIR | ||
| 30 | VERSION_VAR CWIID_VERSION) | ||
| 31 | |||
| 32 | if(CWIID_FOUND) | ||
| 33 | set(CWIID_INCLUDE_DIRS ${CWIID_INCLUDE_DIR}) | ||
| 34 | set(CWIID_LIBRARIES ${CWIID_LIBRARY}) | ||
| 35 | |||
| 36 | if(NOT TARGET CWiid::CWiid) | ||
| 37 | add_library(CWiid::CWiid UNKNOWN IMPORTED) | ||
| 38 | set_target_properties(CWiid::CWiid PROPERTIES | ||
| 39 | IMPORTED_LOCATION "${CWIID_LIBRARY}" | ||
| 40 | INTERFACE_INCLUDE_DIRECTORIES "${CWIID_INCLUDE_DIR}") | ||
| 41 | endif() | ||
| 42 | endif() | ||
| 43 | |||
| 44 | mark_as_advanced(CWIID_INCLUDE_DIR CWIID_LIBRARY) | ||
diff --git a/project/cmake/modules/FindCXX11.cmake b/project/cmake/modules/FindCXX11.cmake deleted file mode 100644 index c0b9a52..0000000 --- a/project/cmake/modules/FindCXX11.cmake +++ /dev/null | |||
| @@ -1,18 +0,0 @@ | |||
| 1 | include(TestCXXAcceptsFlag) | ||
| 2 | |||
| 3 | # try to use compiler flag -std=c++11 | ||
| 4 | check_cxx_accepts_flag("-std=c++11" CXX_FLAG_CXX11) | ||
| 5 | if(CXX_FLAG_CXX11) | ||
| 6 | add_options (CXX ALL_BUILDS "-std=c++11") | ||
| 7 | set(CXX_STD11_FLAGS "-std=c++11") | ||
| 8 | else() | ||
| 9 | # try to use compiler flag -std=c++0x for older compilers | ||
| 10 | check_cxx_accepts_flag("-std=c++0x" CXX_FLAG_CXX0X) | ||
| 11 | if(CXX_FLAG_CXX0X) | ||
| 12 | add_options (CXX ALL_BUILDS "-std=c++0x") | ||
| 13 | set(CXX_STD11_FLAGS "-std=c++0x") | ||
| 14 | endif() | ||
| 15 | endif() | ||
| 16 | |||
| 17 | include(FindPackageHandleStandardArgs) | ||
| 18 | find_package_handle_standard_args(CXX11 DEFAULT_MSG CXX_STD11_FLAGS) | ||
diff --git a/project/cmake/modules/FindCdio.cmake b/project/cmake/modules/FindCdio.cmake deleted file mode 100644 index aa089c2..0000000 --- a/project/cmake/modules/FindCdio.cmake +++ /dev/null | |||
| @@ -1,45 +0,0 @@ | |||
| 1 | #.rst: | ||
| 2 | # FindCdio | ||
| 3 | # -------- | ||
| 4 | # Finds the cdio library | ||
| 5 | # | ||
| 6 | # This will will define the following variables:: | ||
| 7 | # | ||
| 8 | # CDIO_FOUND - system has cdio | ||
| 9 | # CDIO_INCLUDE_DIRS - the cdio include directory | ||
| 10 | # CDIO_LIBRARIES - the cdio libraries | ||
| 11 | # | ||
| 12 | # and the following imported targets:: | ||
| 13 | # | ||
| 14 | # CDIO::CDIO - The cdio library | ||
| 15 | |||
| 16 | if(PKG_CONFIG_FOUND) | ||
| 17 | pkg_check_modules(PC_CDIO libcdio libiso9660 QUIET) | ||
| 18 | endif() | ||
| 19 | |||
| 20 | find_path(CDIO_INCLUDE_DIR NAMES cdio/cdio.h | ||
| 21 | PATHS ${PC_CDIO_libcdio_INCLUDEDIR} | ||
| 22 | ${PC_CDIO_libiso9660_INCLUDEDIR}) | ||
| 23 | find_library(CDIO_LIBRARY NAMES cdio | ||
| 24 | PATHS ${CDIO_libcdio_LIBDIR} ${CDIO_libiso9660_LIBDIR}) | ||
| 25 | |||
| 26 | set(CDIO_VERSION ${PC_CDIO_libcdio_VERSION}) | ||
| 27 | |||
| 28 | include(FindPackageHandleStandardArgs) | ||
| 29 | find_package_handle_standard_args(CDIO | ||
| 30 | REQUIRED_VARS CDIO_LIBRARY CDIO_INCLUDE_DIR | ||
| 31 | VERSION_VAR CDIO_VERSION) | ||
| 32 | |||
| 33 | if(CDIO_FOUND) | ||
| 34 | set(CDIO_LIBRARIES ${CDIO_LIBRARY}) | ||
| 35 | set(CDIO_INCLUDE_DIRS ${CDIO_INCLUDE_DIR}) | ||
| 36 | |||
| 37 | if(NOT TARGET CDIO::CDIO) | ||
| 38 | add_library(CDIO::CDIO UNKNOWN IMPORTED) | ||
| 39 | set_target_properties(CDIO::CDIO PROPERTIES | ||
| 40 | IMPORTED_LOCATION "${CDIO_LIBRARY}" | ||
| 41 | INTERFACE_INCLUDE_DIRECTORIES "${CDIO_INCLUDE_DIR}") | ||
| 42 | endif() | ||
| 43 | endif() | ||
| 44 | |||
| 45 | mark_as_advanced(CDIO_INCLUDE_DIR CDIO_LIBRARY) | ||
diff --git a/project/cmake/modules/FindCpluff.cmake b/project/cmake/modules/FindCpluff.cmake deleted file mode 100644 index ce6c127..0000000 --- a/project/cmake/modules/FindCpluff.cmake +++ /dev/null | |||
| @@ -1,61 +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 | if(NOT WIN32) | ||
| 10 | string(REPLACE ";" " " defines "${CMAKE_C_FLAGS} ${SYSTEM_DEFINES} -I${EXPAT_INCLUDE_DIR}") | ||
| 11 | get_filename_component(expat_dir ${EXPAT_LIBRARY} DIRECTORY) | ||
| 12 | set(ldflags "-L${expat_dir}") | ||
| 13 | |||
| 14 | # iOS: Without specifying -arch, configure tries to use /bin/cpp as C-preprocessor | ||
| 15 | # http://stackoverflow.com/questions/38836754/cant-cross-compile-c-library-for-arm-ios | ||
| 16 | if(CORE_SYSTEM_NAME STREQUAL ios) | ||
| 17 | set(cppflags "-arch ${CPU}") | ||
| 18 | endif() | ||
| 19 | |||
| 20 | ExternalProject_Add(libcpluff SOURCE_DIR ${CORE_SOURCE_DIR}/lib/cpluff | ||
| 21 | BUILD_IN_SOURCE 1 | ||
| 22 | PREFIX ${CORE_BUILD_DIR}/cpluff | ||
| 23 | CONFIGURE_COMMAND CC=${CMAKE_C_COMPILER} ${CORE_SOURCE_DIR}/lib/cpluff/configure | ||
| 24 | --disable-nls | ||
| 25 | --enable-static | ||
| 26 | --disable-shared | ||
| 27 | --with-pic | ||
| 28 | --prefix=<INSTALL_DIR> | ||
| 29 | --libdir=<INSTALL_DIR>/lib | ||
| 30 | --host=${ARCH} | ||
| 31 | CFLAGS=${defines} | ||
| 32 | CPPFLAGS=${cppflags} | ||
| 33 | LDFLAGS=${ldflags}) | ||
| 34 | ExternalProject_Add_Step(libcpluff autoreconf | ||
| 35 | DEPENDEES download update patch | ||
| 36 | DEPENDERS configure | ||
| 37 | COMMAND rm -f config.status | ||
| 38 | COMMAND PATH=${NATIVEPREFIX}/bin:$ENV{PATH} autoreconf -vif | ||
| 39 | WORKING_DIRECTORY <SOURCE_DIR>) | ||
| 40 | |||
| 41 | set(ldflags "${ldflags};-lexpat") | ||
| 42 | core_link_library(${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/cpluff/lib/libcpluff.a | ||
| 43 | system/libcpluff libcpluff extras "${ldflags}") | ||
| 44 | set(CPLUFF_INCLUDE_DIRS ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/cpluff/include) | ||
| 45 | set(CPLUFF_FOUND 1) | ||
| 46 | mark_as_advanced(CPLUFF_INCLUDE_DIRS CPLUFF_FOUND) | ||
| 47 | else() | ||
| 48 | find_path(CPLUFF_INCLUDE_DIR cpluff.h) | ||
| 49 | |||
| 50 | include(FindPackageHandleStandardArgs) | ||
| 51 | find_package_handle_standard_args(CPLUFF | ||
| 52 | REQUIRED_VARS CPLUFF_INCLUDE_DIR) | ||
| 53 | |||
| 54 | if(CPLUFF_FOUND) | ||
| 55 | set(CPLUFF_INCLUDE_DIRS ${CPLUFF_INCLUDE_DIR}) | ||
| 56 | endif() | ||
| 57 | mark_as_advanced(CPLUFF_INCLUDE_DIRS CPLUFF_FOUND) | ||
| 58 | |||
| 59 | add_custom_target(libcpluff) | ||
| 60 | endif() | ||
| 61 | set_target_properties(libcpluff PROPERTIES FOLDER "External Projects") | ||
diff --git a/project/cmake/modules/FindCrossGUID.cmake b/project/cmake/modules/FindCrossGUID.cmake deleted file mode 100644 index ba2823a..0000000 --- a/project/cmake/modules/FindCrossGUID.cmake +++ /dev/null | |||
| @@ -1,78 +0,0 @@ | |||
| 1 | if(ENABLE_INTERNAL_CROSSGUID) | ||
| 2 | include(ExternalProject) | ||
| 3 | file(STRINGS ${CORE_SOURCE_DIR}/tools/depends/target/crossguid/Makefile VER) | ||
| 4 | string(REGEX MATCH "VERSION=[^ ]*" CGUID_VER "${VER}") | ||
| 5 | list(GET CGUID_VER 0 CGUID_VER) | ||
| 6 | string(SUBSTRING "${CGUID_VER}" 8 -1 CGUID_VER) | ||
| 7 | |||
| 8 | # allow user to override the download URL with a local tarball | ||
| 9 | # needed for offline build envs | ||
| 10 | if(CROSSGUID_URL) | ||
| 11 | get_filename_component(CROSSGUID_URL "${CROSSGUID_URL}" ABSOLUTE) | ||
| 12 | else() | ||
| 13 | set(CROSSGUID_URL http://mirrors.kodi.tv/build-deps/sources/crossguid-${CGUID_VER}.tar.gz) | ||
| 14 | endif() | ||
| 15 | if(VERBOSE) | ||
| 16 | message(STATUS "CROSSGUID_URL: ${CROSSGUID_URL}") | ||
| 17 | endif() | ||
| 18 | |||
| 19 | if(APPLE) | ||
| 20 | set(EXTRA_ARGS "-DCMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES}") | ||
| 21 | endif() | ||
| 22 | |||
| 23 | set(CROSSGUID_LIBRARY ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/lib/libcrossguid.a) | ||
| 24 | set(CROSSGUID_INCLUDE_DIR ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/include) | ||
| 25 | externalproject_add(crossguid | ||
| 26 | URL ${CROSSGUID_URL} | ||
| 27 | DOWNLOAD_DIR ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/download | ||
| 28 | PREFIX ${CORE_BUILD_DIR}/crossguid | ||
| 29 | CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR} | ||
| 30 | -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} | ||
| 31 | "${EXTRA_ARGS}" | ||
| 32 | PATCH_COMMAND ${CMAKE_COMMAND} -E copy | ||
| 33 | ${CORE_SOURCE_DIR}/tools/depends/target/crossguid/CMakeLists.txt | ||
| 34 | <SOURCE_DIR> && | ||
| 35 | ${CMAKE_COMMAND} -E copy | ||
| 36 | ${CORE_SOURCE_DIR}/tools/depends/target/crossguid/FindUUID.cmake | ||
| 37 | <SOURCE_DIR> && | ||
| 38 | ${CMAKE_COMMAND} -E copy | ||
| 39 | ${CORE_SOURCE_DIR}/tools/depends/target/crossguid/FindCXX11.cmake | ||
| 40 | <SOURCE_DIR> | ||
| 41 | BUILD_BYPRODUCTS ${CROSSGUID_LIBRARY}) | ||
| 42 | set_target_properties(crossguid PROPERTIES FOLDER "External Projects") | ||
| 43 | |||
| 44 | include(FindPackageHandleStandardArgs) | ||
| 45 | find_package_handle_standard_args(CrossGuid | ||
| 46 | REQUIRED_VARS CROSSGUID_LIBRARY CROSSGUID_INCLUDE_DIR | ||
| 47 | VERSION_VAR CGUID_VER) | ||
| 48 | |||
| 49 | set(CROSSGUID_LIBRARIES ${CROSSGUID_LIBRARY}) | ||
| 50 | set(CROSSGUID_INCLUDE_DIRS ${CROSSGUID_INCLUDE_DIR}) | ||
| 51 | else() | ||
| 52 | find_path(CROSSGUID_INCLUDE_DIR NAMES guid.h) | ||
| 53 | |||
| 54 | find_library(CROSSGUID_LIBRARY_RELEASE NAMES crossguid) | ||
| 55 | find_library(CROSSGUID_LIBRARY_DEBUG NAMES crossguidd) | ||
| 56 | |||
| 57 | include(SelectLibraryConfigurations) | ||
| 58 | select_library_configurations(CROSSGUID) | ||
| 59 | |||
| 60 | include(FindPackageHandleStandardArgs) | ||
| 61 | find_package_handle_standard_args(CrossGuid | ||
| 62 | REQUIRED_VARS CROSSGUID_LIBRARY CROSSGUID_INCLUDE_DIR) | ||
| 63 | |||
| 64 | if(CROSSGUID_FOUND) | ||
| 65 | set(CROSSGUID_LIBRARIES ${CROSSGUID_LIBRARY}) | ||
| 66 | set(CROSSGUID_INCLUDE_DIRS ${CROSSGUID_INCLUDE_DIR}) | ||
| 67 | |||
| 68 | add_custom_target(crossguid) | ||
| 69 | set_target_properties(crossguid PROPERTIES FOLDER "External Projects") | ||
| 70 | endif() | ||
| 71 | mark_as_advanced(CROSSGUID_INCLUDE_DIR CROSSGUID_LIBRARY) | ||
| 72 | endif() | ||
| 73 | |||
| 74 | if(NOT WIN32 AND NOT APPLE) | ||
| 75 | find_package(UUID REQUIRED) | ||
| 76 | list(APPEND CROSSGUID_INCLUDE_DIRS ${UUID_INCLUDE_DIRS}) | ||
| 77 | list(APPEND CROSSGUID_LIBRARIES ${UUID_LIBRARIES}) | ||
| 78 | endif() | ||
diff --git a/project/cmake/modules/FindCurl.cmake b/project/cmake/modules/FindCurl.cmake deleted file mode 100644 index ed4d81f..0000000 --- a/project/cmake/modules/FindCurl.cmake +++ /dev/null | |||
| @@ -1,83 +0,0 @@ | |||
| 1 | #.rst: | ||
| 2 | # FindCurl | ||
| 3 | # -------- | ||
| 4 | # Finds the Curl library | ||
| 5 | # | ||
| 6 | # This will will define the following variables:: | ||
| 7 | # | ||
| 8 | # CURL_FOUND - system has Curl | ||
| 9 | # CURL_INCLUDE_DIRS - the Curl include directory | ||
| 10 | # CURL_LIBRARIES - the Curl libraries | ||
| 11 | # CURL_DEFINITIONS - the Curl definitions | ||
| 12 | # | ||
| 13 | # and the following imported targets:: | ||
| 14 | # | ||
| 15 | # Curl::Curl - The Curl library | ||
| 16 | |||
| 17 | if(PKG_CONFIG_FOUND) | ||
| 18 | pkg_check_modules(PC_CURL libcurl QUIET) | ||
| 19 | endif() | ||
| 20 | |||
| 21 | find_path(CURL_INCLUDE_DIR NAMES curl/curl.h | ||
| 22 | PATHS ${PC_CURL_INCLUDEDIR}) | ||
| 23 | find_library(CURL_LIBRARY NAMES curl libcurl | ||
| 24 | PATHS ${PC_CURL_LIBDIR}) | ||
| 25 | |||
| 26 | set(CURL_VERSION ${PC_CURL_VERSION}) | ||
| 27 | |||
| 28 | include(FindPackageHandleStandardArgs) | ||
| 29 | find_package_handle_standard_args(Curl | ||
| 30 | REQUIRED_VARS CURL_LIBRARY CURL_INCLUDE_DIR | ||
| 31 | VERSION_VAR CURL_VERSION) | ||
| 32 | |||
| 33 | if(CURL_FOUND) | ||
| 34 | set(CURL_INCLUDE_DIRS ${CURL_INCLUDE_DIR}) | ||
| 35 | set(CURL_LIBRARIES ${CURL_LIBRARY}) | ||
| 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) | ||
| 72 | add_library(Curl::Curl UNKNOWN IMPORTED) | ||
| 73 | set_target_properties(Curl::Curl PROPERTIES | ||
| 74 | IMPORTED_LOCATION "${CURL_LIBRARY}" | ||
| 75 | INTERFACE_INCLUDE_DIRECTORIES "${CURL_INCLUDE_DIR}") | ||
| 76 | if(HAS_CURL_STATIC) | ||
| 77 | set_target_properties(Curl::Curl PROPERTIES | ||
| 78 | INTERFACE_COMPILE_DEFINITIONS HAS_CURL_STATIC=1) | ||
| 79 | endif() | ||
| 80 | endif() | ||
| 81 | endif() | ||
| 82 | |||
| 83 | mark_as_advanced(CURL_INCLUDE_DIR CURL_LIBRARY) | ||
diff --git a/project/cmake/modules/FindD3DX11Effects.cmake b/project/cmake/modules/FindD3DX11Effects.cmake deleted file mode 100644 index d7468e1..0000000 --- a/project/cmake/modules/FindD3DX11Effects.cmake +++ /dev/null | |||
| @@ -1,30 +0,0 @@ | |||
| 1 | # - Finds D3DX11 dependencies | ||
| 2 | # Once done this will define | ||
| 3 | # | ||
| 4 | # D3DCOMPILER_DLL - Path to the Direct3D Compiler | ||
| 5 | # FXC - Path to the DirectX Effects Compiler (FXC) | ||
| 6 | |||
| 7 | find_file(D3DCOMPILER_DLL | ||
| 8 | NAMES d3dcompiler_47.dll d3dcompiler_46.dll | ||
| 9 | PATHS | ||
| 10 | "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\Microsoft SDKs\\Windows\\v10.0;InstallationFolder]/Redist/D3D/x86" | ||
| 11 | "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\Microsoft SDKs\\Windows\\v8.1;InstallationFolder]/Redist/D3D/x86" | ||
| 12 | "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\Microsoft SDKs\\Windows\\v8.0;InstallationFolder]/Redist/D3D/x86" | ||
| 13 | "$ENV{WindowsSdkDir}Redist/d3d/x86" | ||
| 14 | NO_DEFAULT_PATH) | ||
| 15 | if(NOT D3DCOMPILER_DLL) | ||
| 16 | message(WARNING "Could NOT find Direct3D Compiler") | ||
| 17 | endif() | ||
| 18 | mark_as_advanced(D3DCOMPILER_DLL) | ||
| 19 | copy_file_to_buildtree(${D3DCOMPILER_DLL} DIRECTORY .) | ||
| 20 | |||
| 21 | find_program(FXC fxc | ||
| 22 | PATHS | ||
| 23 | "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\Microsoft SDKs\\Windows\\v10.0;InstallationFolder]/bin/x86" | ||
| 24 | "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\Microsoft SDKs\\Windows\\v8.1;InstallationFolder]/bin/x86" | ||
| 25 | "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\Microsoft SDKs\\Windows\\v8.0;InstallationFolder]/bin/x86" | ||
| 26 | "$ENV{WindowsSdkDir}bin/x86") | ||
| 27 | if(NOT FXC) | ||
| 28 | message(WARNING "Could NOT find DirectX Effects Compiler (FXC)") | ||
| 29 | endif() | ||
| 30 | mark_as_advanced(FXC) | ||
diff --git a/project/cmake/modules/FindDBus.cmake b/project/cmake/modules/FindDBus.cmake deleted file mode 100644 index 2d64af4..0000000 --- a/project/cmake/modules/FindDBus.cmake +++ /dev/null | |||
| @@ -1,52 +0,0 @@ | |||
| 1 | #.rst: | ||
| 2 | # FindDBUS | ||
| 3 | # ------- | ||
| 4 | # Finds the DBUS library | ||
| 5 | # | ||
| 6 | # This will will define the following variables:: | ||
| 7 | # | ||
| 8 | # DBUS_FOUND - system has DBUS | ||
| 9 | # DBUS_INCLUDE_DIRS - the DBUS include directory | ||
| 10 | # DBUS_LIBRARIES - the DBUS libraries | ||
| 11 | # DBUS_DEFINITIONS - the DBUS definitions | ||
| 12 | # | ||
| 13 | # and the following imported targets:: | ||
| 14 | # | ||
| 15 | # DBus::DBus - The DBUS library | ||
| 16 | |||
| 17 | if(PKG_CONFIG_FOUND) | ||
| 18 | pkg_check_modules(PC_DBUS dbus-1 QUIET) | ||
| 19 | endif() | ||
| 20 | |||
| 21 | find_path(DBUS_INCLUDE_DIR NAMES dbus/dbus.h | ||
| 22 | PATH_SUFFIXES dbus-1.0 | ||
| 23 | PATHS ${PC_DBUS_INCLUDE_DIR}) | ||
| 24 | find_path(DBUS_ARCH_INCLUDE_DIR NAMES dbus/dbus-arch-deps.h | ||
| 25 | PATH_SUFFIXES dbus-1.0/include | ||
| 26 | PATHS ${PC_DBUS_LIBDIR} | ||
| 27 | /usr/lib/${CMAKE_LIBRARY_ARCHITECTURE}) | ||
| 28 | find_library(DBUS_LIBRARY NAMES dbus-1 | ||
| 29 | PATHS ${PC_DBUS_LIBDIR}) | ||
| 30 | |||
| 31 | set(DBUS_VERSION ${PC_DBUS_VERSION}) | ||
| 32 | |||
| 33 | include(FindPackageHandleStandardArgs) | ||
| 34 | find_package_handle_standard_args(DBus | ||
| 35 | REQUIRED_VARS DBUS_LIBRARY DBUS_INCLUDE_DIR DBUS_ARCH_INCLUDE_DIR | ||
| 36 | VERSION_VAR DBUS_VERSION) | ||
| 37 | |||
| 38 | if(DBUS_FOUND) | ||
| 39 | set(DBUS_LIBRARIES ${DBUS_LIBRARY}) | ||
| 40 | set(DBUS_INCLUDE_DIRS ${DBUS_INCLUDE_DIR} ${DBUS_ARCH_INCLUDE_DIR}) | ||
| 41 | set(DBUS_DEFINITIONS -DHAVE_DBUS=1) | ||
| 42 | |||
| 43 | if(NOT TARGET DBus::DBus) | ||
| 44 | add_library(DBus::DBus UNKNOWN IMPORTED) | ||
| 45 | set_target_properties(DBus::DBus PROPERTIES | ||
| 46 | IMPORTED_LOCATION "${DBUS_LIBRARY}" | ||
| 47 | INTERFACE_INCLUDE_DIRECTORIES "${DBUS_INCLUDE_DIR}" | ||
| 48 | INTERFACE_COMPILE_DEFINITIONS HAVE_DBUS=1) | ||
| 49 | endif() | ||
| 50 | endif() | ||
| 51 | |||
| 52 | mark_as_advanced(DBUS_INCLUDE_DIR DBUS_LIBRARY) | ||
diff --git a/project/cmake/modules/FindEGL.cmake b/project/cmake/modules/FindEGL.cmake deleted file mode 100644 index 79bb176..0000000 --- a/project/cmake/modules/FindEGL.cmake +++ /dev/null | |||
| @@ -1,48 +0,0 @@ | |||
| 1 | #.rst: | ||
| 2 | # FindEGL | ||
| 3 | # ------- | ||
| 4 | # Finds the EGL library | ||
| 5 | # | ||
| 6 | # This will will define the following variables:: | ||
| 7 | # | ||
| 8 | # EGL_FOUND - system has EGL | ||
| 9 | # EGL_INCLUDE_DIRS - the EGL include directory | ||
| 10 | # EGL_LIBRARIES - the EGL libraries | ||
| 11 | # EGL_DEFINITIONS - the EGL definitions | ||
| 12 | # | ||
| 13 | # and the following imported targets:: | ||
| 14 | # | ||
| 15 | # EGL::EGL - The EGL library | ||
| 16 | |||
| 17 | if(PKG_CONFIG_FOUND) | ||
| 18 | pkg_check_modules(PC_EGL egl QUIET) | ||
| 19 | endif() | ||
| 20 | |||
| 21 | find_path(EGL_INCLUDE_DIR EGL/egl.h | ||
| 22 | PATHS ${PC_EGL_INCLUDEDIR}) | ||
| 23 | |||
| 24 | find_library(EGL_LIBRARY NAMES EGL egl | ||
| 25 | PATHS ${PC_EGL_LIBDIR}) | ||
| 26 | |||
| 27 | set(EGL_VERSION ${PC_EGL_VERSION}) | ||
| 28 | |||
| 29 | include(FindPackageHandleStandardArgs) | ||
| 30 | find_package_handle_standard_args(EGL | ||
| 31 | REQUIRED_VARS EGL_LIBRARY EGL_INCLUDE_DIR | ||
| 32 | VERSION_VAR EGL_VERSION) | ||
| 33 | |||
| 34 | if(EGL_FOUND) | ||
| 35 | set(EGL_LIBRARIES ${EGL_LIBRARY}) | ||
| 36 | set(EGL_INCLUDE_DIRS ${EGL_INCLUDE_DIR}) | ||
| 37 | set(EGL_DEFINITIONS -DHAVE_LIBEGL=1) | ||
| 38 | |||
| 39 | if(NOT TARGET EGL::EGL) | ||
| 40 | add_library(EGL::EGL UNKNOWN IMPORTED) | ||
| 41 | set_target_properties(EGL::EGL PROPERTIES | ||
| 42 | IMPORTED_LOCATION "${EGL_LIBRARY}" | ||
| 43 | INTERFACE_INCLUDE_DIRECTORIES "${EGL_INCLUDE_DIR}" | ||
| 44 | INTERFACE_COMPILE_DEFINITIONS HAVE_LIBEGL=1) | ||
| 45 | endif() | ||
| 46 | endif() | ||
| 47 | |||
| 48 | mark_as_advanced(EGL_INCLUDE_DIR EGL_LIBRARY) | ||
diff --git a/project/cmake/modules/FindEMBEDDED.cmake b/project/cmake/modules/FindEMBEDDED.cmake deleted file mode 100644 index aa938c5..0000000 --- a/project/cmake/modules/FindEMBEDDED.cmake +++ /dev/null | |||
| @@ -1,16 +0,0 @@ | |||
| 1 | # - Try to find embedded platforms (RPI/IMX6) | ||
| 2 | # Once done this will define | ||
| 3 | # | ||
| 4 | # EMBEDDED_FOUND - system is RPI / IMX6 and we most probably want to compile for GLES2 support | ||
| 5 | # (don't configure for OpenGL) | ||
| 6 | |||
| 7 | if(NOT CMAKE_SYSTEM_PROCESSOR) | ||
| 8 | set(CMAKE_SYSTEM_PROCESSOR ${CPU}) | ||
| 9 | endif() | ||
| 10 | |||
| 11 | string(REGEX MATCH "^arm" TARGET_ARCH_ARM "${CMAKE_SYSTEM_PROCESSOR}") | ||
| 12 | if(NOT CMAKE_CROSSCOMPILING AND NOT TARGET_ARCH_ARM) | ||
| 13 | return() | ||
| 14 | endif() | ||
| 15 | |||
| 16 | find_path(EMBEDDED_FOUND NAMES include/linux/imxfb.h include/bcm_host.h PATHS /opt/vc) | ||
diff --git a/project/cmake/modules/FindFFMPEG.cmake b/project/cmake/modules/FindFFMPEG.cmake deleted file mode 100644 index 2b3f47b..0000000 --- a/project/cmake/modules/FindFFMPEG.cmake +++ /dev/null | |||
| @@ -1,292 +0,0 @@ | |||
| 1 | # FindFFMPEG | ||
| 2 | # -------- | ||
| 3 | # Finds FFmpeg libraries | ||
| 4 | # | ||
| 5 | # This module will first look for the required library versions on the system. | ||
| 6 | # If they are not found, it will fall back to downloading and building kodi's own version | ||
| 7 | # | ||
| 8 | # -------- | ||
| 9 | # the following variables influence behaviour: | ||
| 10 | # ENABLE_INTERNAL_FFMPEG - if enabled, kodi's own version will always be built | ||
| 11 | # | ||
| 12 | # FFMPEG_PATH - use external ffmpeg not found in system paths | ||
| 13 | # usage: -DFFMPEG_PATH=/path/to/ffmpeg_install_prefix | ||
| 14 | # | ||
| 15 | # WITH_FFMPEG - use external ffmpeg not found in system paths | ||
| 16 | # WARNING: this option is for developers as it will _disable ffmpeg version checks_! | ||
| 17 | # Consider using FFMPEG_PATH instead, which _does_ check library versions | ||
| 18 | # usage: -DWITH_FFMPEG=/path/to/ffmpeg_install_prefix | ||
| 19 | # | ||
| 20 | # -------- | ||
| 21 | # This module will will define the following variables: | ||
| 22 | # | ||
| 23 | # FFMPEG_FOUND - system has FFmpeg | ||
| 24 | # FFMPEG_INCLUDE_DIRS - FFmpeg include directory | ||
| 25 | # FFMPEG_LIBRARIES - FFmpeg libraries | ||
| 26 | # FFMPEG_DEFINITIONS - pre-processor definitions | ||
| 27 | # FFMPEG_LDFLAGS - linker flags | ||
| 28 | # | ||
| 29 | # and the following imported targets:: | ||
| 30 | # | ||
| 31 | # ffmpeg - The FFmpeg libraries | ||
| 32 | # -------- | ||
| 33 | # | ||
| 34 | |||
| 35 | # required ffmpeg library versions | ||
| 36 | set(REQUIRED_FFMPEG_VERSION 3.1) | ||
| 37 | set(_avcodec_ver ">=57.48.101") | ||
| 38 | set(_avfilter_ver ">=6.47.100") | ||
| 39 | set(_avformat_ver ">=57.41.100") | ||
| 40 | set(_avutil_ver ">=55.28.100") | ||
| 41 | set(_swscale_ver ">=4.1.100") | ||
| 42 | set(_swresample_ver ">=2.1.100") | ||
| 43 | set(_postproc_ver ">=54.0.100") | ||
| 44 | |||
| 45 | |||
| 46 | # Allows building with external ffmpeg not found in system paths, | ||
| 47 | # without library version checks | ||
| 48 | if(WITH_FFMPEG) | ||
| 49 | set(FFMPEG_PATH ${WITH_FFMPEG}) | ||
| 50 | message(STATUS "Warning: FFmpeg version checking disabled") | ||
| 51 | set(REQUIRED_FFMPEG_VERSION undef) | ||
| 52 | unset(_avcodec_ver) | ||
| 53 | unset(_avfilter_ver) | ||
| 54 | unset(_avformat_ver) | ||
| 55 | unset(_avutil_ver) | ||
| 56 | unset(_swscale_ver) | ||
| 57 | unset(_swresample_ver) | ||
| 58 | unset(_postproc_ver) | ||
| 59 | endif() | ||
| 60 | |||
| 61 | # Allows building with external ffmpeg not found in system paths, | ||
| 62 | # with library version checks | ||
| 63 | if(FFMPEG_PATH) | ||
| 64 | set(ENABLE_INTERNAL_FFMPEG OFF) | ||
| 65 | endif() | ||
| 66 | |||
| 67 | # external FFMPEG | ||
| 68 | if(NOT ENABLE_INTERNAL_FFMPEG OR CMAKE_CROSSCOMPILING) | ||
| 69 | if(FFMPEG_PATH) | ||
| 70 | set(ENV{PKG_CONFIG_PATH} "${FFMPEG_PATH}/lib/pkgconfig") | ||
| 71 | list(APPEND CMAKE_PREFIX_PATH ${FFMPEG_PATH}) | ||
| 72 | endif() | ||
| 73 | |||
| 74 | set(FFMPEG_PKGS libavcodec${_avcodec_ver} | ||
| 75 | libavfilter${_avfilter_ver} | ||
| 76 | libavformat${_avformat_ver} | ||
| 77 | libavutil${_avutil_ver} | ||
| 78 | libswscale${_swscale_ver} | ||
| 79 | libswresample${_swresample_ver} | ||
| 80 | libpostproc${_postproc_ver}) | ||
| 81 | |||
| 82 | if(PKG_CONFIG_FOUND) | ||
| 83 | pkg_check_modules(PC_FFMPEG ${FFMPEG_PKGS} QUIET) | ||
| 84 | string(REGEX REPLACE "framework;" "framework " PC_FFMPEG_LDFLAGS "${PC_FFMPEG_LDFLAGS}") | ||
| 85 | endif() | ||
| 86 | |||
| 87 | find_path(FFMPEG_INCLUDE_DIRS libavcodec/avcodec.h libavfilter/avfilter.h libavformat/avformat.h | ||
| 88 | libavutil/avutil.h libswscale/swscale.h libpostproc/postprocess.h | ||
| 89 | PATH_SUFFIXES ffmpeg | ||
| 90 | PATHS ${PC_FFMPEG_INCLUDE_DIRS} | ||
| 91 | NO_DEFAULT_PATH) | ||
| 92 | find_path(FFMPEG_INCLUDE_DIRS libavcodec/avcodec.h libavfilter/avfilter.h libavformat/avformat.h | ||
| 93 | libavutil/avutil.h libswscale/swscale.h libpostproc/postprocess.h) | ||
| 94 | |||
| 95 | find_library(FFMPEG_LIBAVCODEC | ||
| 96 | NAMES avcodec libavcodec | ||
| 97 | PATH_SUFFIXES ffmpeg/libavcodec | ||
| 98 | PATHS ${PC_FFMPEG_libavcodec_LIBDIR} | ||
| 99 | NO_DEFAULT_PATH) | ||
| 100 | find_library(FFMPEG_LIBAVCODEC NAMES avcodec libavcodec PATH_SUFFIXES ffmpeg/libavcodec) | ||
| 101 | |||
| 102 | find_library(FFMPEG_LIBAVFILTER | ||
| 103 | NAMES avfilter libavfilter | ||
| 104 | PATH_SUFFIXES ffmpeg/libavfilter | ||
| 105 | PATHS ${PC_FFMPEG_libavfilter_LIBDIR} | ||
| 106 | NO_DEFAULT_PATH) | ||
| 107 | find_library(FFMPEG_LIBAVFILTER NAMES avfilter libavfilter PATH_SUFFIXES ffmpeg/libavfilter) | ||
| 108 | |||
| 109 | find_library(FFMPEG_LIBAVFORMAT | ||
| 110 | NAMES avformat libavformat | ||
| 111 | PATH_SUFFIXES ffmpeg/libavformat | ||
| 112 | PATHS ${PC_FFMPEG_libavformat_LIBDIR} | ||
| 113 | NO_DEFAULT_PATH) | ||
| 114 | find_library(FFMPEG_LIBAVFORMAT NAMES avformat libavformat PATH_SUFFIXES ffmpeg/libavformat) | ||
| 115 | |||
| 116 | find_library(FFMPEG_LIBAVUTIL | ||
| 117 | NAMES avutil libavutil | ||
| 118 | PATH_SUFFIXES ffmpeg/libavutil | ||
| 119 | PATHS ${PC_FFMPEG_libavutil_LIBDIR} | ||
| 120 | NO_DEFAULT_PATH) | ||
| 121 | find_library(FFMPEG_LIBAVUTIL NAMES avutil libavutil PATH_SUFFIXES ffmpeg/libavutil) | ||
| 122 | |||
| 123 | find_library(FFMPEG_LIBSWSCALE | ||
| 124 | NAMES swscale libswscale | ||
| 125 | PATH_SUFFIXES ffmpeg/libswscale | ||
| 126 | PATHS ${PC_FFMPEG_libswscale_LIBDIR} | ||
| 127 | NO_DEFAULT_PATH) | ||
| 128 | find_library(FFMPEG_LIBSWSCALE NAMES swscale libswscale PATH_SUFFIXES ffmpeg/libswscale) | ||
| 129 | |||
| 130 | find_library(FFMPEG_LIBSWRESAMPLE | ||
| 131 | NAMES swresample libswresample | ||
| 132 | PATH_SUFFIXES ffmpeg/libswresample | ||
| 133 | PATHS ${PC_FFMPEG_libswresample_LIBDIR} | ||
| 134 | NO_DEFAULT_PATH) | ||
| 135 | find_library(FFMPEG_LIBSWRESAMPLE NAMES NAMES swresample libswresample PATH_SUFFIXES ffmpeg/libswresample) | ||
| 136 | |||
| 137 | find_library(FFMPEG_LIBPOSTPROC | ||
| 138 | NAMES postproc libpostproc | ||
| 139 | PATH_SUFFIXES ffmpeg/libpostproc | ||
| 140 | PATHS ${PC_FFMPEG_libpostproc_LIBDIR} | ||
| 141 | NO_DEFAULT_PATH) | ||
| 142 | find_library(FFMPEG_LIBPOSTPROC NAMES postproc libpostproc PATH_SUFFIXES ffmpeg/libpostproc) | ||
| 143 | |||
| 144 | if((PC_FFMPEG_FOUND | ||
| 145 | AND PC_FFMPEG_libavcodec_VERSION | ||
| 146 | AND PC_FFMPEG_libavfilter_VERSION | ||
| 147 | AND PC_FFMPEG_libavformat_VERSION | ||
| 148 | AND PC_FFMPEG_libavutil_VERSION | ||
| 149 | AND PC_FFMPEG_libswscale_VERSION | ||
| 150 | AND PC_FFMPEG_libswresample_VERSION | ||
| 151 | AND PC_FFMPEG_libpostproc_VERSION) | ||
| 152 | OR WIN32) | ||
| 153 | set(FFMPEG_VERSION ${REQUIRED_FFMPEG_VERSION}) | ||
| 154 | |||
| 155 | |||
| 156 | include(FindPackageHandleStandardArgs) | ||
| 157 | find_package_handle_standard_args(FFMPEG | ||
| 158 | VERSION_VAR FFMPEG_VERSION | ||
| 159 | REQUIRED_VARS FFMPEG_INCLUDE_DIRS | ||
| 160 | FFMPEG_LIBAVCODEC | ||
| 161 | FFMPEG_LIBAVFILTER | ||
| 162 | FFMPEG_LIBAVFORMAT | ||
| 163 | FFMPEG_LIBAVUTIL | ||
| 164 | FFMPEG_LIBSWSCALE | ||
| 165 | FFMPEG_LIBSWRESAMPLE | ||
| 166 | FFMPEG_LIBPOSTPROC | ||
| 167 | FFMPEG_VERSION | ||
| 168 | FAIL_MESSAGE "FFmpeg ${REQUIRED_FFMPEG_VERSION} not found, please consider using -DENABLE_INTERNAL_FFMPEG=ON") | ||
| 169 | |||
| 170 | else() | ||
| 171 | message(STATUS "FFmpeg ${REQUIRED_FFMPEG_VERSION} not found, falling back to internal build") | ||
| 172 | unset(FFMPEG_INCLUDE_DIRS) | ||
| 173 | unset(FFMPEG_INCLUDE_DIRS CACHE) | ||
| 174 | unset(FFMPEG_LIBRARIES) | ||
| 175 | unset(FFMPEG_LIBRARIES CACHE) | ||
| 176 | unset(FFMPEG_DEFINITIONS) | ||
| 177 | unset(FFMPEG_DEFINITIONS CACHE) | ||
| 178 | endif() | ||
| 179 | |||
| 180 | if(FFMPEG_FOUND) | ||
| 181 | set(FFMPEG_LDFLAGS ${PC_FFMPEG_LDFLAGS} CACHE STRING "ffmpeg linker flags") | ||
| 182 | |||
| 183 | # check if ffmpeg libs are statically linked | ||
| 184 | set(FFMPEG_LIB_TYPE SHARED) | ||
| 185 | foreach(_fflib IN LISTS FFMPEG_LIBRARIES) | ||
| 186 | if(${_fflib} MATCHES ".+\.a$" AND PC_FFMPEG_STATIC_LDFLAGS) | ||
| 187 | set(FFMPEG_LDFLAGS ${PC_FFMPEG_STATIC_LDFLAGS} CACHE STRING "ffmpeg linker flags" FORCE) | ||
| 188 | set(FFMPEG_LIB_TYPE STATIC) | ||
| 189 | break() | ||
| 190 | endif() | ||
| 191 | endforeach() | ||
| 192 | |||
| 193 | set(FFMPEG_LIBRARIES ${FFMPEG_LIBAVCODEC} ${FFMPEG_LIBAVFILTER} | ||
| 194 | ${FFMPEG_LIBAVFORMAT} ${FFMPEG_LIBAVUTIL} | ||
| 195 | ${FFMPEG_LIBSWSCALE} ${FFMPEG_LIBSWRESAMPLE} | ||
| 196 | ${FFMPEG_LIBPOSTPROC} ${FFMPEG_LDFLAGS}) | ||
| 197 | list(APPEND FFMPEG_DEFINITIONS -DFFMPEG_VER_SHA=\"${FFMPEG_VERSION}\") | ||
| 198 | |||
| 199 | if(NOT TARGET ffmpeg) | ||
| 200 | add_library(ffmpeg ${FFMPEG_LIB_TYPE} IMPORTED) | ||
| 201 | set_target_properties(ffmpeg PROPERTIES | ||
| 202 | FOLDER "External Projects" | ||
| 203 | IMPORTED_LOCATION "${FFMPEG_LIBRARIES}" | ||
| 204 | INTERFACE_INCLUDE_DIRECTORIES "${FFMPEG_INCLUDE_DIRS}" | ||
| 205 | INTERFACE_LINK_LIBRARIES "${FFMPEG_LDFLAGS}" | ||
| 206 | INTERFACE_COMPILE_DEFINITIONS "${FFMPEG_DEFINITIONS}") | ||
| 207 | endif() | ||
| 208 | endif() | ||
| 209 | endif() | ||
| 210 | |||
| 211 | # Internal FFMPEG | ||
| 212 | if(NOT FFMPEG_FOUND) | ||
| 213 | include(ExternalProject) | ||
| 214 | file(STRINGS ${CORE_SOURCE_DIR}/tools/depends/target/ffmpeg/FFMPEG-VERSION VER) | ||
| 215 | string(REGEX MATCH "VERSION=[^ ]*$.*" FFMPEG_VER "${VER}") | ||
| 216 | list(GET FFMPEG_VER 0 FFMPEG_VER) | ||
| 217 | string(SUBSTRING "${FFMPEG_VER}" 8 -1 FFMPEG_VER) | ||
| 218 | string(REGEX MATCH "BASE_URL=([^ ]*)" FFMPEG_BASE_URL "${VER}") | ||
| 219 | list(GET FFMPEG_BASE_URL 0 FFMPEG_BASE_URL) | ||
| 220 | string(SUBSTRING "${FFMPEG_BASE_URL}" 9 -1 FFMPEG_BASE_URL) | ||
| 221 | |||
| 222 | # allow user to override the download URL with a local tarball | ||
| 223 | # needed for offline build envs | ||
| 224 | if(FFMPEG_URL) | ||
| 225 | get_filename_component(FFMPEG_URL "${FFMPEG_URL}" ABSOLUTE) | ||
| 226 | else() | ||
| 227 | set(FFMPEG_URL ${FFMPEG_BASE_URL}/${FFMPEG_VER}.tar.gz) | ||
| 228 | endif() | ||
| 229 | if(VERBOSE) | ||
| 230 | message(STATUS "FFMPEG_URL: ${FFMPEG_URL}") | ||
| 231 | endif() | ||
| 232 | |||
| 233 | if(CMAKE_CROSSCOMPILING) | ||
| 234 | set(CROSS_ARGS -DDEPENDS_PATH=${DEPENDS_PATH} | ||
| 235 | -DPKG_CONFIG_EXECUTABLE=${PKG_CONFIG_EXECUTABLE} | ||
| 236 | -DCROSSCOMPILING=${CMAKE_CROSSCOMPILING} | ||
| 237 | -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} | ||
| 238 | -DCORE_SYSTEM_NAME=${CORE_SYSTEM_NAME} | ||
| 239 | -DCPU=${WITH_CPU} | ||
| 240 | -DOS=${OS} | ||
| 241 | -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} | ||
| 242 | -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} | ||
| 243 | -DCMAKE_AR=${CMAKE_AR} | ||
| 244 | -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS} | ||
| 245 | -DCMAKE_EXE_LINKER_FLAGS=${CMAKE_EXE_LINKER_FLAGS}) | ||
| 246 | endif() | ||
| 247 | |||
| 248 | externalproject_add(ffmpeg | ||
| 249 | URL ${FFMPEG_URL} | ||
| 250 | DOWNLOAD_NAME ffmpeg-${FFMPEG_VER}.tar.gz | ||
| 251 | DOWNLOAD_DIR ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/download | ||
| 252 | PREFIX ${CORE_BUILD_DIR}/ffmpeg | ||
| 253 | CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR} | ||
| 254 | -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} | ||
| 255 | -DFFMPEG_VER=${FFMPEG_VER} | ||
| 256 | -DCORE_SYSTEM_NAME=${CORE_SYSTEM_NAME} | ||
| 257 | ${CROSS_ARGS} | ||
| 258 | PATCH_COMMAND ${CMAKE_COMMAND} -E copy | ||
| 259 | ${CORE_SOURCE_DIR}/tools/depends/target/ffmpeg/CMakeLists.txt | ||
| 260 | <SOURCE_DIR> && | ||
| 261 | ${CMAKE_COMMAND} -E copy | ||
| 262 | ${CORE_SOURCE_DIR}/tools/depends/target/ffmpeg/FindGnuTls.cmake | ||
| 263 | <SOURCE_DIR>) | ||
| 264 | |||
| 265 | file(WRITE ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/ffmpeg/ffmpeg-link-wrapper | ||
| 266 | "#!/bin/bash | ||
| 267 | if [[ $@ == *${APP_NAME_LC}.bin* || $@ == *${APP_NAME_LC}.so* || $@ == *${APP_NAME_LC}-test* ]] | ||
| 268 | then | ||
| 269 | avformat=`PKG_CONFIG_PATH=${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/lib/pkgconfig ${PKG_CONFIG_EXECUTABLE} --libs --static libavcodec` | ||
| 270 | avcodec=`PKG_CONFIG_PATH=${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/lib/pkgconfig ${PKG_CONFIG_EXECUTABLE} --libs --static libavformat` | ||
| 271 | avfilter=`PKG_CONFIG_PATH=${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/lib/pkgconfig ${PKG_CONFIG_EXECUTABLE} --libs --static libavfilter` | ||
| 272 | avutil=`PKG_CONFIG_PATH=${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/lib/pkgconfig ${PKG_CONFIG_EXECUTABLE} --libs --static libavutil` | ||
| 273 | swscale=`PKG_CONFIG_PATH=${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/lib/pkgconfig ${PKG_CONFIG_EXECUTABLE} --libs --static libswscale` | ||
| 274 | swresample=`PKG_CONFIG_PATH=${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/lib/pkgconfig ${PKG_CONFIG_EXECUTABLE} --libs --static libswresample` | ||
| 275 | gnutls=`PKG_CONFIG_PATH=${DEPENDS_PATH}/lib/pkgconfig/ ${PKG_CONFIG_EXECUTABLE} --libs-only-l --static --silence-errors gnutls` | ||
| 276 | $@ $avcodec $avformat $avcodec $avfilter $swscale $swresample -lpostproc $gnutls | ||
| 277 | else | ||
| 278 | $@ | ||
| 279 | fi") | ||
| 280 | file(COPY ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/ffmpeg/ffmpeg-link-wrapper | ||
| 281 | DESTINATION ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR} | ||
| 282 | FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE) | ||
| 283 | set(FFMPEG_LINK_EXECUTABLE "${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/ffmpeg-link-wrapper <CMAKE_CXX_COMPILER> <FLAGS> <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>" PARENT_SCOPE) | ||
| 284 | set(FFMPEG_CREATE_SHARED_LIBRARY "${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/ffmpeg-link-wrapper <CMAKE_CXX_COMPILER> <CMAKE_SHARED_LIBRARY_CXX_FLAGS> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS> <SONAME_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>" PARENT_SCOPE) | ||
| 285 | set(FFMPEG_INCLUDE_DIRS ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/include) | ||
| 286 | list(APPEND FFMPEG_DEFINITIONS -DFFMPEG_VER_SHA=\"${FFMPEG_VER}\" | ||
| 287 | -DUSE_STATIC_FFMPEG=1) | ||
| 288 | set(FFMPEG_FOUND 1) | ||
| 289 | set_target_properties(ffmpeg PROPERTIES FOLDER "External Projects") | ||
| 290 | endif() | ||
| 291 | |||
| 292 | mark_as_advanced(FFMPEG_INCLUDE_DIRS FFMPEG_LIBRARIES FFMPEG_LDFLAGS FFMPEG_DEFINITIONS FFMPEG_FOUND) | ||
diff --git a/project/cmake/modules/FindFreeType.cmake b/project/cmake/modules/FindFreeType.cmake deleted file mode 100644 index fb4c668..0000000 --- a/project/cmake/modules/FindFreeType.cmake +++ /dev/null | |||
| @@ -1,45 +0,0 @@ | |||
| 1 | #.rst: | ||
| 2 | # FindFreetype | ||
| 3 | # ------------ | ||
| 4 | # Finds the FreeType library | ||
| 5 | # | ||
| 6 | # This will will define the following variables:: | ||
| 7 | # | ||
| 8 | # FREETYPE_FOUND - system has FreeType | ||
| 9 | # FREETYPE_INCLUDE_DIRS - the FreeType include directory | ||
| 10 | # FREETYPE_LIBRARIES - the FreeType libraries | ||
| 11 | # | ||
| 12 | # and the following imported targets:: | ||
| 13 | # | ||
| 14 | # FreeType::FreeType - The FreeType library | ||
| 15 | |||
| 16 | if(PKG_CONFIG_FOUND) | ||
| 17 | pkg_check_modules(PC_FREETYPE freetype2 QUIET) | ||
| 18 | endif() | ||
| 19 | |||
| 20 | find_path(FREETYPE_INCLUDE_DIR NAMES freetype/freetype.h freetype.h | ||
| 21 | PATHS ${PC_FREETYPE_INCLUDEDIR} | ||
| 22 | ${PC_FREETYPE_INCLUDE_DIRS}) | ||
| 23 | find_library(FREETYPE_LIBRARY NAMES freetype freetype246MT | ||
| 24 | PATHS ${PC_FREETYPE_LIBDIR}) | ||
| 25 | |||
| 26 | set(FREETYPE_VERSION ${PC_FREETYPE_VERSION}) | ||
| 27 | |||
| 28 | include(FindPackageHandleStandardArgs) | ||
| 29 | find_package_handle_standard_args(FreeType | ||
| 30 | REQUIRED_VARS FREETYPE_LIBRARY FREETYPE_INCLUDE_DIR | ||
| 31 | VERSION_VAR FREETYPE_VERSION) | ||
| 32 | |||
| 33 | if(FREETYPE_FOUND) | ||
| 34 | set(FREETYPE_LIBRARIES ${FREETYPE_LIBRARY}) | ||
| 35 | set(FREETYPE_INCLUDE_DIRS ${FREETYPE_INCLUDE_DIR}) | ||
| 36 | |||
| 37 | if(NOT TARGET FreeType::FreeType) | ||
| 38 | add_library(FreeType::FreeType UNKNOWN IMPORTED) | ||
| 39 | set_target_properties(FreeType::FreeType PROPERTIES | ||
| 40 | IMPORTED_LOCATION "${FREETYPE_LIBRARY}" | ||
| 41 | INTERFACE_INCLUDE_DIRECTORIES "${FREETYPE_INCLUDE_DIR}") | ||
| 42 | endif() | ||
| 43 | endif() | ||
| 44 | |||
| 45 | mark_as_advanced(FREETYPE_INCLUDE_DIR FREETYPE_LIBRARY) | ||
diff --git a/project/cmake/modules/FindFribidi.cmake b/project/cmake/modules/FindFribidi.cmake deleted file mode 100644 index dcaeb48..0000000 --- a/project/cmake/modules/FindFribidi.cmake +++ /dev/null | |||
| @@ -1,48 +0,0 @@ | |||
| 1 | #.rst: | ||
| 2 | # FindFribidi | ||
| 3 | # ----------- | ||
| 4 | # Finds the GNU FriBidi library | ||
| 5 | # | ||
| 6 | # This will will define the following variables:: | ||
| 7 | # | ||
| 8 | # FRIBIDI_FOUND - system has FriBidi | ||
| 9 | # FRIBIDI_INCLUDE_DIRS - the FriBidi include directory | ||
| 10 | # FRIBIDI_LIBRARIES - the FriBidi libraries | ||
| 11 | # | ||
| 12 | # and the following imported targets:: | ||
| 13 | # | ||
| 14 | # FriBidi::FriBidi - The FriBidi library | ||
| 15 | |||
| 16 | if(PKG_CONFIG_FOUND) | ||
| 17 | pkg_check_modules(PC_FRIBIDI fribidi QUIET) | ||
| 18 | endif() | ||
| 19 | |||
| 20 | find_path(FRIBIDI_INCLUDE_DIR NAMES fribidi/fribidi.h | ||
| 21 | PATHS ${PC_FRIBIDI_INCLUDEDIR}) | ||
| 22 | find_library(FRIBIDI_LIBRARY NAMES fribidi libfribidi | ||
| 23 | PATHS ${PC_FRIBIDI_LIBDIR}) | ||
| 24 | |||
| 25 | set(FRIBIDI_VERSION ${PC_FRIBIDI_VERSION}) | ||
| 26 | |||
| 27 | include(FindPackageHandleStandardArgs) | ||
| 28 | find_package_handle_standard_args(FriBidi | ||
| 29 | REQUIRED_VARS FRIBIDI_LIBRARY FRIBIDI_INCLUDE_DIR | ||
| 30 | VERSION_VAR FRIBIDI_VERSION) | ||
| 31 | |||
| 32 | if(FRIBIDI_FOUND) | ||
| 33 | set(FRIBIDI_LIBRARIES ${FRIBIDI_LIBRARY}) | ||
| 34 | set(FRIBIDI_INCLUDE_DIRS ${FRIBIDI_INCLUDE_DIR}) | ||
| 35 | if(PC_FRIBIDI_CFLAGS) | ||
| 36 | set(FRIBIDI_DEFINITIONS ${PC_FRIBIDI_CFLAGS}) | ||
| 37 | endif() | ||
| 38 | |||
| 39 | if(NOT TARGET FriBidi::FriBidi) | ||
| 40 | add_library(FriBidi::FriBidi UNKNOWN IMPORTED) | ||
| 41 | set_target_properties(FriBidi::FriBidi PROPERTIES | ||
| 42 | IMPORTED_LOCATION "${FRIBIDI_LIBRARY}" | ||
| 43 | INTERFACE_INCLUDE_DIRECTORIES "${FRIBIDI_INCLUDE_DIR}" | ||
| 44 | INTERFACE_COMPILE_OPTIONS "${FRIBIDI_DEFINITIONS}") | ||
| 45 | endif() | ||
| 46 | endif() | ||
| 47 | |||
| 48 | mark_as_advanced(FRIBIDI_INCLUDE_DIR FRIBIDI_LIBRARY) | ||
diff --git a/project/cmake/modules/FindGIF.cmake b/project/cmake/modules/FindGIF.cmake deleted file mode 100644 index 8649bd4..0000000 --- a/project/cmake/modules/FindGIF.cmake +++ /dev/null | |||
| @@ -1,46 +0,0 @@ | |||
| 1 | #.rst: | ||
| 2 | # FindGIF | ||
| 3 | # ------- | ||
| 4 | # Finds the libgif library | ||
| 5 | # | ||
| 6 | # This will will define the following variables:: | ||
| 7 | # | ||
| 8 | # GIF_FOUND - system has libgif | ||
| 9 | # GIF_INCLUDE_DIRS - the libgif include directory | ||
| 10 | # GIF_LIBRARIES - the libgif libraries | ||
| 11 | # | ||
| 12 | # and the following imported targets:: | ||
| 13 | # | ||
| 14 | # GIF::GIF - The libgif library | ||
| 15 | |||
| 16 | find_path(GIF_INCLUDE_DIR gif_lib.h) | ||
| 17 | |||
| 18 | include(FindPackageHandleStandardArgs) | ||
| 19 | if(NOT WIN32) | ||
| 20 | find_library(GIF_LIBRARY NAMES gif) | ||
| 21 | find_package_handle_standard_args(GIF | ||
| 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 | |||
| 29 | if(GIF_FOUND) | ||
| 30 | set(GIF_LIBRARIES ${GIF_LIBRARY}) | ||
| 31 | set(GIF_INCLUDE_DIRS ${GIF_INCLUDE_DIR}) | ||
| 32 | set(GIF_DEFINITIONS -DHAVE_LIBGIF=1) | ||
| 33 | |||
| 34 | if(NOT TARGET GIF::GIF) | ||
| 35 | add_library(GIF::GIF UNKNOWN IMPORTED) | ||
| 36 | if(GIF_LIBRARY) | ||
| 37 | set_target_properties(GIF::GIF PROPERTIES | ||
| 38 | IMPORTED_LOCATION "${GIF_LIBRARY}") | ||
| 39 | endif() | ||
| 40 | set_target_properties(GIF::GIF PROPERTIES | ||
| 41 | INTERFACE_INCLUDE_DIRECTORIES "${GIF_INCLUDE_DIR}" | ||
| 42 | INTERFACE_COMPILE_DEFINITIONS HAVE_LIBGIF=1) | ||
| 43 | endif() | ||
| 44 | endif() | ||
| 45 | |||
| 46 | mark_as_advanced(GIF_INCLUDE_DIR GIF_LIBRARY) | ||
diff --git a/project/cmake/modules/FindJsonSchemaBuilder.cmake b/project/cmake/modules/FindJsonSchemaBuilder.cmake deleted file mode 100644 index ecff1e4..0000000 --- a/project/cmake/modules/FindJsonSchemaBuilder.cmake +++ /dev/null | |||
| @@ -1,21 +0,0 @@ | |||
| 1 | #.rst: | ||
| 2 | # FindJsonSchemaBuilder | ||
| 3 | # --------------------- | ||
| 4 | # Finds the JsonSchemaBuilder | ||
| 5 | # | ||
| 6 | # This will define the following (imported) targets:: | ||
| 7 | # | ||
| 8 | # JsonSchemaBuilder::JsonSchemaBuilder - The JsonSchemaBuilder executable | ||
| 9 | |||
| 10 | if(NOT TARGET JsonSchemaBuilder::JsonSchemaBuilder) | ||
| 11 | if(CMAKE_CROSSCOMPILING) | ||
| 12 | add_executable(JsonSchemaBuilder::JsonSchemaBuilder IMPORTED GLOBAL) | ||
| 13 | set_target_properties(JsonSchemaBuilder::JsonSchemaBuilder PROPERTIES | ||
| 14 | IMPORTED_LOCATION "${NATIVEPREFIX}/bin/JsonSchemaBuilder") | ||
| 15 | set_target_properties(JsonSchemaBuilder::JsonSchemaBuilder PROPERTIES FOLDER Tools) | ||
| 16 | else() | ||
| 17 | add_subdirectory(${CORE_SOURCE_DIR}/tools/depends/native/JsonSchemaBuilder build/jsonschemabuilder) | ||
| 18 | add_executable(JsonSchemaBuilder::JsonSchemaBuilder ALIAS JsonSchemaBuilder) | ||
| 19 | set_target_properties(JsonSchemaBuilder PROPERTIES FOLDER Tools) | ||
| 20 | endif() | ||
| 21 | endif() | ||
diff --git a/project/cmake/modules/FindLibDRM.cmake b/project/cmake/modules/FindLibDRM.cmake deleted file mode 100644 index 35d632e..0000000 --- a/project/cmake/modules/FindLibDRM.cmake +++ /dev/null | |||
| @@ -1,45 +0,0 @@ | |||
| 1 | #.rst: | ||
| 2 | # FindLibDRM | ||
| 3 | # ---------- | ||
| 4 | # Finds the LibDRM library | ||
| 5 | # | ||
| 6 | # This will will define the following variables:: | ||
| 7 | # | ||
| 8 | # LIBDRM_FOUND - system has LibDRM | ||
| 9 | # LIBDRM_INCLUDE_DIRS - the LibDRM include directory | ||
| 10 | # LIBDRM_LIBRARIES - the LibDRM libraries | ||
| 11 | # | ||
| 12 | # and the following imported targets:: | ||
| 13 | # | ||
| 14 | # LibDRM::LibDRM - The LibDRM library | ||
| 15 | |||
| 16 | if(PKG_CONFIG_FOUND) | ||
| 17 | pkg_check_modules(PC_LIBDRM libdrm QUIET) | ||
| 18 | endif() | ||
| 19 | |||
| 20 | find_path(LIBDRM_INCLUDE_DIR NAMES drm.h | ||
| 21 | PATH_SUFFIXES libdrm drm | ||
| 22 | PATHS ${PC_LIBDRM_INCLUDEDIR}) | ||
| 23 | find_library(LIBDRM_LIBRARY NAMES drm | ||
| 24 | PATHS ${PC_LIBDRM_LIBDIR}) | ||
| 25 | |||
| 26 | set(LIBDRM_VERSION ${PC_LIBDRM_VERSION}) | ||
| 27 | |||
| 28 | include(FindPackageHandleStandardArgs) | ||
| 29 | find_package_handle_standard_args(LibDRM | ||
| 30 | REQUIRED_VARS LIBDRM_LIBRARY LIBDRM_INCLUDE_DIR | ||
| 31 | VERSION_VAR LIBDRM_VERSION) | ||
| 32 | |||
| 33 | if(LIBDRM_FOUND) | ||
| 34 | set(LIBDRM_LIBRARIES ${LIBDRM_LIBRARY}) | ||
| 35 | set(LIBDRM_INCLUDE_DIRS ${LIBDRM_INCLUDE_DIR}) | ||
| 36 | |||
| 37 | if(NOT TARGET LIBDRM::LIBDRM) | ||
| 38 | add_library(LIBDRM::LIBDRM UNKNOWN IMPORTED) | ||
| 39 | set_target_properties(LIBDRM::LIBDRM PROPERTIES | ||
| 40 | IMPORTED_LOCATION "${LIBDRM_LIBRARY}" | ||
| 41 | INTERFACE_INCLUDE_DIRECTORIES "${LIBDRM_INCLUDE_DIR}") | ||
| 42 | endif() | ||
| 43 | endif() | ||
| 44 | |||
| 45 | mark_as_advanced(LIBDRM_INCLUDE_DIR LIBDRM_LIBRARY) | ||
diff --git a/project/cmake/modules/FindLibDvd.cmake b/project/cmake/modules/FindLibDvd.cmake deleted file mode 100644 index fa644d6..0000000 --- a/project/cmake/modules/FindLibDvd.cmake +++ /dev/null | |||
| @@ -1,219 +0,0 @@ | |||
| 1 | if(NOT WIN32) | ||
| 2 | if(CMAKE_CROSSCOMPILING) | ||
| 3 | set(_dvdlibs dvdread dvdnav) | ||
| 4 | set(_handlevars LIBDVD_INCLUDE_DIRS DVDREAD_LIBRARY DVDNAV_LIBRARY) | ||
| 5 | if(ENABLE_DVDCSS) | ||
| 6 | list(APPEND _dvdlibs libdvdcss) | ||
| 7 | list(APPEND _handlevars DVDCSS_LIBRARY) | ||
| 8 | endif() | ||
| 9 | |||
| 10 | if(PKG_CONFIG_FOUND) | ||
| 11 | pkg_check_modules(PC_DVD ${_dvdlibs} QUIET) | ||
| 12 | endif() | ||
| 13 | |||
| 14 | find_path(LIBDVD_INCLUDE_DIRS dvdnav/dvdnav.h PATHS ${PC_DVD_INCLUDE_DIRS}) | ||
| 15 | find_library(DVDREAD_LIBRARY NAMES dvdread libdvdread PATHS ${PC_DVD_dvdread_LIBDIR}) | ||
| 16 | find_library(DVDNAV_LIBRARY NAMES dvdnav libdvdnav PATHS ${PC_DVD_dvdnav_LIBDIR}) | ||
| 17 | if(ENABLE_DVDCSS) | ||
| 18 | find_library(DVDCSS_LIBRARY NAMES dvdcss libdvdcss PATHS ${PC_DVD_libdvdcss_LIBDIR}) | ||
| 19 | endif() | ||
| 20 | |||
| 21 | include(FindPackageHandleStandardArgs) | ||
| 22 | find_package_handle_standard_args(LIBDVD REQUIRED_VARS ${_handlevars}) | ||
| 23 | if(LIBDVD_FOUND) | ||
| 24 | add_library(dvdnav UNKNOWN IMPORTED) | ||
| 25 | set_target_properties(dvdnav PROPERTIES | ||
| 26 | FOLDER "External Projects" | ||
| 27 | IMPORTED_LOCATION "${DVDNAV_LIBRARY}") | ||
| 28 | |||
| 29 | add_library(dvdread UNKNOWN IMPORTED) | ||
| 30 | set_target_properties(dvdread PROPERTIES | ||
| 31 | FOLDER "External Projects" | ||
| 32 | IMPORTED_LOCATION "${DVDREAD_LIBRARY}") | ||
| 33 | add_library(dvdcss UNKNOWN IMPORTED) | ||
| 34 | set_target_properties(dvdcss PROPERTIES | ||
| 35 | FOLDER "External Projects" | ||
| 36 | IMPORTED_LOCATION "${DVDCSS_LIBRARY}") | ||
| 37 | |||
| 38 | set(_linklibs ${DVDREAD_LIBRARY}) | ||
| 39 | if(ENABLE_DVDCSS) | ||
| 40 | list(APPEND _linklibs ${DVDCSS_LIBRARY}) | ||
| 41 | endif() | ||
| 42 | core_link_library(${DVDNAV_LIBRARY} system/players/VideoPlayer/libdvdnav dvdnav archives "${_linklibs}") | ||
| 43 | set(LIBDVD_LIBRARIES ${DVDNAV_LIBRARY}) | ||
| 44 | mark_as_advanced(LIBDVD_INCLUDE_DIRS LIBDVD_LIBRARIES) | ||
| 45 | endif() | ||
| 46 | else() | ||
| 47 | set(dvdlibs libdvdread libdvdnav) | ||
| 48 | if(ENABLE_DVDCSS) | ||
| 49 | list(APPEND dvdlibs libdvdcss) | ||
| 50 | endif() | ||
| 51 | foreach(dvdlib ${dvdlibs}) | ||
| 52 | file(GLOB VERSION_FILE ${CORE_SOURCE_DIR}/tools/depends/target/${dvdlib}/DVD*-VERSION) | ||
| 53 | file(STRINGS ${VERSION_FILE} VER) | ||
| 54 | string(REGEX MATCH "VERSION=[^ ]*$.*" ${dvdlib}_VER "${VER}") | ||
| 55 | list(GET ${dvdlib}_VER 0 ${dvdlib}_VER) | ||
| 56 | string(SUBSTRING "${${dvdlib}_VER}" 8 -1 ${dvdlib}_VER) | ||
| 57 | string(REGEX MATCH "BASE_URL=([^ ]*)" ${dvdlib}_BASE_URL "${VER}") | ||
| 58 | list(GET ${dvdlib}_BASE_URL 0 ${dvdlib}_BASE_URL) | ||
| 59 | string(SUBSTRING "${${dvdlib}_BASE_URL}" 9 -1 ${dvdlib}_BASE_URL) | ||
| 60 | string(TOUPPER ${dvdlib} DVDLIB) | ||
| 61 | |||
| 62 | # allow user to override the download URL with a local tarball | ||
| 63 | # needed for offline build envs | ||
| 64 | # allow upper and lowercase var name | ||
| 65 | if(${dvdlib}_URL) | ||
| 66 | set(${DVDLIB}_URL ${${dvdlib}_URL}) | ||
| 67 | endif() | ||
| 68 | if(${DVDLIB}_URL) | ||
| 69 | get_filename_component(${DVDLIB}_URL "${${DVDLIB}_URL}" ABSOLUTE) | ||
| 70 | else() | ||
| 71 | set(${DVDLIB}_URL ${${dvdlib}_BASE_URL}/archive/${${dvdlib}_VER}.tar.gz) | ||
| 72 | endif() | ||
| 73 | if(VERBOSE) | ||
| 74 | message(STATUS "${DVDLIB}_URL: ${${DVDLIB}_URL}") | ||
| 75 | endif() | ||
| 76 | endforeach() | ||
| 77 | |||
| 78 | set(DVDREAD_CFLAGS "${DVDREAD_CFLAGS} -I${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/libdvd/include") | ||
| 79 | if(CMAKE_CROSSCOMPILING) | ||
| 80 | set(EXTRA_FLAGS "CC=${CMAKE_C_COMPILER}") | ||
| 81 | endif() | ||
| 82 | |||
| 83 | if(APPLE) | ||
| 84 | set(CMAKE_LD_FLAGS "-framework IOKit -framework CoreFoundation") | ||
| 85 | endif() | ||
| 86 | |||
| 87 | set(HOST_ARCH ${ARCH}) | ||
| 88 | if(CORE_SYSTEM_NAME STREQUAL android) | ||
| 89 | if(ARCH STREQUAL arm) | ||
| 90 | set(HOST_ARCH arm-linux-androideabi) | ||
| 91 | elseif(ARCH STREQUAL aarch64) | ||
| 92 | set(HOST_ARCH aarch64-linux-android) | ||
| 93 | elseif(ARCH STREQUAL i486-linux) | ||
| 94 | set(HOST_ARCH i686-linux-android) | ||
| 95 | endif() | ||
| 96 | endif() | ||
| 97 | |||
| 98 | if(ENABLE_DVDCSS) | ||
| 99 | set(DVDCSS_LIBRARY ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/libdvd/lib/libdvdcss.a) | ||
| 100 | ExternalProject_Add(dvdcss URL ${LIBDVDCSS_URL} | ||
| 101 | DOWNLOAD_NAME libdvdcss-${libdvdcss_VER}.tar.gz | ||
| 102 | DOWNLOAD_DIR ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/download | ||
| 103 | PREFIX ${CORE_BUILD_DIR}/libdvd | ||
| 104 | CONFIGURE_COMMAND ac_cv_path_GIT= <SOURCE_DIR>/configure | ||
| 105 | --target=${HOST_ARCH} | ||
| 106 | --host=${HOST_ARCH} | ||
| 107 | --disable-doc | ||
| 108 | --enable-static | ||
| 109 | --disable-shared | ||
| 110 | --with-pic | ||
| 111 | --prefix=<INSTALL_DIR> | ||
| 112 | --libdir=<INSTALL_DIR>/lib | ||
| 113 | "${EXTRA_FLAGS}" | ||
| 114 | "CFLAGS=${CMAKE_C_FLAGS} ${DVDREAD_CFLAGS}" | ||
| 115 | "LDFLAGS=${CMAKE_LD_FLAGS}" | ||
| 116 | BUILD_BYPRODUCTS ${DVDCSS_LIBRARY}) | ||
| 117 | ExternalProject_Add_Step(dvdcss autoreconf | ||
| 118 | DEPENDEES download update patch | ||
| 119 | DEPENDERS configure | ||
| 120 | COMMAND PATH=${NATIVEPREFIX}/bin:$ENV{PATH} autoreconf -vif | ||
| 121 | WORKING_DIRECTORY <SOURCE_DIR>) | ||
| 122 | |||
| 123 | set_target_properties(dvdcss PROPERTIES FOLDER "External Projects") | ||
| 124 | endif() | ||
| 125 | |||
| 126 | set(DVDREAD_CFLAGS "-D_XBMC") | ||
| 127 | if(ENABLE_DVDCSS) | ||
| 128 | set(DVDREAD_CFLAGS "${DVDREAD_CFLAGS} -DHAVE_DVDCSS_DVDCSS_H -I${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/libdvd/include") | ||
| 129 | endif() | ||
| 130 | |||
| 131 | set(DVDREAD_LIBRARY ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/libdvd/lib/libdvdread.a) | ||
| 132 | ExternalProject_Add(dvdread URL ${LIBDVDREAD_URL} | ||
| 133 | DOWNLOAD_NAME libdvdread-${libdvdread_VER}.tar.gz | ||
| 134 | DOWNLOAD_DIR ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/download | ||
| 135 | PREFIX ${CORE_BUILD_DIR}/libdvd | ||
| 136 | CONFIGURE_COMMAND ac_cv_path_GIT= <SOURCE_DIR>/configure | ||
| 137 | --target=${HOST_ARCH} | ||
| 138 | --host=${HOST_ARCH} | ||
| 139 | --enable-static | ||
| 140 | --disable-shared | ||
| 141 | --with-pic | ||
| 142 | --prefix=<INSTALL_DIR> | ||
| 143 | --libdir=<INSTALL_DIR>/lib | ||
| 144 | "${EXTRA_FLAGS}" | ||
| 145 | "CFLAGS=${CMAKE_C_FLAGS} ${DVDREAD_CFLAGS}" | ||
| 146 | "LDFLAGS=${CMAKE_LD_FLAGS}" | ||
| 147 | BUILD_BYPRODUCTS ${DVDREAD_LIBRARY}) | ||
| 148 | ExternalProject_Add_Step(dvdread autoreconf | ||
| 149 | DEPENDEES download update patch | ||
| 150 | DEPENDERS configure | ||
| 151 | COMMAND PATH=${NATIVEPREFIX}/bin:$ENV{PATH} autoreconf -vif | ||
| 152 | WORKING_DIRECTORY <SOURCE_DIR>) | ||
| 153 | if(ENABLE_DVDCSS) | ||
| 154 | add_dependencies(dvdread dvdcss) | ||
| 155 | endif() | ||
| 156 | |||
| 157 | set_target_properties(dvdread PROPERTIES FOLDER "External Projects") | ||
| 158 | |||
| 159 | if(ENABLE_DVDCSS) | ||
| 160 | set(DVDNAV_LIBS -ldvdcss) | ||
| 161 | endif() | ||
| 162 | |||
| 163 | set(DVDNAV_LIBRARY ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/libdvd/lib/libdvdnav.a) | ||
| 164 | ExternalProject_Add(dvdnav URL ${LIBDVDNAV_URL} | ||
| 165 | DOWNLOAD_NAME libdvdnav-${libdvdnav_VER}.tar.gz | ||
| 166 | DOWNLOAD_DIR ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/download | ||
| 167 | PREFIX ${CORE_BUILD_DIR}/libdvd | ||
| 168 | CONFIGURE_COMMAND ac_cv_path_GIT= <SOURCE_DIR>/configure | ||
| 169 | --target=${HOST_ARCH} | ||
| 170 | --host=${HOST_ARCH} | ||
| 171 | --enable-static | ||
| 172 | --disable-shared | ||
| 173 | --with-pic | ||
| 174 | --prefix=${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/libdvd | ||
| 175 | --libdir=${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/libdvd/lib | ||
| 176 | "${EXTRA_FLAGS}" | ||
| 177 | "LDFLAGS=${CMAKE_LD_FLAGS} -L${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/libdvd/lib" | ||
| 178 | "CFLAGS=${CMAKE_C_FLAGS} ${DVDREAD_CFLAGS}" | ||
| 179 | "DVDREAD_CFLAGS=${DVDREAD_CFLAGS}" | ||
| 180 | "DVDREAD_LIBS=${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/libdvd/lib/libdvdread.la" | ||
| 181 | "LIBS=${DVDNAV_LIBS}" | ||
| 182 | BUILD_BYPRODUCTS ${DVDNAV_LIBRARY}) | ||
| 183 | ExternalProject_Add_Step(dvdnav autoreconf | ||
| 184 | DEPENDEES download update patch | ||
| 185 | DEPENDERS configure | ||
| 186 | COMMAND PATH=${NATIVEPREFIX}/bin:$ENV{PATH} autoreconf -vif | ||
| 187 | WORKING_DIRECTORY <SOURCE_DIR>) | ||
| 188 | add_dependencies(dvdnav dvdread) | ||
| 189 | set_target_properties(dvdnav PROPERTIES FOLDER "External Projects") | ||
| 190 | |||
| 191 | set(_dvdlibs ${DVDREAD_LIBRARY} ${DVDCSS_LIBRARY}) | ||
| 192 | # link a shared dvdnav library that includes the whole archives of dvdread and dvdcss as well | ||
| 193 | # the quotes around _dvdlibs are on purpose, since we want to pass a list to the function that will be unpacked automatically | ||
| 194 | core_link_library(${DVDNAV_LIBRARY} system/players/VideoPlayer/libdvdnav dvdnav archives "${_dvdlibs}") | ||
| 195 | |||
| 196 | set(LIBDVD_INCLUDE_DIRS ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/libdvd/include) | ||
| 197 | set(LIBDVD_LIBRARIES ${DVDNAV_LIBRARY} ${DVDREAD_LIBRARY}) | ||
| 198 | if(ENABLE_DVDCSS) | ||
| 199 | list(APPEND LIBDVD_LIBRARIES ${DVDCSS_LIBRARY}) | ||
| 200 | endif() | ||
| 201 | set(LIBDVD_LIBRARIES ${LIBDVD_LIBRARIES} CACHE STRING "libdvd libraries" FORCE) | ||
| 202 | set(LIBDVD_FOUND 1 CACHE BOOL "libdvd found" FORCE) | ||
| 203 | endif() | ||
| 204 | else() | ||
| 205 | # Dynamically loaded on Windows | ||
| 206 | find_path(LIBDVD_INCLUDE_DIR dvdcss/dvdcss.h PATHS ${CORE_SOURCE_DIR}/lib/libdvd/include) | ||
| 207 | |||
| 208 | include(FindPackageHandleStandardArgs) | ||
| 209 | find_package_handle_standard_args(LIBDVD REQUIRED_VARS LIBDVD_INCLUDE_DIR) | ||
| 210 | |||
| 211 | if(LIBDVD_FOUND) | ||
| 212 | set(LIBDVD_INCLUDE_DIRS ${LIBDVD_INCLUDE_DIR}) | ||
| 213 | |||
| 214 | add_custom_target(dvdnav) | ||
| 215 | set_target_properties(dvdnav PROPERTIES FOLDER "External Projects") | ||
| 216 | endif() | ||
| 217 | |||
| 218 | mark_as_advanced(LIBDVD_INCLUDE_DIR) | ||
| 219 | endif() | ||
diff --git a/project/cmake/modules/FindLibUSB.cmake b/project/cmake/modules/FindLibUSB.cmake deleted file mode 100644 index e976bf4..0000000 --- a/project/cmake/modules/FindLibUSB.cmake +++ /dev/null | |||
| @@ -1,45 +0,0 @@ | |||
| 1 | #.rst: | ||
| 2 | # FindLibUSB | ||
| 3 | # ---------- | ||
| 4 | # Finds the USB library | ||
| 5 | # | ||
| 6 | # This will will define the following variables:: | ||
| 7 | # | ||
| 8 | # LIBUSB_FOUND - system has LibUSB | ||
| 9 | # LIBUSB_INCLUDE_DIRS - the USB include directory | ||
| 10 | # LIBUSB_LIBRARIES - the USB libraries | ||
| 11 | # | ||
| 12 | # and the following imported targets:: | ||
| 13 | # | ||
| 14 | # LibUSB::LibUSB - The USB library | ||
| 15 | |||
| 16 | if(PKG_CONFIG_FOUND) | ||
| 17 | pkg_check_modules(PC_LIBUSB libusb QUIET) | ||
| 18 | endif() | ||
| 19 | |||
| 20 | find_path(LIBUSB_INCLUDE_DIR usb.h | ||
| 21 | PATHS ${PC_LIBUSB_INCLUDEDIR}) | ||
| 22 | find_library(LIBUSB_LIBRARY NAMES usb | ||
| 23 | PATHS ${PC_LIBUSB_INCLUDEDIR}) | ||
| 24 | set(LIBUSB_VERSION ${PC_LIBUSB_VERSION}) | ||
| 25 | |||
| 26 | include(FindPackageHandleStandardArgs) | ||
| 27 | find_package_handle_standard_args(LIBUSB | ||
| 28 | REQUIRED_VARS LIBUSB_LIBRARY LIBUSB_INCLUDE_DIR | ||
| 29 | VERSION_VAR LIBUSB_VERSION) | ||
| 30 | |||
| 31 | if(LIBUSB_FOUND) | ||
| 32 | set(LIBUSB_INCLUDE_DIRS ${LIBUSB_INCLUDE_DIR}) | ||
| 33 | set(LIBUSB_LIBRARIES ${LIBUSB_LIBRARY}) | ||
| 34 | set(LIBUSB_DEFINITIONS -DUSE_LIBUSB=1) | ||
| 35 | |||
| 36 | if(NOT TARGET LibUSB::LibUSB) | ||
| 37 | add_library(LibUSB::LibUSB UNKNOWN IMPORTED) | ||
| 38 | set_target_properties(LibUSB::LibUSB PROPERTIES | ||
| 39 | IMPORTED_LOCATION "${LIBUSB_LIBRARY}" | ||
| 40 | INTERFACE_INCLUDE_DIRECTORIES "${LIBUSB_INCLUDE_DIR}" | ||
| 41 | INTERFACE_COMPILE_DEFINITIONS USE_LIBUSB=1) | ||
| 42 | endif() | ||
| 43 | endif() | ||
| 44 | |||
| 45 | mark_as_advanced(USB_INCLUDE_DIR USB_LIBRARY) | ||
diff --git a/project/cmake/modules/FindLibXml2.cmake b/project/cmake/modules/FindLibXml2.cmake deleted file mode 100644 index caeb945..0000000 --- a/project/cmake/modules/FindLibXml2.cmake +++ /dev/null | |||
| @@ -1,84 +0,0 @@ | |||
| 1 | #.rst: | ||
| 2 | # FindLibXml2 | ||
| 3 | # ----------- | ||
| 4 | # | ||
| 5 | # Try to find the LibXml2 xml processing library | ||
| 6 | # | ||
| 7 | # Once done this will define | ||
| 8 | # | ||
| 9 | # :: | ||
| 10 | # | ||
| 11 | # LIBXML2_FOUND - System has LibXml2 | ||
| 12 | # LIBXML2_INCLUDE_DIR - The LibXml2 include directory | ||
| 13 | # LIBXML2_LIBRARIES - The libraries needed to use LibXml2 | ||
| 14 | # LIBXML2_DEFINITIONS - Compiler switches required for using LibXml2 | ||
| 15 | # LIBXML2_XMLLINT_EXECUTABLE - The XML checking tool xmllint coming with LibXml2 | ||
| 16 | # LIBXML2_VERSION_STRING - the version of LibXml2 found (since CMake 2.8.8) | ||
| 17 | |||
| 18 | #============================================================================= | ||
| 19 | # Copyright 2006-2009 Kitware, Inc. | ||
| 20 | # Copyright 2006 Alexander Neundorf <neundorf@kde.org> | ||
| 21 | # Copyright 2016 Team Kodi | ||
| 22 | # | ||
| 23 | # Distributed under the OSI-approved BSD License (the "License"); | ||
| 24 | # see accompanying file Copyright.txt for details. | ||
| 25 | # | ||
| 26 | # This software is distributed WITHOUT ANY WARRANTY; without even the | ||
| 27 | # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
| 28 | # See the License for more information. | ||
| 29 | #============================================================================= | ||
| 30 | # (To distribute this file outside of CMake, substitute the full | ||
| 31 | # License text for the above reference.) | ||
| 32 | |||
| 33 | # use pkg-config to get the directories and then use these values | ||
| 34 | # in the find_path() and find_library() calls | ||
| 35 | find_package(PkgConfig QUIET) | ||
| 36 | PKG_CHECK_MODULES(PC_LIBXML QUIET libxml-2.0) | ||
| 37 | set(LIBXML2_DEFINITIONS ${PC_LIBXML_CFLAGS_OTHER}) | ||
| 38 | |||
| 39 | find_path(LIBXML2_INCLUDE_DIR NAMES libxml/xpath.h | ||
| 40 | HINTS | ||
| 41 | ${PC_LIBXML_INCLUDEDIR} | ||
| 42 | ${PC_LIBXML_INCLUDE_DIRS} | ||
| 43 | PATH_SUFFIXES libxml2 | ||
| 44 | ) | ||
| 45 | |||
| 46 | find_library(LIBXML2_LIBRARY NAMES xml2 libxml2 | ||
| 47 | HINTS | ||
| 48 | ${PC_LIBXML_LIBDIR} | ||
| 49 | ${PC_LIBXML_LIBRARY_DIRS} | ||
| 50 | ) | ||
| 51 | |||
| 52 | find_program(LIBXML2_XMLLINT_EXECUTABLE xmllint) | ||
| 53 | # for backwards compat. with KDE 4.0.x: | ||
| 54 | set(XMLLINT_EXECUTABLE "${LIBXML2_XMLLINT_EXECUTABLE}") | ||
| 55 | |||
| 56 | # Make sure to use static flags if apropriate | ||
| 57 | if(PC_LIBXML_FOUND) | ||
| 58 | if(${LIBXML2_LIBRARY} MATCHES ".+\.a$" AND PC_LIBXML_STATIC_LDFLAGS) | ||
| 59 | set(LIBXML2_LIBRARY ${LIBXML2_LIBRARY} ${PC_LIBXML_STATIC_LDFLAGS}) | ||
| 60 | endif() | ||
| 61 | endif() | ||
| 62 | |||
| 63 | if(PC_LIBXML_VERSION) | ||
| 64 | set(LIBXML2_VERSION_STRING ${PC_LIBXML_VERSION}) | ||
| 65 | elseif(LIBXML2_INCLUDE_DIR AND EXISTS "${LIBXML2_INCLUDE_DIR}/libxml/xmlversion.h") | ||
| 66 | file(STRINGS "${LIBXML2_INCLUDE_DIR}/libxml/xmlversion.h" libxml2_version_str | ||
| 67 | REGEX "^#define[\t ]+LIBXML_DOTTED_VERSION[\t ]+\".*\"") | ||
| 68 | string(REGEX REPLACE "^#define[\t ]+LIBXML_DOTTED_VERSION[\t ]+\"([^\"]*)\".*" "\\1" | ||
| 69 | LIBXML2_VERSION_STRING "${libxml2_version_str}") | ||
| 70 | unset(libxml2_version_str) | ||
| 71 | endif() | ||
| 72 | |||
| 73 | |||
| 74 | include(FindPackageHandleStandardArgs) | ||
| 75 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibXml2 | ||
| 76 | REQUIRED_VARS LIBXML2_LIBRARY LIBXML2_INCLUDE_DIR | ||
| 77 | VERSION_VAR LIBXML2_VERSION_STRING) | ||
| 78 | |||
| 79 | if(LibXml2_FOUND) | ||
| 80 | set(LIBXML2_LIBRARIES ${LIBXML2_LIBRARY}) | ||
| 81 | set(LIBXML2_INCLUDE_DIRS ${LIBXML2_INCLUDE_DIR}) | ||
| 82 | endif() | ||
| 83 | |||
| 84 | mark_as_advanced(LIBXML2_INCLUDE_DIRS LIBXML2_LIBRARIES LIBXML2_XMLLINT_EXECUTABLE) | ||
diff --git a/project/cmake/modules/FindLzo2.cmake b/project/cmake/modules/FindLzo2.cmake deleted file mode 100644 index 4f7313f..0000000 --- a/project/cmake/modules/FindLzo2.cmake +++ /dev/null | |||
| @@ -1,37 +0,0 @@ | |||
| 1 | #.rst: | ||
| 2 | # FindLzo2 | ||
| 3 | # -------- | ||
| 4 | # Finds the Lzo2 library | ||
| 5 | # | ||
| 6 | # This will will define the following variables:: | ||
| 7 | # | ||
| 8 | # LZO2_FOUND - system has Lzo2 | ||
| 9 | # LZO2_INCLUDE_DIRS - the Lzo2 include directory | ||
| 10 | # LZO2_LIBRARIES - the Lzo2 libraries | ||
| 11 | # | ||
| 12 | # and the following imported targets:: | ||
| 13 | # | ||
| 14 | # Lzo2::Lzo2 - The Lzo2 library | ||
| 15 | |||
| 16 | find_path(LZO2_INCLUDE_DIR NAMES lzo1x.h | ||
| 17 | PATH_SUFFIXES lzo) | ||
| 18 | |||
| 19 | find_library(LZO2_LIBRARY NAMES lzo2 liblzo2) | ||
| 20 | |||
| 21 | include(FindPackageHandleStandardArgs) | ||
| 22 | find_package_handle_standard_args(Lzo2 | ||
| 23 | REQUIRED_VARS LZO2_LIBRARY LZO2_INCLUDE_DIR) | ||
| 24 | |||
| 25 | if(LZO2_FOUND) | ||
| 26 | set(LZO2_LIBRARIES ${LZO2_LIBRARY}) | ||
| 27 | set(LZO2_INCLUDE_DIRS ${LZO2_INCLUDE_DIR}) | ||
| 28 | |||
| 29 | if(NOT TARGET Lzo2::Lzo2) | ||
| 30 | add_library(Lzo2::Lzo2 UNKNOWN IMPORTED) | ||
| 31 | set_target_properties(Lzo2::Lzo2 PROPERTIES | ||
| 32 | IMPORTED_LOCATION "${LZO2_LIBRARY}" | ||
| 33 | INTERFACE_INCLUDE_DIRECTORIES "${LZO2_INCLUDE_DIR}") | ||
| 34 | endif() | ||
| 35 | endif() | ||
| 36 | |||
| 37 | mark_as_advanced(LZO2_INCLUDE_DIR LZO2_LIBRARY) | ||
diff --git a/project/cmake/modules/FindMMAL.cmake b/project/cmake/modules/FindMMAL.cmake deleted file mode 100644 index 8843983..0000000 --- a/project/cmake/modules/FindMMAL.cmake +++ /dev/null | |||
| @@ -1,36 +0,0 @@ | |||
| 1 | # - Try to find MMAL | ||
| 2 | # Once done this will define | ||
| 3 | # | ||
| 4 | # MMAL_FOUND - system has MMAL | ||
| 5 | # MMAL_INCLUDE_DIRS - the MMAL include directory | ||
| 6 | # MMAL_LIBRARIES - The MMAL libraries | ||
| 7 | |||
| 8 | if(PKG_CONFIG_FOUND) | ||
| 9 | pkg_check_modules(MMAL mmal QUIET) | ||
| 10 | endif() | ||
| 11 | |||
| 12 | if(NOT MMAL_FOUND) | ||
| 13 | find_path(MMAL_INCLUDE_DIRS interface/mmal/mmal.h) | ||
| 14 | find_library(MMAL_LIBRARY mmal) | ||
| 15 | find_library(MMALCORE_LIBRARY mmal_core) | ||
| 16 | find_library(MMALUTIL_LIBRARY mmal_util) | ||
| 17 | find_library(MMALCLIENT_LIBRARY mmal_vc_client) | ||
| 18 | find_library(MMALCOMPONENT_LIBRARY mmal_components) | ||
| 19 | find_library(BCM_LIBRARY bcm_host) | ||
| 20 | find_library(VCHIQ_LIBRARY vchiq_arm) | ||
| 21 | find_library(VCOS_LIBRARY vcos) | ||
| 22 | find_library(VCSM_LIBRARY vcsm) | ||
| 23 | find_library(CONTAINER_LIBRARY containers) | ||
| 24 | |||
| 25 | set(MMAL_LIBRARIES ${MMAL_LIBRARY} ${MMALCORE_LIBRARY} ${MMALUTIL_LIBRARY} | ||
| 26 | ${MMALCLIENT_LIBRARY} ${MMALCOMPONENT_LIBRARY} | ||
| 27 | ${BCM_LIBRARY} ${VCHIQ_LIBRARY} ${VCOS_LIBRARY} ${VCSM_LIBRARY} ${CONTAINER_LIBRARY} | ||
| 28 | CACHE STRING "mmal libraries" FORCE) | ||
| 29 | endif() | ||
| 30 | |||
| 31 | include(FindPackageHandleStandardArgs) | ||
| 32 | find_package_handle_standard_args(MMAL DEFAULT_MSG MMAL_LIBRARIES MMAL_INCLUDE_DIRS) | ||
| 33 | |||
| 34 | list(APPEND MMAL_DEFINITIONS -DHAVE_MMAL=1 -DHAS_MMAL=1) | ||
| 35 | |||
| 36 | mark_as_advanced(MMAL_INCLUDE_DIRS MMAL_LIBRARIES MMAL_DEFINITIONS) | ||
diff --git a/project/cmake/modules/FindMicroHttpd.cmake b/project/cmake/modules/FindMicroHttpd.cmake deleted file mode 100644 index 7d011fa..0000000 --- a/project/cmake/modules/FindMicroHttpd.cmake +++ /dev/null | |||
| @@ -1,49 +0,0 @@ | |||
| 1 | #.rst: | ||
| 2 | # FindMicroHttpd | ||
| 3 | # -------------- | ||
| 4 | # Finds the MicroHttpd library | ||
| 5 | # | ||
| 6 | # This will will define the following variables:: | ||
| 7 | # | ||
| 8 | # MICROHTTPD_FOUND - system has MicroHttpd | ||
| 9 | # MICROHTTPD_INCLUDE_DIRS - the MicroHttpd include directory | ||
| 10 | # MICROHTTPD_LIBRARIES - the MicroHttpd libraries | ||
| 11 | # MICROHTTPD_DEFINITIONS - the MicroHttpd definitions | ||
| 12 | # | ||
| 13 | # and the following imported targets:: | ||
| 14 | # | ||
| 15 | # MicroHttpd::MicroHttpd - The MicroHttpd library | ||
| 16 | |||
| 17 | if(PKG_CONFIG_FOUND) | ||
| 18 | pkg_check_modules(PC_MICROHTTPD libmicrohttpd>=0.4 QUIET) | ||
| 19 | endif() | ||
| 20 | |||
| 21 | find_path(MICROHTTPD_INCLUDE_DIR NAMES microhttpd.h | ||
| 22 | PATHS ${PC_MICROHTTPD_INCLUDEDIR}) | ||
| 23 | find_library(MICROHTTPD_LIBRARY NAMES microhttpd libmicrohttpd | ||
| 24 | PATHS ${PC_MICROHTTPD_LIBDIR}) | ||
| 25 | |||
| 26 | set(MICROHTTPD_VERSION ${PC_MICROHTTPD_VERSION}) | ||
| 27 | |||
| 28 | include(FindPackageHandleStandardArgs) | ||
| 29 | find_package_handle_standard_args(MicroHttpd | ||
| 30 | REQUIRED_VARS MICROHTTPD_LIBRARY MICROHTTPD_INCLUDE_DIR | ||
| 31 | VERSION_VAR MICROHTTPD_VERSION) | ||
| 32 | |||
| 33 | if(MICROHTTPD_FOUND) | ||
| 34 | set(MICROHTTPD_LIBRARIES ${MICROHTTPD_LIBRARY}) | ||
| 35 | set(MICROHTTPD_INCLUDE_DIRS ${MICROHTTPD_INCLUDE_DIR}) | ||
| 36 | set(MICROHTTPD_DEFINITIONS -DHAVE_LIBMICROHTTPD=1) | ||
| 37 | |||
| 38 | if(NOT WIN32) | ||
| 39 | find_library(GCRYPT_LIBRARY gcrypt) | ||
| 40 | find_library(GPGERROR_LIBRARY gpg-error) | ||
| 41 | list(APPEND MICROHTTPD_LIBRARIES ${GCRYPT_LIBRARY} ${GPGERROR_LIBRARY}) | ||
| 42 | mark_as_advanced(GCRYPT_LIBRARY GPGERROR_LIBRARY) | ||
| 43 | if(NOT APPLE AND NOT CORE_SYSTEM_NAME STREQUAL android) | ||
| 44 | list(APPEND MICROHTTPD_LIBRARIES "-lrt") | ||
| 45 | endif() | ||
| 46 | endif() | ||
| 47 | endif() | ||
| 48 | |||
| 49 | mark_as_advanced(MICROHTTPD_LIBRARY MICROHTTPD_INCLUDE_DIR) | ||
diff --git a/project/cmake/modules/FindMir.cmake b/project/cmake/modules/FindMir.cmake deleted file mode 100644 index 8847a61..0000000 --- a/project/cmake/modules/FindMir.cmake +++ /dev/null | |||
| @@ -1,33 +0,0 @@ | |||
| 1 | # FindMir | ||
| 2 | # ------- | ||
| 3 | # Finds the Mir library | ||
| 4 | # | ||
| 5 | # This will will define the following variables:: | ||
| 6 | # | ||
| 7 | # MIR_FOUND - the system has Mir | ||
| 8 | # MIR_INCLUDE_DIRS - the Mir include directory | ||
| 9 | # MIR_LIBRARIES - the Mir libraries | ||
| 10 | # MIR_DEFINITIONS - the Mir definitions | ||
| 11 | |||
| 12 | |||
| 13 | if(PKG_CONFIG_FOUND) | ||
| 14 | pkg_check_modules (PC_MIR mirclient QUIET) | ||
| 15 | endif() | ||
| 16 | |||
| 17 | find_path(MIR_INCLUDE_DIR NAMES mir_toolkit/mir_client_library.h | ||
| 18 | PATHS ${PC_MIR_INCLUDE_DIRS}) | ||
| 19 | |||
| 20 | find_library(MIR_LIBRARY NAMES mirclient | ||
| 21 | PATHS ${PC_MIR_LIBRARIES} ${PC_MIR_LIBRARY_DIRS}) | ||
| 22 | |||
| 23 | include (FindPackageHandleStandardArgs) | ||
| 24 | find_package_handle_standard_args (MIR | ||
| 25 | REQUIRED_VARS MIR_LIBRARY MIR_INCLUDE_DIR) | ||
| 26 | |||
| 27 | if (MIR_FOUND) | ||
| 28 | set(MIR_LIBRARIES ${MIR_LIBRARY}) | ||
| 29 | set(MIR_INCLUDE_DIRS ${PC_MIR_INCLUDE_DIRS}) | ||
| 30 | set(MIR_DEFINITIONS -DHAVE_MIR=1) | ||
| 31 | endif() | ||
| 32 | |||
| 33 | mark_as_advanced (MIR_LIBRARY MIR_INCLUDE_DIR) | ||
diff --git a/project/cmake/modules/FindMySqlClient.cmake b/project/cmake/modules/FindMySqlClient.cmake deleted file mode 100644 index ceccea3..0000000 --- a/project/cmake/modules/FindMySqlClient.cmake +++ /dev/null | |||
| @@ -1,69 +0,0 @@ | |||
| 1 | #.rst: | ||
| 2 | # FindMySqlClient | ||
| 3 | # --------------- | ||
| 4 | # Finds the MySqlClient library | ||
| 5 | # | ||
| 6 | # This will will define the following variables:: | ||
| 7 | # | ||
| 8 | # MYSQLCLIENT_FOUND - system has MySqlClient | ||
| 9 | # MYSQLCLIENT_INCLUDE_DIRS - the MySqlClient include directory | ||
| 10 | # MYSQLCLIENT_LIBRARIES - the MySqlClient libraries | ||
| 11 | # MYSQLCLIENT_DEFINITIONS - the MySqlClient compile definitions | ||
| 12 | # | ||
| 13 | # and the following imported targets:: | ||
| 14 | # | ||
| 15 | # MySqlClient::MySqlClient - The MySqlClient 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(MYSQLCLIENT_INCLUDE_DIR mysql/mysql_time.h) | ||
| 25 | find_library(MYSQLCLIENT_LIBRARY_RELEASE NAMES mysqlclient libmysql | ||
| 26 | PATH_SUFFIXES mysql | ||
| 27 | ${EXTRA_FIND_ARGS}) | ||
| 28 | find_library(MYSQLCLIENT_LIBRARY_DEBUG NAMES mysqlclient libmysql | ||
| 29 | PATH_SUFFIXES mysql | ||
| 30 | ${EXTRA_FIND_ARGS}) | ||
| 31 | |||
| 32 | if(MYSQLCLIENT_INCLUDE_DIR AND EXISTS "${MYSQLCLIENT_INCLUDE_DIR}/mysql/mysql_version.h") | ||
| 33 | file(STRINGS "${MYSQLCLIENT_INCLUDE_DIR}/mysql/mysql_version.h" mysql_version_str REGEX "^#define[\t ]+LIBMYSQL_VERSION[\t ]+\".*\".*") | ||
| 34 | string(REGEX REPLACE "^#define[\t ]+LIBMYSQL_VERSION[\t ]+\"([^\"]+)\".*" "\\1" MYSQLCLIENT_VERSION_STRING "${mysql_version_str}") | ||
| 35 | unset(mysql_version_str) | ||
| 36 | endif() | ||
| 37 | |||
| 38 | include(SelectLibraryConfigurations) | ||
| 39 | select_library_configurations(MYSQLCLIENT) | ||
| 40 | |||
| 41 | include(FindPackageHandleStandardArgs) | ||
| 42 | find_package_handle_standard_args(MySqlClient | ||
| 43 | REQUIRED_VARS MYSQLCLIENT_LIBRARY MYSQLCLIENT_INCLUDE_DIR | ||
| 44 | VERSION_VAR MYSQLCLIENT_VERSION_STRING) | ||
| 45 | |||
| 46 | if(MYSQLCLIENT_FOUND) | ||
| 47 | set(MYSQLCLIENT_LIBRARIES ${MYSQLCLIENT_LIBRARY}) | ||
| 48 | set(MYSQLCLIENT_INCLUDE_DIRS ${MYSQLCLIENT_INCLUDE_DIR}) | ||
| 49 | set(MYSQLCLIENT_DEFINITIONS -DHAVE_MYSQL=1) | ||
| 50 | |||
| 51 | if(NOT TARGET MySqlClient::MySqlClient) | ||
| 52 | add_library(MySqlClient::MySqlClient UNKNOWN IMPORTED) | ||
| 53 | if(MYSQLCLIENT_LIBRARY_RELEASE) | ||
| 54 | set_target_properties(MySqlClient::MySqlClient PROPERTIES | ||
| 55 | IMPORTED_CONFIGURATIONS RELEASE | ||
| 56 | IMPORTED_LOCATION "${MYSQLCLIENT_LIBRARY_RELEASE}") | ||
| 57 | endif() | ||
| 58 | if(MYSQLCLIENT_LIBRARY_DEBUG) | ||
| 59 | set_target_properties(MySqlClient::MySqlClient PROPERTIES | ||
| 60 | IMPORTED_CONFIGURATIONS DEBUG | ||
| 61 | IMPORTED_LOCATION "${MYSQLCLIENT_LIBRARY_DEBUG}") | ||
| 62 | endif() | ||
| 63 | set_target_properties(MySqlClient::MySqlClient PROPERTIES | ||
| 64 | INTERFACE_INCLUDE_DIRECTORIES "${MYSQLCLIENT_INCLUDE_DIR}" | ||
| 65 | INTERFACE_COMPILE_DEFINITIONS HAVE_MYSQL=1) | ||
| 66 | endif() | ||
| 67 | endif() | ||
| 68 | |||
| 69 | mark_as_advanced(MYSQLCLIENT_INCLUDE_DIR MYSQLCLIENT_LIBRARY) | ||
diff --git a/project/cmake/modules/FindNFS.cmake b/project/cmake/modules/FindNFS.cmake deleted file mode 100644 index 646ee33..0000000 --- a/project/cmake/modules/FindNFS.cmake +++ /dev/null | |||
| @@ -1,58 +0,0 @@ | |||
| 1 | #.rst: | ||
| 2 | # FindNFS | ||
| 3 | # ------- | ||
| 4 | # Finds the libnfs library | ||
| 5 | # | ||
| 6 | # This will will define the following variables:: | ||
| 7 | # | ||
| 8 | # NFS_FOUND - system has libnfs | ||
| 9 | # NFS_INCLUDE_DIRS - the libnfs include directory | ||
| 10 | # NFS_LIBRARIES - the libnfs libraries | ||
| 11 | # NFS_DEFINITIONS - the libnfs compile definitions | ||
| 12 | # | ||
| 13 | # and the following imported targets:: | ||
| 14 | # | ||
| 15 | # NFS::NFS - The libnfs library | ||
| 16 | |||
| 17 | if(PKG_CONFIG_FOUND) | ||
| 18 | pkg_check_modules(PC_NFS libnfs QUIET) | ||
| 19 | endif() | ||
| 20 | |||
| 21 | find_path(NFS_INCLUDE_DIR nfsc/libnfs.h | ||
| 22 | PATHS ${PC_NFS_INCLUDEDIR}) | ||
| 23 | |||
| 24 | set(NFS_VERSION ${PC_NFS_VERSION}) | ||
| 25 | |||
| 26 | include(FindPackageHandleStandardArgs) | ||
| 27 | if(NOT WIN32) | ||
| 28 | find_library(NFS_LIBRARY NAMES nfs | ||
| 29 | PATHS ${PC_NFS_LIBDIR}) | ||
| 30 | |||
| 31 | find_package_handle_standard_args(NFS | ||
| 32 | REQUIRED_VARS NFS_LIBRARY NFS_INCLUDE_DIR | ||
| 33 | VERSION_VAR NFS_VERSION) | ||
| 34 | else() | ||
| 35 | # Dynamically loaded DLL | ||
| 36 | find_package_handle_standard_args(NFS | ||
| 37 | REQUIRED_VARS NFS_INCLUDE_DIR | ||
| 38 | VERSION_VAR NFS_VERSION) | ||
| 39 | endif() | ||
| 40 | |||
| 41 | if(NFS_FOUND) | ||
| 42 | set(NFS_LIBRARIES ${NFS_LIBRARY}) | ||
| 43 | set(NFS_INCLUDE_DIRS ${NFS_INCLUDE_DIR}) | ||
| 44 | set(NFS_DEFINITIONS -DHAVE_LIBNFS=1) | ||
| 45 | |||
| 46 | if(NOT TARGET NFS::NFS) | ||
| 47 | add_library(NFS::NFS UNKNOWN IMPORTED) | ||
| 48 | if(NFS_LIBRARY) | ||
| 49 | set_target_properties(NFS::NFS PROPERTIES | ||
| 50 | IMPORTED_LOCATION "${NFS_LIBRARY_RELEASE}") | ||
| 51 | endif() | ||
| 52 | set_target_properties(NFS::NFS PROPERTIES | ||
| 53 | INTERFACE_INCLUDE_DIRECTORIES "${NFS_INCLUDE_DIR}" | ||
| 54 | INTERFACE_COMPILE_DEFINITIONS HAVE_LIBNFS=1) | ||
| 55 | endif() | ||
| 56 | endif() | ||
| 57 | |||
| 58 | mark_as_advanced(NFS_INCLUDE_DIR NFS_LIBRARY) | ||
diff --git a/project/cmake/modules/FindOpenGLES.cmake b/project/cmake/modules/FindOpenGLES.cmake deleted file mode 100644 index ab06f96..0000000 --- a/project/cmake/modules/FindOpenGLES.cmake +++ /dev/null | |||
| @@ -1,48 +0,0 @@ | |||
| 1 | #.rst: | ||
| 2 | # FindOpenGLES | ||
| 3 | # ------------ | ||
| 4 | # Finds the OpenGLES2 library | ||
| 5 | # | ||
| 6 | # This will will define the following variables:: | ||
| 7 | # | ||
| 8 | # OPENGLES_FOUND - system has OpenGLES | ||
| 9 | # OPENGLES_INCLUDE_DIRS - the OpenGLES include directory | ||
| 10 | # OPENGLES_LIBRARIES - the OpenGLES libraries | ||
| 11 | # OPENGLES_DEFINITIONS - the OpenGLES definitions | ||
| 12 | |||
| 13 | find_package(EMBEDDED) | ||
| 14 | |||
| 15 | if(PKG_CONFIG_FOUND AND NOT PLATFORM STREQUAL "raspberry-pi") | ||
| 16 | pkg_check_modules(PC_OPENGLES glesv2 QUIET) | ||
| 17 | if(NOT OPENGLES_FOUND AND EMBEDDED_FOUND) | ||
| 18 | set(CMAKE_PREFIX_PATH ${EMBEDDED_FOUND} ${CMAKE_PREFIX_PATH}) | ||
| 19 | endif() | ||
| 20 | endif() | ||
| 21 | |||
| 22 | if(NOT CORE_SYSTEM_NAME STREQUAL ios) | ||
| 23 | find_path(OPENGLES_INCLUDE_DIR GLES2/gl2.h | ||
| 24 | PATHS ${PC_OPENGLES_INCLUDEDIR}) | ||
| 25 | find_library(OPENGLES_gl_LIBRARY NAMES GLESv2 | ||
| 26 | PATHS ${PC_OPENGLES_LIBDIR}) | ||
| 27 | find_library(OPENGLES_egl_LIBRARY NAMES EGL | ||
| 28 | PATHS ${PC_OPENGLES_LIBDIR}) | ||
| 29 | else() | ||
| 30 | find_library(OPENGLES_gl_LIBRARY NAMES OpenGLES | ||
| 31 | PATHS ${CMAKE_OSX_SYSROOT}/System/Library | ||
| 32 | PATH_SUFFIXES Frameworks | ||
| 33 | NO_DEFAULT_PATH) | ||
| 34 | set(OPENGLES_INCLUDE_DIR ${OPENGLES_gl_LIBRARY}/Headers) | ||
| 35 | set(OPENGLES_egl_LIBRARY ${OPENGLES_gl_LIBRARY}) | ||
| 36 | endif() | ||
| 37 | |||
| 38 | include(FindPackageHandleStandardArgs) | ||
| 39 | find_package_handle_standard_args(OpenGLES | ||
| 40 | REQUIRED_VARS OPENGLES_gl_LIBRARY OPENGLES_egl_LIBRARY OPENGLES_INCLUDE_DIR) | ||
| 41 | |||
| 42 | if(OPENGLES_FOUND) | ||
| 43 | set(OPENGLES_INCLUDE_DIRS ${OPENGLES_INCLUDE_DIR}) | ||
| 44 | set(OPENGLES_LIBRARIES ${OPENGLES_gl_LIBRARY} ${OPENGLES_egl_LIBRARY}) | ||
| 45 | set(OPENGLES_DEFINITIONS -DHAVE_LIBGLESV2 -DHAVE_LIBEGL=1) | ||
| 46 | endif() | ||
| 47 | |||
| 48 | mark_as_advanced(OPENGLES_INCLUDE_DIR OPENGLES_gl_LIBRARY OPENGLES_egl_LIBRARY) | ||
diff --git a/project/cmake/modules/FindOpenGl.cmake b/project/cmake/modules/FindOpenGl.cmake deleted file mode 100644 index b8cff79..0000000 --- a/project/cmake/modules/FindOpenGl.cmake +++ /dev/null | |||
| @@ -1,43 +0,0 @@ | |||
| 1 | #.rst: | ||
| 2 | # FindOpenGl | ||
| 3 | # ---------- | ||
| 4 | # Finds the FindOpenGl library | ||
| 5 | # | ||
| 6 | # This will will define the following variables:: | ||
| 7 | # | ||
| 8 | # OPENGL_FOUND - system has OpenGl | ||
| 9 | # OPENGL_INCLUDE_DIRS - the OpenGl include directory | ||
| 10 | # OPENGL_LIBRARIES - the OpenGl libraries | ||
| 11 | # OPENGL_DEFINITIONS - the OpenGl definitions | ||
| 12 | |||
| 13 | if(PKG_CONFIG_FOUND) | ||
| 14 | pkg_check_modules(PC_OPENGL gl glu QUIET) | ||
| 15 | endif() | ||
| 16 | |||
| 17 | if(NOT CORE_SYSTEM_NAME STREQUAL osx) | ||
| 18 | find_path(OPENGL_INCLUDE_DIR GL/gl.h | ||
| 19 | PATHS ${PC_OPENGL_gl_INCLUDEDIR}) | ||
| 20 | find_library(OPENGL_gl_LIBRARY NAMES GL | ||
| 21 | PATHS ${PC_OPENGL_gl_LIBDIR}) | ||
| 22 | find_library(OPENGL_glu_LIBRARY NAMES GLU | ||
| 23 | PATHS ${PC_OPENGL_glu_LIBDIR}) | ||
| 24 | else() | ||
| 25 | find_library(OPENGL_gl_LIBRARY NAMES OpenGL | ||
| 26 | PATHS ${CMAKE_OSX_SYSROOT}/System/Library | ||
| 27 | PATH_SUFFIXES Frameworks | ||
| 28 | NO_DEFAULT_PATH) | ||
| 29 | set(OPENGL_INCLUDE_DIR ${OPENGL_gl_LIBRARY}/Headers) | ||
| 30 | set(OPENGL_glu_LIBRARY ${OPENGL_gl_LIBRARY}) | ||
| 31 | endif() | ||
| 32 | |||
| 33 | include(FindPackageHandleStandardArgs) | ||
| 34 | find_package_handle_standard_args(OpenGl | ||
| 35 | REQUIRED_VARS OPENGL_gl_LIBRARY OPENGL_glu_LIBRARY OPENGL_INCLUDE_DIR) | ||
| 36 | |||
| 37 | if(OPENGL_FOUND) | ||
| 38 | set(OPENGL_INCLUDE_DIRS ${OPENGL_INCLUDE_DIR}) | ||
| 39 | set(OPENGL_LIBRARIES ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY}) | ||
| 40 | set(OPENGL_DEFINITIONS -DHAVE_LIBGL=1) | ||
| 41 | endif() | ||
| 42 | |||
| 43 | mark_as_advanced(OPENGL_INCLUDE_DIR OPENGL_gl_LIBRARY OPENGL_glu_LIBRARY) | ||
diff --git a/project/cmake/modules/FindPCRE.cmake b/project/cmake/modules/FindPCRE.cmake deleted file mode 100644 index 8babed3..0000000 --- a/project/cmake/modules/FindPCRE.cmake +++ /dev/null | |||
| @@ -1,87 +0,0 @@ | |||
| 1 | #.rst: | ||
| 2 | # FindPCRE | ||
| 3 | # -------- | ||
| 4 | # Finds the PCRECPP library | ||
| 5 | # | ||
| 6 | # This will will define the following variables:: | ||
| 7 | # | ||
| 8 | # PCRE_FOUND - system has libpcrecpp | ||
| 9 | # PCRE_INCLUDE_DIRS - the libpcrecpp include directory | ||
| 10 | # PCRE_LIBRARIES - the libpcrecpp libraries | ||
| 11 | # PCRE_DEFINITIONS - the libpcrecpp definitions | ||
| 12 | # | ||
| 13 | # and the following imported targets:: | ||
| 14 | # | ||
| 15 | # PCRE::PCRECPP - The PCRECPP library | ||
| 16 | # PCRE::PCRE - The PCRE library | ||
| 17 | |||
| 18 | if(PKG_CONFIG_FOUND) | ||
| 19 | pkg_check_modules(PC_PCRE libpcrecpp QUIET) | ||
| 20 | endif() | ||
| 21 | |||
| 22 | find_path(PCRE_INCLUDE_DIR pcrecpp.h | ||
| 23 | PATHS ${PC_PCRE_INCLUDEDIR}) | ||
| 24 | find_library(PCRECPP_LIBRARY_RELEASE NAMES pcrecpp | ||
| 25 | PATHS ${PC_PCRE_LIBDIR}) | ||
| 26 | find_library(PCRE_LIBRARY_RELEASE NAMES pcre | ||
| 27 | PATHS ${PC_PCRE_LIBDIR}) | ||
| 28 | find_library(PCRECPP_LIBRARY_DEBUG NAMES pcrecppd | ||
| 29 | PATHS ${PC_PCRE_LIBDIR}) | ||
| 30 | find_library(PCRE_LIBRARY_DEBUG NAMES pcred | ||
| 31 | PATHS ${PC_PCRE_LIBDIR}) | ||
| 32 | set(PCRE_VERSION ${PC_PCRE_VERSION}) | ||
| 33 | |||
| 34 | include(SelectLibraryConfigurations) | ||
| 35 | select_library_configurations(PCRECPP) | ||
| 36 | select_library_configurations(PCRE) | ||
| 37 | |||
| 38 | include(FindPackageHandleStandardArgs) | ||
| 39 | find_package_handle_standard_args(PCRE | ||
| 40 | REQUIRED_VARS PCRECPP_LIBRARY PCRE_LIBRARY PCRE_INCLUDE_DIR | ||
| 41 | VERSION_VAR PCRE_VERSION) | ||
| 42 | |||
| 43 | if(PCRE_FOUND) | ||
| 44 | set(PCRE_LIBRARIES ${PCRECPP_LIBRARY} ${PCRE_LIBRARY}) | ||
| 45 | set(PCRE_INCLUDE_DIRS ${PCRE_INCLUDE_DIR}) | ||
| 46 | if(WIN32) | ||
| 47 | set(PCRE_DEFINITIONS -DPCRE_STATIC=1) | ||
| 48 | endif() | ||
| 49 | |||
| 50 | if(NOT TARGET PCRE::PCRE) | ||
| 51 | add_library(PCRE::PCRE UNKNOWN IMPORTED) | ||
| 52 | if(PCRE_LIBRARY_RELEASE) | ||
| 53 | set_target_properties(PCRE::PCRE PROPERTIES | ||
| 54 | IMPORTED_CONFIGURATIONS RELEASE | ||
| 55 | IMPORTED_LOCATION "${PCRE_LIBRARY_RELEASE}") | ||
| 56 | endif() | ||
| 57 | if(PCRE_LIBRARY_DEBUG) | ||
| 58 | set_target_properties(PCRE::PCRE PROPERTIES | ||
| 59 | IMPORTED_CONFIGURATIONS DEBUG | ||
| 60 | IMPORTED_LOCATION "${PCRE_LIBRARY_DEBUG}") | ||
| 61 | endif() | ||
| 62 | set_target_properties(PCRE::PCRE PROPERTIES | ||
| 63 | INTERFACE_INCLUDE_DIRECTORIES "${PCRE_INCLUDE_DIR}") | ||
| 64 | if(WIN32) | ||
| 65 | set_target_properties(PCRE::PCRE PROPERTIES | ||
| 66 | INTERFACE_COMPILE_DEFINITIONS PCRE_STATIC=1) | ||
| 67 | endif() | ||
| 68 | |||
| 69 | endif() | ||
| 70 | if(NOT TARGET PCRE::PCRECPP) | ||
| 71 | add_library(PCRE::PCRECPP UNKNOWN IMPORTED) | ||
| 72 | if(PCRE_LIBRARY_RELEASE) | ||
| 73 | set_target_properties(PCRE::PCRECPP PROPERTIES | ||
| 74 | IMPORTED_CONFIGURATIONS RELEASE | ||
| 75 | IMPORTED_LOCATION "${PCRECPP_LIBRARY_RELEASE}") | ||
| 76 | endif() | ||
| 77 | if(PCRE_LIBRARY_DEBUG) | ||
| 78 | set_target_properties(PCRE::PCRECPP PROPERTIES | ||
| 79 | IMPORTED_CONFIGURATIONS DEBUG | ||
| 80 | IMPORTED_LOCATION "${PCRECPP_LIBRARY_DEBUG}") | ||
| 81 | endif() | ||
| 82 | set_target_properties(PCRE::PCRECPP PROPERTIES | ||
| 83 | INTERFACE_LINK_LIBRARIES PCRE::PCRE) | ||
| 84 | endif() | ||
| 85 | endif() | ||
| 86 | |||
| 87 | mark_as_advanced(PCRE_INCLUDE_DIR PCRECPP_LIBRARY PCRE_LIBRARY) | ||
diff --git a/project/cmake/modules/FindPlist.cmake b/project/cmake/modules/FindPlist.cmake deleted file mode 100644 index d7a6c48..0000000 --- a/project/cmake/modules/FindPlist.cmake +++ /dev/null | |||
| @@ -1,58 +0,0 @@ | |||
| 1 | #.rst: | ||
| 2 | # FindPlist | ||
| 3 | # --------- | ||
| 4 | # Finds the Plist library | ||
| 5 | # | ||
| 6 | # This will will define the following variables:: | ||
| 7 | # | ||
| 8 | # PLIST_FOUND - system has Plist library | ||
| 9 | # PLIST_INCLUDE_DIRS - the Plist library include directory | ||
| 10 | # PLIST_LIBRARIES - the Plist libraries | ||
| 11 | # PLIST_DEFINITIONS - the Plist compile definitions | ||
| 12 | # | ||
| 13 | # and the following imported targets:: | ||
| 14 | # | ||
| 15 | # Plist::Plist - The Plist library | ||
| 16 | |||
| 17 | if(PKG_CONFIG_FOUND) | ||
| 18 | pkg_check_modules(PC_PLIST libplist QUIET) | ||
| 19 | endif() | ||
| 20 | |||
| 21 | find_path(PLIST_INCLUDE_DIR plist/plist.h | ||
| 22 | PATHS ${PC_PLIST_INCLUDEDIR}) | ||
| 23 | |||
| 24 | set(PLIST_VERSION ${PC_PLIST_VERSION}) | ||
| 25 | |||
| 26 | include(FindPackageHandleStandardArgs) | ||
| 27 | if(NOT WIN32) | ||
| 28 | find_library(PLIST_LIBRARY NAMES plist | ||
| 29 | PATHS ${PC_PLIST_LIBDIR}) | ||
| 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 | |||
| 41 | if(PLIST_FOUND) | ||
| 42 | set(PLIST_LIBRARIES ${PLIST_LIBRARY}) | ||
| 43 | set(PLIST_INCLUDE_DIRS ${PLIST_INCLUDE_DIR}) | ||
| 44 | set(PLIST_DEFINITIONS -DHAVE_LIBPLIST=1) | ||
| 45 | |||
| 46 | if(NOT TARGET Plist::Plist) | ||
| 47 | add_library(Plist::Plist UNKNOWN IMPORTED) | ||
| 48 | if(PLIST_LIBRARY) | ||
| 49 | set_target_properties(Plist::Plist PROPERTIES | ||
| 50 | IMPORTED_LOCATION "${PLIST_LIBRARY}") | ||
| 51 | endif() | ||
| 52 | set_target_properties(Plist::Plist PROPERTIES | ||
| 53 | INTERFACE_INCLUDE_DIRECTORIES "${PLIST_INCLUDE_DIR}" | ||
| 54 | INTERFACE_COMPILE_DEFINITIONS HAVE_LIBPLIST=1) | ||
| 55 | endif() | ||
| 56 | endif() | ||
| 57 | |||
| 58 | mark_as_advanced(PLIST_INCLUDE_DIR PLIST_LIBRARY) | ||
diff --git a/project/cmake/modules/FindPulseAudio.cmake b/project/cmake/modules/FindPulseAudio.cmake deleted file mode 100644 index 5761005..0000000 --- a/project/cmake/modules/FindPulseAudio.cmake +++ /dev/null | |||
| @@ -1,68 +0,0 @@ | |||
| 1 | #.rst: | ||
| 2 | # FindPulseAudio | ||
| 3 | # -------------- | ||
| 4 | # Finds the PulseAudio library | ||
| 5 | # | ||
| 6 | # This will define the following variables:: | ||
| 7 | # | ||
| 8 | # PULSEAUDIO_FOUND - system has the PulseAudio library | ||
| 9 | # PULSEAUDIO_INCLUDE_DIRS - the PulseAudio include directory | ||
| 10 | # PULSEAUDIO_LIBRARIES - the libraries needed to use PulseAudio | ||
| 11 | # PULSEAUDIO_DEFINITIONS - the definitions needed to use PulseAudio | ||
| 12 | # | ||
| 13 | # and the following imported targets:: | ||
| 14 | # | ||
| 15 | # PulseAudio::PulseAudio - The PulseAudio library | ||
| 16 | |||
| 17 | if(NOT PulseAudio_FIND_VERSION) | ||
| 18 | set(PulseAudio_FIND_VERSION 2.0.0) | ||
| 19 | endif() | ||
| 20 | |||
| 21 | if(PKG_CONFIG_FOUND) | ||
| 22 | pkg_check_modules(PC_PULSEAUDIO libpulse>=${PulseAudio_FIND_VERSION} QUIET) | ||
| 23 | pkg_check_modules(PC_PULSEAUDIO_MAINLOOP libpulse-mainloop-glib QUIET) | ||
| 24 | endif() | ||
| 25 | |||
| 26 | find_path(PULSEAUDIO_INCLUDE_DIR NAMES pulse/pulseaudio.h | ||
| 27 | PATHS ${PC_PULSEAUDIO_INCLUDEDIR} ${PC_PULSEAUDIO_INCLUDE_DIRS}) | ||
| 28 | |||
| 29 | find_library(PULSEAUDIO_LIBRARY NAMES pulse libpulse | ||
| 30 | PATHS ${PC_PULSEAUDIO_LIBDIR} ${PC_PULSEAUDIO_LIBRARY_DIRS}) | ||
| 31 | |||
| 32 | find_library(PULSEAUDIO_MAINLOOP_LIBRARY NAMES pulse-mainloop pulse-mainloop-glib libpulse-mainloop-glib | ||
| 33 | PATHS ${PC_PULSEAUDIO_LIBDIR} ${PC_PULSEAUDIO_LIBRARY_DIRS}) | ||
| 34 | |||
| 35 | if(PC_PULSEAUDIO_VERSION) | ||
| 36 | set(PULSEAUDIO_VERSION_STRING ${PC_PULSEAUDIO_VERSION}) | ||
| 37 | elseif(PULSEAUDIO_INCLUDE_DIR AND EXISTS "${PULSEAUDIO_INCLUDE_DIR}/pulse/version.h") | ||
| 38 | file(STRINGS "${PULSEAUDIO_INCLUDE_DIR}/pulse/version.h" pulseaudio_version_str REGEX "^#define[\t ]+pa_get_headers_version\\(\\)[\t ]+\\(\".*\"\\).*") | ||
| 39 | string(REGEX REPLACE "^#define[\t ]+pa_get_headers_version\\(\\)[\t ]+\\(\"([^\"]+)\"\\).*" "\\1" PULSEAUDIO_VERSION_STRING "${pulseaudio_version_str}") | ||
| 40 | unset(pulseaudio_version_str) | ||
| 41 | endif() | ||
| 42 | |||
| 43 | include(FindPackageHandleStandardArgs) | ||
| 44 | find_package_handle_standard_args(PulseAudio | ||
| 45 | REQUIRED_VARS PULSEAUDIO_LIBRARY PULSEAUDIO_MAINLOOP_LIBRARY PULSEAUDIO_INCLUDE_DIR | ||
| 46 | VERSION_VAR PULSEAUDIO_VERSION_STRING) | ||
| 47 | |||
| 48 | if(PULSEAUDIO_FOUND) | ||
| 49 | set(PULSEAUDIO_INCLUDE_DIRS ${PULSEAUDIO_INCLUDE_DIR}) | ||
| 50 | set(PULSEAUDIO_LIBRARIES ${PULSEAUDIO_LIBRARY} ${PULSEAUDIO_MAINLOOP_LIBRARY}) | ||
| 51 | set(PULSEAUDIO_DEFINITIONS -DHAVE_LIBPULSE=1) | ||
| 52 | |||
| 53 | if(NOT TARGET PulseAudio::PulseAudioMainloop) | ||
| 54 | add_library(PulseAudio::PulseAudioMainloop UNKNOWN IMPORTED) | ||
| 55 | set_target_properties(PulseAudio::PulseAudioMainloop PROPERTIES | ||
| 56 | IMPORTED_LOCATION "${PULSEAUDIO_MAINLOOP_LIBRARY}") | ||
| 57 | endif() | ||
| 58 | if(NOT TARGET PulseAudio::PulseAudio) | ||
| 59 | add_library(PulseAudio::PulseAudio UNKNOWN IMPORTED) | ||
| 60 | set_target_properties(PulseAudio::PulseAudio PROPERTIES | ||
| 61 | IMPORTED_LOCATION "${PULSEAUDIO_LIBRARY}" | ||
| 62 | INTERFACE_INCLUDE_DIRECTORIES "${PULSEAUDIO_INCLUDE_DIR}" | ||
| 63 | INTERFACE_COMPILE_DEFINITIONS HAVE_LIBPULSE=1 | ||
| 64 | INTERFACE_LINK_LIBRARIES PulseAudio::PulseAudioMainloop) | ||
| 65 | endif() | ||
| 66 | endif() | ||
| 67 | |||
| 68 | mark_as_advanced(PULSEAUDIO_INCLUDE_DIR PULSEAUDIO_LIBRARY PULSEAUDIO_MAINLOOP_LIBRARY) | ||
diff --git a/project/cmake/modules/FindPython.cmake b/project/cmake/modules/FindPython.cmake deleted file mode 100644 index 68b7359..0000000 --- a/project/cmake/modules/FindPython.cmake +++ /dev/null | |||
| @@ -1,38 +0,0 @@ | |||
| 1 | # - Try to find python | ||
| 2 | # Once done this will define | ||
| 3 | # | ||
| 4 | # PYTHON_FOUND - system has PYTHON | ||
| 5 | # PYTHON_INCLUDE_DIRS - the python include directory | ||
| 6 | # PYTHON_LIBRARIES - The python libraries | ||
| 7 | |||
| 8 | if(PKG_CONFIG_FOUND) | ||
| 9 | pkg_check_modules(PC_PYTHON python >= 2.7 QUIET) | ||
| 10 | endif() | ||
| 11 | |||
| 12 | find_program(PYTHON_EXECUTABLE python ONLY_CMAKE_FIND_ROOT_PATH) | ||
| 13 | find_library(PYTHON_LIBRARY NAMES python2.7 PATHS ${PC_PYTHON_LIBDIR}) | ||
| 14 | find_path(PYTHON_INCLUDE_DIR NAMES Python.h PATHS ${PC_PYTHON_INCLUDE_DIRS} ${DEPENDS_PATH}/include/python2.7) | ||
| 15 | |||
| 16 | if(CMAKE_CROSSCOMPILING) | ||
| 17 | find_library(FFI_LIBRARY ffi REQUIRED) | ||
| 18 | find_library(EXPAT_LIBRARY expat REQUIRED) | ||
| 19 | find_library(INTL_LIBRARY intl REQUIRED) | ||
| 20 | find_library(GMP_LIBRARY gmp REQUIRED) | ||
| 21 | |||
| 22 | if(NOT CORE_SYSTEM_NAME STREQUAL android) | ||
| 23 | set(PYTHON_DEP_LIBRARIES -lpthread -ldl -lutil) | ||
| 24 | endif() | ||
| 25 | |||
| 26 | set(PYTHON_LIBRARIES ${PYTHON_LIBRARY} ${FFI_LIBRARY} ${EXPAT_LIBRARY} ${INTL_LIBRARY} ${GMP_LIBRARY} ${PYTHON_DEP_LIBRARIES}) | ||
| 27 | else() | ||
| 28 | find_package(PythonLibs 2.7 REQUIRED) | ||
| 29 | endif() | ||
| 30 | |||
| 31 | |||
| 32 | include(FindPackageHandleStandardArgs) | ||
| 33 | find_package_handle_standard_args(PYTHON REQUIRED_VARS PYTHON_INCLUDE_DIR PYTHON_LIBRARY PYTHON_LIBRARIES) | ||
| 34 | if(PYTHON_FOUND) | ||
| 35 | set(PYTHON_INCLUDE_DIRS ${PYTHON_INCLUDE_DIR}) | ||
| 36 | endif() | ||
| 37 | |||
| 38 | mark_as_advanced(PYTHON_EXECUTABLE PYTHON_INCLUDE_DIRS PYTHON_INCLUDE_DIR PYTHON_LIBRARY PYTHON_LIBRARIES PYTHON_LDFLAGS FFI_LIBRARY EXPAT_LIBRARY INTL_LIBRARY GMP_LIBRARY) | ||
diff --git a/project/cmake/modules/FindSSE.cmake b/project/cmake/modules/FindSSE.cmake deleted file mode 100644 index 0554663..0000000 --- a/project/cmake/modules/FindSSE.cmake +++ /dev/null | |||
| @@ -1,143 +0,0 @@ | |||
| 1 | # Check if SSE instructions are available on the machine where | ||
| 2 | # the project is compiled. | ||
| 3 | include(TestCXXAcceptsFlag) | ||
| 4 | |||
| 5 | if(CMAKE_SYSTEM_NAME MATCHES "Linux") | ||
| 6 | if(CPU MATCHES "x86_64" OR CPU MATCHES "i.86") | ||
| 7 | exec_program(cat ARGS "/proc/cpuinfo" OUTPUT_VARIABLE CPUINFO) | ||
| 8 | |||
| 9 | string(REGEX REPLACE "^.*(sse).*$" "\\1" _SSE_THERE ${CPUINFO}) | ||
| 10 | string(COMPARE EQUAL "sse" "${_SSE_THERE}" _SSE_TRUE) | ||
| 11 | CHECK_CXX_ACCEPTS_FLAG("-msse" _SSE_OK) | ||
| 12 | |||
| 13 | string(REGEX REPLACE "^.*(sse2).*$" "\\1" _SSE_THERE ${CPUINFO}) | ||
| 14 | string(COMPARE EQUAL "sse2" "${_SSE_THERE}" _SSE2_TRUE) | ||
| 15 | CHECK_CXX_ACCEPTS_FLAG("-msse2" _SSE2_OK) | ||
| 16 | |||
| 17 | # /proc/cpuinfo apparently omits sse3 :( | ||
| 18 | string(REGEX REPLACE "^.*[^s](sse3).*$" "\\1" _SSE_THERE ${CPUINFO}) | ||
| 19 | string(COMPARE EQUAL "sse3" "${_SSE_THERE}" _SSE3_TRUE) | ||
| 20 | if(NOT _SSE3_TRUE) | ||
| 21 | string(REGEX REPLACE "^.*(T2300).*$" "\\1" _SSE_THERE ${CPUINFO}) | ||
| 22 | string(COMPARE EQUAL "T2300" "${_SSE_THERE}" _SSE3_TRUE) | ||
| 23 | endif() | ||
| 24 | CHECK_CXX_ACCEPTS_FLAG("-msse3" _SSE3_OK) | ||
| 25 | |||
| 26 | string(REGEX REPLACE "^.*(ssse3).*$" "\\1" _SSE_THERE ${CPUINFO}) | ||
| 27 | string(COMPARE EQUAL "ssse3" "${_SSE_THERE}" _SSSE3_TRUE) | ||
| 28 | CHECK_CXX_ACCEPTS_FLAG("-mssse3" _SSSE3_OK) | ||
| 29 | |||
| 30 | string(REGEX REPLACE "^.*(sse4_1).*$" "\\1" _SSE_THERE ${CPUINFO}) | ||
| 31 | string(COMPARE EQUAL "sse4_1" "${_SSE_THERE}" _SSE41_TRUE) | ||
| 32 | CHECK_CXX_ACCEPTS_FLAG("-msse4.1" _SSE41_OK) | ||
| 33 | |||
| 34 | string(REGEX REPLACE "^.*(sse4_2).*$" "\\1" _SSE_THERE ${CPUINFO}) | ||
| 35 | string(COMPARE EQUAL "sse4_2" "${_SSE_THERE}" _SSE42_TRUE) | ||
| 36 | CHECK_CXX_ACCEPTS_FLAG("-msse4.2" _SSE42_OK) | ||
| 37 | |||
| 38 | string(REGEX REPLACE "^.*(avx).*$" "\\1" _SSE_THERE ${CPUINFO}) | ||
| 39 | string(COMPARE EQUAL "avx" "${_SSE_THERE}" _AVX_TRUE) | ||
| 40 | CHECK_CXX_ACCEPTS_FLAG("-mavx" _AVX_OK) | ||
| 41 | |||
| 42 | string(REGEX REPLACE "^.*(avx2).*$" "\\1" _SSE_THERE ${CPUINFO}) | ||
| 43 | string(COMPARE EQUAL "avx2" "${_SSE_THERE}" _AVX2_TRUE) | ||
| 44 | CHECK_CXX_ACCEPTS_FLAG("-mavx2" _AVX2_OK) | ||
| 45 | endif() | ||
| 46 | elseif(CMAKE_SYSTEM_NAME MATCHES "Darwin") | ||
| 47 | if(NOT CPU MATCHES "arm") | ||
| 48 | exec_program("/usr/sbin/sysctl -n machdep.cpu.features machdep.cpu.leaf7_features" OUTPUT_VARIABLE CPUINFO) | ||
| 49 | |||
| 50 | string(REGEX REPLACE "^.*[^S](SSE).*$" "\\1" _SSE_THERE ${CPUINFO}) | ||
| 51 | string(COMPARE EQUAL "SSE" "${_SSE_THERE}" _SSE_TRUE) | ||
| 52 | CHECK_CXX_ACCEPTS_FLAG("-msse" _SSE_OK) | ||
| 53 | |||
| 54 | string(REGEX REPLACE "^.*[^S](SSE2).*$" "\\1" _SSE_THERE ${CPUINFO}) | ||
| 55 | string(COMPARE EQUAL "SSE2" "${_SSE_THERE}" _SSE2_TRUE) | ||
| 56 | CHECK_CXX_ACCEPTS_FLAG("-msse2" _SSE2_OK) | ||
| 57 | |||
| 58 | string(REGEX REPLACE "^.*[^S](SSE3).*$" "\\1" _SSE_THERE ${CPUINFO}) | ||
| 59 | string(COMPARE EQUAL "SSE3" "${_SSE_THERE}" _SSE3_TRUE) | ||
| 60 | CHECK_CXX_ACCEPTS_FLAG("-msse3" _SSE3_OK) | ||
| 61 | |||
| 62 | string(REGEX REPLACE "^.*(SSSE3).*$" "\\1" _SSE_THERE ${CPUINFO}) | ||
| 63 | string(COMPARE EQUAL "SSSE3" "${_SSE_THERE}" _SSSE3_TRUE) | ||
| 64 | CHECK_CXX_ACCEPTS_FLAG("-mssse3" _SSSE3_OK) | ||
| 65 | |||
| 66 | string(REGEX REPLACE "^.*(SSE4.1).*$" "\\1" _SSE_THERE ${CPUINFO}) | ||
| 67 | string(COMPARE EQUAL "SSE4.1" "${_SSE_THERE}" _SSE41_TRUE) | ||
| 68 | CHECK_CXX_ACCEPTS_FLAG("-msse4.1" _SSE41_OK) | ||
| 69 | |||
| 70 | string(REGEX REPLACE "^.*(SSE4.2).*$" "\\1" _SSE_THERE ${CPUINFO}) | ||
| 71 | string(COMPARE EQUAL "SSE4.2" "${_SSE_THERE}" _SSE42_TRUE) | ||
| 72 | CHECK_CXX_ACCEPTS_FLAG("-msse4.2" _SSE42_OK) | ||
| 73 | |||
| 74 | string(REGEX REPLACE "^.*(AVX).*$" "\\1" _SSE_THERE ${CPUINFO}) | ||
| 75 | string(COMPARE EQUAL "AVX" "${_SSE_THERE}" _AVX_TRUE) | ||
| 76 | CHECK_CXX_ACCEPTS_FLAG("-mavx" _AVX_OK) | ||
| 77 | |||
| 78 | string(REGEX REPLACE "^.*(AVX2).*$" "\\1" _SSE_THERE ${CPUINFO}) | ||
| 79 | string(COMPARE EQUAL "AVX2" "${_SSE_THERE}" _AVX2_TRUE) | ||
| 80 | CHECK_CXX_ACCEPTS_FLAG("-mavx2" _AVX2_OK) | ||
| 81 | endif() | ||
| 82 | elseif(CMAKE_SYSTEM_NAME MATCHES "Windows") | ||
| 83 | # TODO | ||
| 84 | set(_SSE_TRUE true) | ||
| 85 | set(_SSE_OK true) | ||
| 86 | set(_SSE2_TRUE true) | ||
| 87 | set(_SSE2_OK true) | ||
| 88 | endif() | ||
| 89 | |||
| 90 | include(FindPackageHandleStandardArgs) | ||
| 91 | find_package_handle_standard_args(SSE | ||
| 92 | REQUIRED_VARS _SSE_TRUE _SSE_OK | ||
| 93 | FAIL_MESSAGE "Could not find hardware support for SSE") | ||
| 94 | find_package_handle_standard_args(SSE2 | ||
| 95 | REQUIRED_VARS _SSE2_TRUE _SSE2_OK | ||
| 96 | FAIL_MESSAGE "Could not find hardware support for SSE2") | ||
| 97 | find_package_handle_standard_args(SSE3 | ||
| 98 | REQUIRED_VARS _SSE3_TRUE _SSE3_OK | ||
| 99 | FAIL_MESSAGE "Could not find hardware support for SSE3") | ||
| 100 | find_package_handle_standard_args(SSSE3 | ||
| 101 | REQUIRED_VARS _SSSE3_TRUE _SSSE3_OK | ||
| 102 | FAIL_MESSAGE "Could not find hardware support for SSSE3") | ||
| 103 | find_package_handle_standard_args(SSE4_1 | ||
| 104 | REQUIRED_VARS _SSE41_TRUE _SSE41_OK | ||
| 105 | FAIL_MESSAGE "Could not find hardware support for SSE4.1") | ||
| 106 | find_package_handle_standard_args(SSE4_2 | ||
| 107 | REQUIRED_VARS _SSE42_TRUE _SSE42_OK | ||
| 108 | FAIL_MESSAGE "Could not find hardware support for SSE4.2") | ||
| 109 | find_package_handle_standard_args(AVX | ||
| 110 | REQUIRED_VARS _AVX_TRUE _AVX_OK | ||
| 111 | FAIL_MESSAGE "Could not find hardware support for AVX") | ||
| 112 | find_package_handle_standard_args(AVX2 | ||
| 113 | REQUIRED_VARS _AVX2_TRUE _AVX2_OK | ||
| 114 | FAIL_MESSAGE "Could not find hardware support for AVX2") | ||
| 115 | |||
| 116 | mark_as_advanced(SSE2_FOUND SSE3_FOUND SSSE3_FOUND SSE4_1_FOUND SSE4_2_FOUND AVX_FOUND AVX2_FOUND) | ||
| 117 | |||
| 118 | unset(_SSE_THERE) | ||
| 119 | unset(_SSE_TRUE) | ||
| 120 | unset(_SSE_OK) | ||
| 121 | unset(_SSE_OK CACHE) | ||
| 122 | unset(_SSE2_TRUE) | ||
| 123 | unset(_SSE2_OK) | ||
| 124 | unset(_SSE2_OK CACHE) | ||
| 125 | unset(_SSE3_TRUE) | ||
| 126 | unset(_SSE3_OK) | ||
| 127 | unset(_SSE3_OK CACHE) | ||
| 128 | unset(_SSSE3_TRUE) | ||
| 129 | unset(_SSSE3_OK) | ||
| 130 | unset(_SSSE3_OK CACHE) | ||
| 131 | unset(_SSE4_1_TRUE) | ||
| 132 | unset(_SSE41_OK) | ||
| 133 | unset(_SSE41_OK CACHE) | ||
| 134 | unset(_SSE4_2_TRUE) | ||
| 135 | unset(_SSE42_OK) | ||
| 136 | unset(_SSE42_OK CACHE) | ||
| 137 | unset(_AVX_TRUE) | ||
| 138 | unset(_AVX_OK) | ||
| 139 | unset(_AVX_OK CACHE) | ||
| 140 | unset(_AVX2_TRUE) | ||
| 141 | unset(_AVX2_OK) | ||
| 142 | unset(_AVX2_OK CACHE) | ||
| 143 | |||
diff --git a/project/cmake/modules/FindSSH.cmake b/project/cmake/modules/FindSSH.cmake deleted file mode 100644 index 538c699..0000000 --- a/project/cmake/modules/FindSSH.cmake +++ /dev/null | |||
| @@ -1,47 +0,0 @@ | |||
| 1 | #.rst: | ||
| 2 | # FindSSH | ||
| 3 | # ------- | ||
| 4 | # Finds the SSH library | ||
| 5 | # | ||
| 6 | # This will will define the following variables:: | ||
| 7 | # | ||
| 8 | # SSH_FOUND - system has SSH | ||
| 9 | # SSH_INCLUDE_DIRS - the SSH include directory | ||
| 10 | # SSH_LIBRARIES - the SSH libraries | ||
| 11 | # SSH_DEFINITIONS - the SSH definitions | ||
| 12 | # | ||
| 13 | # and the following imported targets:: | ||
| 14 | # | ||
| 15 | # SSH::SSH - The SSH library | ||
| 16 | |||
| 17 | if(PKG_CONFIG_FOUND) | ||
| 18 | pkg_check_modules(PC_SSH libssh QUIET) | ||
| 19 | endif() | ||
| 20 | |||
| 21 | find_path(SSH_INCLUDE_DIR NAMES libssh/libssh.h | ||
| 22 | PATHS ${PC_SSH_INCLUDEDIR}) | ||
| 23 | find_library(SSH_LIBRARY NAMES ssh | ||
| 24 | PATHS ${PC_SSH_LIBDIR}) | ||
| 25 | |||
| 26 | set(SSH_VERSION ${PC_SSH_VERSION}) | ||
| 27 | |||
| 28 | include(FindPackageHandleStandardArgs) | ||
| 29 | find_package_handle_standard_args(SSH | ||
| 30 | REQUIRED_VARS SSH_LIBRARY SSH_INCLUDE_DIR | ||
| 31 | VERSION_VAR SSH_VERSION) | ||
| 32 | |||
| 33 | if(SSH_FOUND) | ||
| 34 | set(SSH_LIBRARIES ${SSH_LIBRARY}) | ||
| 35 | set(SSH_INCLUDE_DIRS ${SSH_INCLUDE_DIR}) | ||
| 36 | set(SSH_DEFINITIONS -DHAVE_LIBSSH=1) | ||
| 37 | |||
| 38 | if(NOT TARGET SSH::SSH) | ||
| 39 | add_library(SSH::SSH UNKNOWN IMPORTED) | ||
| 40 | set_target_properties(SSH::SSH PROPERTIES | ||
| 41 | IMPORTED_LOCATION "${SSH_LIBRARY}" | ||
| 42 | INTERFACE_INCLUDE_DIRECTORIES "${SSH_INCLUDE_DIR}" | ||
| 43 | INTERFACE_COMPILE_DEFINITIONS HAVE_LIBSSH=1) | ||
| 44 | endif() | ||
| 45 | endif() | ||
| 46 | |||
| 47 | mark_as_advanced(SSH_INCLUDE_DIR SSH_LIBRARY) | ||
diff --git a/project/cmake/modules/FindSWIG.cmake b/project/cmake/modules/FindSWIG.cmake deleted file mode 100644 index 523b49b..0000000 --- a/project/cmake/modules/FindSWIG.cmake +++ /dev/null | |||
| @@ -1,29 +0,0 @@ | |||
| 1 | #.rst: | ||
| 2 | # FindSWIG | ||
| 3 | # -------- | ||
| 4 | # Finds the SWIG executable | ||
| 5 | # | ||
| 6 | # This will will define the following variables:: | ||
| 7 | # | ||
| 8 | # SWIG_FOUND - system has SWIG | ||
| 9 | # SWIG_EXECUTABLE - the SWIG executable | ||
| 10 | |||
| 11 | find_program(SWIG_EXECUTABLE NAMES swig3.0 swig2.0 swig | ||
| 12 | PATH_SUFFIXES swig) | ||
| 13 | if(SWIG_EXECUTABLE) | ||
| 14 | execute_process(COMMAND ${SWIG_EXECUTABLE} -swiglib | ||
| 15 | OUTPUT_VARIABLE SWIG_DIR | ||
| 16 | ERROR_VARIABLE SWIG_swiglib_error | ||
| 17 | RESULT_VARIABLE SWIG_swiglib_result) | ||
| 18 | execute_process(COMMAND ${SWIG_EXECUTABLE} -version | ||
| 19 | OUTPUT_VARIABLE SWIG_version_output | ||
| 20 | ERROR_VARIABLE SWIG_version_output | ||
| 21 | RESULT_VARIABLE SWIG_version_result) | ||
| 22 | string(REGEX REPLACE ".*SWIG Version[^0-9.]*\([0-9.]+\).*" "\\1" | ||
| 23 | SWIG_VERSION "${SWIG_version_output}") | ||
| 24 | endif() | ||
| 25 | |||
| 26 | include(FindPackageHandleStandardArgs) | ||
| 27 | find_package_handle_standard_args(SWIG | ||
| 28 | REQUIRED_VARS SWIG_EXECUTABLE SWIG_DIR | ||
| 29 | VERSION_VAR SWIG_VERSION) | ||
diff --git a/project/cmake/modules/FindSdl.cmake b/project/cmake/modules/FindSdl.cmake deleted file mode 100644 index 91bcac5..0000000 --- a/project/cmake/modules/FindSdl.cmake +++ /dev/null | |||
| @@ -1,46 +0,0 @@ | |||
| 1 | #.rst: | ||
| 2 | # FindSDL | ||
| 3 | # ------- | ||
| 4 | # Finds the SDL library | ||
| 5 | # | ||
| 6 | # This will will define the following variables:: | ||
| 7 | # | ||
| 8 | # SDL_FOUND - system has SDL | ||
| 9 | # SDL_INCLUDE_DIRS - the SDL include directory | ||
| 10 | # SDL_LIBRARIES - the SDL libraries | ||
| 11 | # SDL_DEFINITIONS - the SDL compile definitions | ||
| 12 | |||
| 13 | if(PKG_CONFIG_FOUND) | ||
| 14 | pkg_check_modules(PC_SDL2 sdl2 QUIET) | ||
| 15 | if(PC_SDL2_FOUND) | ||
| 16 | set(SDL_VERSION ${PC_SDL2_VERSION}) | ||
| 17 | else() | ||
| 18 | pkg_check_modules(PC_SDL1 sdl QUIET) | ||
| 19 | if(PC_SDL1_FOUND) | ||
| 20 | set(SDL_VERSION ${PC_SDL1_VERSION}) | ||
| 21 | endif() | ||
| 22 | endif() | ||
| 23 | endif() | ||
| 24 | |||
| 25 | find_path(SDL_INCLUDE_DIR SDL/SDL.h | ||
| 26 | PATHS ${PC_SDL2_INCLUDE_DIR} ${PC_SDL1_INCLUDE_DIR}) | ||
| 27 | find_library(SDL_LIBRARY NAMES SDL2 SDL | ||
| 28 | PATHS ${PC_SDL2_LIBDIR} ${PC_SDL1_LIBDIR}) | ||
| 29 | |||
| 30 | include(FindPackageHandleStandardArgs) | ||
| 31 | find_package_handle_standard_args(Sdl REQUIRED_VARS SDL_LIBRARY SDL_INCLUDE_DIR | ||
| 32 | VERSION_VAR SDL_VERSION) | ||
| 33 | |||
| 34 | if(SDL_FOUND) | ||
| 35 | set(SDL_LIBRARIES ${SDL_LIBRARY}) | ||
| 36 | set(SDL_INCLUDE_DIRS ${SDL_INCLUDE_DIR}) | ||
| 37 | set(SDL_DEFINITIONS -DHAVE_SDL=1) | ||
| 38 | |||
| 39 | if(SDL_VERSION VERSION_GREATER 2) | ||
| 40 | list(APPEND SDL_DEFINITIONS -DHAVE_SDL_VERSION=2) | ||
| 41 | elseif(SDL_VERSION VERSION_GREATER 1) | ||
| 42 | list(APPEND SDL_DEFINITIONS -DHAVE_SDL_VERSION=1) | ||
| 43 | endif() | ||
| 44 | endif() | ||
| 45 | |||
| 46 | mark_as_advanced(SDL_LIBRARY SDL_INCLUDE_DIR) | ||
diff --git a/project/cmake/modules/FindShairplay.cmake b/project/cmake/modules/FindShairplay.cmake deleted file mode 100644 index 87d3107..0000000 --- a/project/cmake/modules/FindShairplay.cmake +++ /dev/null | |||
| @@ -1,63 +0,0 @@ | |||
| 1 | #.rst: | ||
| 2 | # FindShairplay | ||
| 3 | # ------------- | ||
| 4 | # Finds the Shairplay library | ||
| 5 | # | ||
| 6 | # This will will define the following variables:: | ||
| 7 | # | ||
| 8 | # SHAIRPLAY_FOUND - system has Shairplay | ||
| 9 | # SHAIRPLAY_INCLUDE_DIRS - the Shairplay include directory | ||
| 10 | # SHAIRPLAY_LIBRARIES - the Shairplay libraries | ||
| 11 | # SHAIRPLAY_DEFINITIONS - the Shairplay compile definitions | ||
| 12 | # | ||
| 13 | # and the following imported targets:: | ||
| 14 | # | ||
| 15 | # Shairplay::Shairplay - The Shairplay library | ||
| 16 | |||
| 17 | find_path(SHAIRPLAY_INCLUDE_DIR shairplay/raop.h) | ||
| 18 | |||
| 19 | include(FindPackageHandleStandardArgs) | ||
| 20 | if(NOT WIN32) | ||
| 21 | find_library(SHAIRPLAY_LIBRARY NAMES shairplay) | ||
| 22 | |||
| 23 | if(SHAIRPLAY_INCLUDE_DIR AND SHAIRPLAY_LIBRARY) | ||
| 24 | include(CheckCSourceCompiles) | ||
| 25 | set(CMAKE_REQUIRED_INCLUDES ${SHAIRPLAY_INCLUDE_DIRS}) | ||
| 26 | set(CMAKE_REQUIRED_LIBRARIES ${SHAIRPLAY_LIBRARIES}) | ||
| 27 | check_c_source_compiles("#include <shairplay/raop.h> | ||
| 28 | |||
| 29 | int main() | ||
| 30 | { | ||
| 31 | struct raop_callbacks_s foo; | ||
| 32 | foo.cls; | ||
| 33 | return 0; | ||
| 34 | } | ||
| 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() | ||
| 45 | |||
| 46 | if(SHAIRPLAY_FOUND) | ||
| 47 | set(SHAIRPLAY_LIBRARIES ${SHAIRPLAY_LIBRARY}) | ||
| 48 | set(SHAIRPLAY_INCLUDE_DIRS ${SHAIRPLAY_INCLUDE_DIR}) | ||
| 49 | set(SHAIRPLAY_DEFINITIONS -DHAVE_LIBSHAIRPLAY=1) | ||
| 50 | |||
| 51 | if(NOT TARGET Shairplay::Shairplay) | ||
| 52 | add_library(Shairplay::Shairplay UNKNOWN IMPORTED) | ||
| 53 | if(SHAIRPLAY_LIBRARY) | ||
| 54 | set_target_properties(Shairplay::Shairplay PROPERTIES | ||
| 55 | IMPORTED_LOCATION "${SHAIRPLAY_LIBRARY}") | ||
| 56 | endif() | ||
| 57 | set_target_properties(Shairplay::Shairplay PROPERTIES | ||
| 58 | INTERFACE_INCLUDE_DIRECTORIES "${SHAIRPLAY_INCLUDE_DIR}" | ||
| 59 | INTERFACE_COMPILE_DEFINITIONS HAVE_LIBSHAIRPLAY=1) | ||
| 60 | endif() | ||
| 61 | endif() | ||
| 62 | |||
| 63 | mark_as_advanced(SHAIRPLAY_INCLUDE_DIR SHAIRPLAY_LIBRARY) | ||
diff --git a/project/cmake/modules/FindSmbClient.cmake b/project/cmake/modules/FindSmbClient.cmake deleted file mode 100644 index 6455cce..0000000 --- a/project/cmake/modules/FindSmbClient.cmake +++ /dev/null | |||
| @@ -1,47 +0,0 @@ | |||
| 1 | #.rst: | ||
| 2 | # FindSmbClient | ||
| 3 | # ------------- | ||
| 4 | # Finds the SMB Client library | ||
| 5 | # | ||
| 6 | # This will will define the following variables:: | ||
| 7 | # | ||
| 8 | # SMBCLIENT_FOUND - system has SmbClient | ||
| 9 | # SMBCLIENT_INCLUDE_DIRS - the SmbClient include directory | ||
| 10 | # SMBCLIENT_LIBRARIES - the SmbClient libraries | ||
| 11 | # SMBCLIENT_DEFINITIONS - the SmbClient definitions | ||
| 12 | # | ||
| 13 | # and the following imported targets:: | ||
| 14 | # | ||
| 15 | # SmbClient::SmbClient - The SmbClient library | ||
| 16 | |||
| 17 | if(PKGCONFIG_FOUND) | ||
| 18 | pkg_check_modules(PC_SMBCLIENT smbclient QUIET) | ||
| 19 | endif() | ||
| 20 | |||
| 21 | find_path(SMBCLIENT_INCLUDE_DIR NAMES libsmbclient.h | ||
| 22 | PATHS ${PC_SMBCLIENT_INCLUDEDIR}) | ||
| 23 | find_library(SMBCLIENT_LIBRARY NAMES smbclient | ||
| 24 | PATHS ${PC_SMBCLIENT_LIBDIR}) | ||
| 25 | |||
| 26 | set(SMBCLIENT_VERSION ${PC_SMBCLIENT_VERSION}) | ||
| 27 | |||
| 28 | include(FindPackageHandleStandardArgs) | ||
| 29 | find_package_handle_standard_args(SmbClient | ||
| 30 | REQUIRED_VARS SMBCLIENT_LIBRARY SMBCLIENT_INCLUDE_DIR | ||
| 31 | VERSION_VAR SMBCLIENT_VERSION) | ||
| 32 | |||
| 33 | if(SMBCLIENT_FOUND) | ||
| 34 | set(SMBCLIENT_LIBRARIES ${SMBCLIENT_LIBRARY}) | ||
| 35 | set(SMBCLIENT_INCLUDE_DIRS ${SMBCLIENT_INCLUDE_DIR}) | ||
| 36 | set(SMBCLIENT_DEFINITIONS -DHAVE_LIBSMBCLIENT=1) | ||
| 37 | |||
| 38 | if(NOT TARGET SmbClient::SmbClient) | ||
| 39 | add_library(SmbClient::SmbClient UNKNOWN IMPORTED) | ||
| 40 | set_target_properties(SmbClient::SmbClient PROPERTIES | ||
| 41 | IMPORTED_LOCATION "${SMBCLIENT_LIBRARY}" | ||
| 42 | INTERFACE_INCLUDE_DIRECTORIES "${SMBCLIENT_INCLUDE_DIR}" | ||
| 43 | INTERFACE_COMPILE_DEFINITIONS HAVE_LIBSMBCLIENT=1) | ||
| 44 | endif() | ||
| 45 | endif() | ||
| 46 | |||
| 47 | mark_as_advanced(LIBSMBCLIENT_INCLUDE_DIR LIBSMBCLIENT_LIBRARY) | ||
diff --git a/project/cmake/modules/FindSqlite3.cmake b/project/cmake/modules/FindSqlite3.cmake deleted file mode 100644 index abde0cf..0000000 --- a/project/cmake/modules/FindSqlite3.cmake +++ /dev/null | |||
| @@ -1,44 +0,0 @@ | |||
| 1 | #.rst: | ||
| 2 | # FindSqlite3 | ||
| 3 | # ----------- | ||
| 4 | # Finds the SQLite3 library | ||
| 5 | # | ||
| 6 | # This will will define the following variables:: | ||
| 7 | # | ||
| 8 | # SQLITE3_FOUND - system has SQLite3 | ||
| 9 | # SQLITE3_INCLUDE_DIRS - the SQLite3 include directory | ||
| 10 | # SQLITE3_LIBRARIES - the SQLite3 libraries | ||
| 11 | # | ||
| 12 | # and the following imported targets:: | ||
| 13 | # | ||
| 14 | # SQLite3::SQLite3 - The SQLite3 library | ||
| 15 | |||
| 16 | if(PKG_CONFIG_FOUND) | ||
| 17 | pkg_check_modules(PC_SQLITE3 sqlite3 QUIET) | ||
| 18 | endif() | ||
| 19 | |||
| 20 | find_path(SQLITE3_INCLUDE_DIR NAMES sqlite3.h | ||
| 21 | PATHS ${PC_SQLITE3_INCLUDEDIR}) | ||
| 22 | find_library(SQLITE3_LIBRARY NAMES sqlite3 | ||
| 23 | PATHS ${PC_SQLITE3_LIBDIR}) | ||
| 24 | |||
| 25 | set(SQLITE3_VERSION ${PC_SQLITE3_VERSION}) | ||
| 26 | |||
| 27 | include(FindPackageHandleStandardArgs) | ||
| 28 | find_package_handle_standard_args(Sqlite3 | ||
| 29 | REQUIRED_VARS SQLITE3_LIBRARY SQLITE3_INCLUDE_DIR | ||
| 30 | VERSION_VAR SQLITE3_VERSION) | ||
| 31 | |||
| 32 | if(SQLITE3_FOUND) | ||
| 33 | set(SQLITE3_INCLUDE_DIRS ${SQLITE3_INCLUDE_DIR}) | ||
| 34 | set(SQLITE3_LIBRARIES ${SQLITE3_LIBRARY}) | ||
| 35 | |||
| 36 | if(NOT TARGET SQLite3::SQLite3) | ||
| 37 | add_library(SQLite3::SQLite3 UNKNOWN IMPORTED) | ||
| 38 | set_target_properties(SQLite3::SQLite3 PROPERTIES | ||
| 39 | IMPORTED_LOCATION "${SQLITE3_LIBRARY}" | ||
| 40 | INTERFACE_INCLUDE_DIRECTORIES "${SQLITE3_INCLUDE_DIR}") | ||
| 41 | endif() | ||
| 42 | endif() | ||
| 43 | |||
| 44 | mark_as_advanced(SQLITE3_INCLUDE_DIR SQLITE3_LIBRARY) | ||
diff --git a/project/cmake/modules/FindTagLib.cmake b/project/cmake/modules/FindTagLib.cmake deleted file mode 100644 index 8c8c2f3..0000000 --- a/project/cmake/modules/FindTagLib.cmake +++ /dev/null | |||
| @@ -1,60 +0,0 @@ | |||
| 1 | #.rst: | ||
| 2 | # FindTagLib | ||
| 3 | # ---------- | ||
| 4 | # Finds the TagLib library | ||
| 5 | # | ||
| 6 | # This will will define the following variables:: | ||
| 7 | # | ||
| 8 | # TAGLIB_FOUND - system has TagLib | ||
| 9 | # TAGLIB_INCLUDE_DIRS - the TagLib include directory | ||
| 10 | # TAGLIB_LIBRARIES - the TagLib libraries | ||
| 11 | # | ||
| 12 | # and the following imported targets:: | ||
| 13 | # | ||
| 14 | # TagLib::TagLib - The TagLib library | ||
| 15 | |||
| 16 | if(PKG_CONFIG_FOUND) | ||
| 17 | pkg_check_modules(PC_TAGLIB taglib>=1.9.0 QUIET) | ||
| 18 | endif() | ||
| 19 | |||
| 20 | find_path(TAGLIB_INCLUDE_DIR taglib/tag.h | ||
| 21 | PATHS ${PC_TAGLIB_INCLUDEDIR}) | ||
| 22 | find_library(TAGLIB_LIBRARY_RELEASE NAMES tag | ||
| 23 | PATHS ${PC_TAGLIB_LIBDIR}) | ||
| 24 | find_library(TAGLIB_LIBRARY_DEBUG NAMES tagd | ||
| 25 | PATHS ${PC_TAGLIB_LIBDIR}) | ||
| 26 | set(TAGLIB_VERSION ${PC_TAGLIB_VERSION}) | ||
| 27 | |||
| 28 | include(SelectLibraryConfigurations) | ||
| 29 | select_library_configurations(TAGLIB) | ||
| 30 | |||
| 31 | include(FindPackageHandleStandardArgs) | ||
| 32 | find_package_handle_standard_args(TagLib | ||
| 33 | REQUIRED_VARS TAGLIB_LIBRARY TAGLIB_INCLUDE_DIR | ||
| 34 | VERSION_VAR TAGLIB_VERSION) | ||
| 35 | |||
| 36 | if(TAGLIB_FOUND) | ||
| 37 | set(TAGLIB_LIBRARIES ${TAGLIB_LIBRARY}) | ||
| 38 | |||
| 39 | # Workaround broken .pc file | ||
| 40 | list(APPEND TAGLIB_LIBRARIES ${PC_TAGLIB_ZLIB_LIBRARIES}) | ||
| 41 | |||
| 42 | set(TAGLIB_INCLUDE_DIRS ${TAGLIB_INCLUDE_DIR}) | ||
| 43 | if(NOT TARGET TagLib::TagLib) | ||
| 44 | add_library(TagLib::TagLib UNKNOWN IMPORTED) | ||
| 45 | if(TAGLIB_LIBRARY_RELEASE) | ||
| 46 | set_target_properties(TagLib::TagLib PROPERTIES | ||
| 47 | IMPORTED_CONFIGURATIONS RELEASE | ||
| 48 | IMPORTED_LOCATION "${TAGLIB_LIBRARY_RELEASE}") | ||
| 49 | endif() | ||
| 50 | if(TAGLIB_LIBRARY_DEBUG) | ||
| 51 | set_target_properties(TagLib::TagLib PROPERTIES | ||
| 52 | IMPORTED_CONFIGURATIONS DEBUG | ||
| 53 | IMPORTED_LOCATION "${TAGLIB_LIBRARY_DEBUG}") | ||
| 54 | endif() | ||
| 55 | set_target_properties(TagLib::TagLib PROPERTIES | ||
| 56 | INTERFACE_INCLUDE_DIRECTORIES "${TAGLIB_INCLUDE_DIR}") | ||
| 57 | endif() | ||
| 58 | endif() | ||
| 59 | |||
| 60 | mark_as_advanced(TAGLIB_INCLUDE_DIR TAGLIB_LIBRARY) | ||
diff --git a/project/cmake/modules/FindTexturePacker.cmake b/project/cmake/modules/FindTexturePacker.cmake deleted file mode 100644 index f9e4c75..0000000 --- a/project/cmake/modules/FindTexturePacker.cmake +++ /dev/null | |||
| @@ -1,41 +0,0 @@ | |||
| 1 | #.rst: | ||
| 2 | # FindTexturePacker | ||
| 3 | # ----------------- | ||
| 4 | # Finds the TexturePacker | ||
| 5 | # | ||
| 6 | # If WITH_TEXTUREPACKER is defined and points to a directory, | ||
| 7 | # this path will be used to search for the Texturepacker binary | ||
| 8 | # | ||
| 9 | # | ||
| 10 | # This will define the following (imported) targets:: | ||
| 11 | # | ||
| 12 | # TexturePacker::TexturePacker - The TexturePacker executable | ||
| 13 | |||
| 14 | if(NOT TARGET TexturePacker::TexturePacker) | ||
| 15 | if(CMAKE_CROSSCOMPILING) | ||
| 16 | add_executable(TexturePacker::TexturePacker IMPORTED GLOBAL) | ||
| 17 | set_target_properties(TexturePacker::TexturePacker PROPERTIES | ||
| 18 | IMPORTED_LOCATION "${NATIVEPREFIX}/bin/TexturePacker") | ||
| 19 | elseif(WIN32) | ||
| 20 | add_executable(TexturePacker::TexturePacker IMPORTED GLOBAL) | ||
| 21 | set_target_properties(TexturePacker::TexturePacker PROPERTIES | ||
| 22 | IMPORTED_LOCATION "${CORE_SOURCE_DIR}/tools/TexturePacker/TexturePacker.exe") | ||
| 23 | else() | ||
| 24 | if(WITH_TEXTUREPACKER) | ||
| 25 | get_filename_component(_tppath ${WITH_TEXTUREPACKER} ABSOLUTE) | ||
| 26 | find_program(TEXTUREPACKER_EXECUTABLE TexturePacker PATHS ${_tppath}) | ||
| 27 | |||
| 28 | include(FindPackageHandleStandardArgs) | ||
| 29 | find_package_handle_standard_args(TexturePacker DEFAULT_MSG TEXTUREPACKER_EXECUTABLE) | ||
| 30 | if(TEXTUREPACKER_FOUND) | ||
| 31 | add_executable(TexturePacker::TexturePacker IMPORTED GLOBAL) | ||
| 32 | set_target_properties(TexturePacker::TexturePacker PROPERTIES | ||
| 33 | IMPORTED_LOCATION "${TEXTUREPACKER_EXECUTABLE}") | ||
| 34 | endif() | ||
| 35 | mark_as_advanced(TEXTUREPACKER) | ||
| 36 | else() | ||
| 37 | add_subdirectory(${CORE_SOURCE_DIR}/tools/depends/native/TexturePacker build/texturepacker) | ||
| 38 | add_executable(TexturePacker::TexturePacker ALIAS TexturePacker) | ||
| 39 | endif() | ||
| 40 | endif() | ||
| 41 | endif() | ||
diff --git a/project/cmake/modules/FindTinyXML.cmake b/project/cmake/modules/FindTinyXML.cmake deleted file mode 100644 index 1220a94..0000000 --- a/project/cmake/modules/FindTinyXML.cmake +++ /dev/null | |||
| @@ -1,68 +0,0 @@ | |||
| 1 | #.rst: | ||
| 2 | # FindTinyXML | ||
| 3 | # ----------- | ||
| 4 | # Finds the TinyXML library | ||
| 5 | # | ||
| 6 | # This will will define the following variables:: | ||
| 7 | # | ||
| 8 | # TINYXML_FOUND - system has TinyXML | ||
| 9 | # TINYXML_INCLUDE_DIRS - the TinyXML include directory | ||
| 10 | # TINYXML_LIBRARIES - the TinyXML libraries | ||
| 11 | # TINYXML_DEFINITIONS - the TinyXML definitions | ||
| 12 | # | ||
| 13 | # and the following imported targets:: | ||
| 14 | # | ||
| 15 | # TinyXML::TinyXML - The TinyXML library | ||
| 16 | |||
| 17 | if(PKG_CONFIG_FOUND) | ||
| 18 | pkg_check_modules(PC_TINYXML tinyxml QUIET) | ||
| 19 | endif() | ||
| 20 | |||
| 21 | find_path(TINYXML_INCLUDE_DIR tinyxml.h | ||
| 22 | PATH_SUFFIXES tinyxml | ||
| 23 | PATHS ${PC_TINYXML_INCLUDEDIR}) | ||
| 24 | find_library(TINYXML_LIBRARY_RELEASE NAMES tinyxml tinyxmlSTL | ||
| 25 | PATH_SUFFIXES tinyxml | ||
| 26 | PATHS ${PC_TINYXML_LIBDIR}) | ||
| 27 | find_library(TINYXML_LIBRARY_DEBUG NAMES tinyxmld tinyxmlSTLd | ||
| 28 | PATH_SUFFIXES tinyxml | ||
| 29 | PATHS ${PC_TINYXML_LIBDIR}) | ||
| 30 | set(TINYXML_VERSION ${PC_TINYXML_VERSION}) | ||
| 31 | |||
| 32 | include(SelectLibraryConfigurations) | ||
| 33 | select_library_configurations(TINYXML) | ||
| 34 | |||
| 35 | include(FindPackageHandleStandardArgs) | ||
| 36 | find_package_handle_standard_args(TinyXML | ||
| 37 | REQUIRED_VARS TINYXML_LIBRARY TINYXML_INCLUDE_DIR | ||
| 38 | VERSION_VAR TINYXML_VERSION) | ||
| 39 | |||
| 40 | if(TINYXML_FOUND) | ||
| 41 | set(TINYXML_LIBRARIES ${TINYXML_LIBRARY}) | ||
| 42 | set(TINYXML_INCLUDE_DIRS ${TINYXML_INCLUDE_DIR}) | ||
| 43 | if(WIN32) | ||
| 44 | set(TINYXML_DEFINITIONS -DTIXML_USE_STL=1) | ||
| 45 | endif() | ||
| 46 | |||
| 47 | if(NOT TARGET TinyXML::TinyXML) | ||
| 48 | add_library(TinyXML::TinyXML UNKNOWN IMPORTED) | ||
| 49 | if(TINYXML_LIBRARY_RELEASE) | ||
| 50 | set_target_properties(TinyXML::TinyXML PROPERTIES | ||
| 51 | IMPORTED_CONFIGURATIONS RELEASE | ||
| 52 | IMPORTED_LOCATION "${TINYXML_LIBRARY_RELEASE}") | ||
| 53 | endif() | ||
| 54 | if(TINYXML_LIBRARY_DEBUG) | ||
| 55 | set_target_properties(TinyXML::TinyXML PROPERTIES | ||
| 56 | IMPORTED_CONFIGURATIONS DEBUG | ||
| 57 | IMPORTED_LOCATION "${TINYXML_LIBRARY_DEBUG}") | ||
| 58 | endif() | ||
| 59 | set_target_properties(TinyXML::TinyXML PROPERTIES | ||
| 60 | INTERFACE_INCLUDE_DIRECTORIES "${TINYXML_INCLUDE_DIR}") | ||
| 61 | if(WIN32) | ||
| 62 | set_target_properties(TinyXML::TinyXML PROPERTIES | ||
| 63 | INTERFACE_COMPILE_DEFINITIONS TIXML_USE_STL=1) | ||
| 64 | endif() | ||
| 65 | endif() | ||
| 66 | endif() | ||
| 67 | |||
| 68 | mark_as_advanced(TINYXML_INCLUDE_DIR TINYXML_LIBRARY) | ||
diff --git a/project/cmake/modules/FindUDEV.cmake b/project/cmake/modules/FindUDEV.cmake deleted file mode 100644 index 422c437..0000000 --- a/project/cmake/modules/FindUDEV.cmake +++ /dev/null | |||
| @@ -1,47 +0,0 @@ | |||
| 1 | #.rst: | ||
| 2 | # FindUDEV | ||
| 3 | # ------- | ||
| 4 | # Finds the UDEV library | ||
| 5 | # | ||
| 6 | # This will will define the following variables:: | ||
| 7 | # | ||
| 8 | # UDEV_FOUND - system has UDEV | ||
| 9 | # UDEV_INCLUDE_DIRS - the UDEV include directory | ||
| 10 | # UDEV_LIBRARIES - the UDEV libraries | ||
| 11 | # UDEV_DEFINITIONS - the UDEV definitions | ||
| 12 | # | ||
| 13 | # and the following imported targets:: | ||
| 14 | # | ||
| 15 | # UDEV::UDEV - The UDEV library | ||
| 16 | |||
| 17 | if(PKG_CONFIG_FOUND) | ||
| 18 | pkg_check_modules(PC_UDEV libudev QUIET) | ||
| 19 | endif() | ||
| 20 | |||
| 21 | find_path(UDEV_INCLUDE_DIR NAMES libudev.h | ||
| 22 | PATHS ${PC_UDEV_INCLUDEDIR}) | ||
| 23 | find_library(UDEV_LIBRARY NAMES udev | ||
| 24 | PATHS ${PC_UDEV_LIBDIR}) | ||
| 25 | |||
| 26 | set(UDEV_VERSION ${PC_UDEV_VERSION}) | ||
| 27 | |||
| 28 | include(FindPackageHandleStandardArgs) | ||
| 29 | find_package_handle_standard_args(UDEV | ||
| 30 | REQUIRED_VARS UDEV_LIBRARY UDEV_INCLUDE_DIR | ||
| 31 | VERSION_VAR UDEV_VERSION) | ||
| 32 | |||
| 33 | if(UDEV_FOUND) | ||
| 34 | set(UDEV_LIBRARIES ${UDEV_LIBRARY}) | ||
| 35 | set(UDEV_INCLUDE_DIRS ${UDEV_INCLUDE_DIR}) | ||
| 36 | set(UDEV_DEFINITIONS -DHAVE_LIBUDEV=1) | ||
| 37 | |||
| 38 | if(NOT TARGET UDEV::UDEV) | ||
| 39 | add_library(UDEV::UDEV UNKNOWN IMPORTED) | ||
| 40 | set_target_properties(UDEV::UDEV PROPERTIES | ||
| 41 | IMPORTED_LOCATION "${UDEV_LIBRARY}" | ||
| 42 | INTERFACE_INCLUDE_DIRECTORIES "${UDEV_INCLUDE_DIR}" | ||
| 43 | INTERFACE_COMPILE_DEFINITIONS HAVE_LIBUDEV=1) | ||
| 44 | endif() | ||
| 45 | endif() | ||
| 46 | |||
| 47 | mark_as_advanced(UDEV_INCLUDE_DIR UDEV_LIBRARY) | ||
diff --git a/project/cmake/modules/FindUUID.cmake b/project/cmake/modules/FindUUID.cmake deleted file mode 100644 index 173fac2..0000000 --- a/project/cmake/modules/FindUUID.cmake +++ /dev/null | |||
| @@ -1,43 +0,0 @@ | |||
| 1 | #.rst: | ||
| 2 | # FindUUID | ||
| 3 | # -------- | ||
| 4 | # Finds the libuuid library | ||
| 5 | # | ||
| 6 | # This will will define the following variables:: | ||
| 7 | # | ||
| 8 | # UUID_FOUND - system has libuuid | ||
| 9 | # UUID_INCLUDE_DIRS - the libuuid include directory | ||
| 10 | # UUID_LIBRARIES - the libuuid libraries | ||
| 11 | # | ||
| 12 | # and the following imported targets:: | ||
| 13 | # | ||
| 14 | # UUID::UUID - The libuuid library | ||
| 15 | |||
| 16 | if(PKG_CONFIG_FOUND) | ||
| 17 | pkg_check_modules(PC_UUID uuid QUIET) | ||
| 18 | endif() | ||
| 19 | |||
| 20 | find_path(UUID_INCLUDE_DIR uuid/uuid.h | ||
| 21 | PATHS ${PC_UUID_INCLUDEDIR}) | ||
| 22 | find_library(UUID_LIBRARY uuid | ||
| 23 | PATHS ${PC_UUID_LIBRARY}) | ||
| 24 | set(UUID_VERSION ${PC_UUID_VERSION}) | ||
| 25 | |||
| 26 | include(FindPackageHandleStandardArgs) | ||
| 27 | find_package_handle_standard_args(UUID | ||
| 28 | REQUIRED_VARS UUID_LIBRARY UUID_INCLUDE_DIR | ||
| 29 | VERSION_VAR UUID_VERSION) | ||
| 30 | |||
| 31 | if(UUID_FOUND) | ||
| 32 | set(UUID_LIBRARIES ${UUID_LIBRARY}) | ||
| 33 | set(UUID_INCLUDE_DIRS ${UUID_INCLUDE_DIR}) | ||
| 34 | |||
| 35 | if(NOT TARGET UUID::UUID) | ||
| 36 | add_library(UUID::UUID UNKNOWN IMPORTED) | ||
| 37 | set_target_properties(UUID::UUID PROPERTIES | ||
| 38 | IMPORTED_LOCATION "${UUID_LIBRARY}" | ||
| 39 | INTERFACE_INCLUDE_DIRECTORIES "${UUID_INCLUDE_DIR}") | ||
| 40 | endif() | ||
| 41 | endif() | ||
| 42 | |||
| 43 | mark_as_advanced(UUID_INCLUDE_DIR UUID_LIBRARY) | ||
diff --git a/project/cmake/modules/FindVAAPI.cmake b/project/cmake/modules/FindVAAPI.cmake deleted file mode 100644 index ea9a3c9..0000000 --- a/project/cmake/modules/FindVAAPI.cmake +++ /dev/null | |||
| @@ -1,72 +0,0 @@ | |||
| 1 | #.rst: | ||
| 2 | # FindVAAPI | ||
| 3 | # --------- | ||
| 4 | # Finds the VAAPI library | ||
| 5 | # | ||
| 6 | # This will will define the following variables:: | ||
| 7 | # | ||
| 8 | # VAAPI_FOUND - system has VAAPI | ||
| 9 | # VAAPI_INCLUDE_DIRS - the VAAPI include directory | ||
| 10 | # VAAPI_LIBRARIES - the VAAPI libraries | ||
| 11 | # VAAPI_DEFINITIONS - the VAAPI definitions | ||
| 12 | # | ||
| 13 | # and the following imported targets:: | ||
| 14 | # | ||
| 15 | # VAAPI::VAAPI - The VAAPI library | ||
| 16 | |||
| 17 | if(PKG_CONFIG_FOUND) | ||
| 18 | pkg_check_modules(PC_VAAPI libva libva-x11 QUIET) | ||
| 19 | endif() | ||
| 20 | |||
| 21 | find_path(VAAPI_INCLUDE_DIR va/va.h | ||
| 22 | PATHS ${PC_VAAPI_libva_INCLUDEDIR}) | ||
| 23 | find_library(VAAPI_libva_LIBRARY NAMES va | ||
| 24 | PATHS ${PC_VAAPI_libva_LIBDIR}) | ||
| 25 | find_library(VAAPI_libva-x11_LIBRARY NAMES va-x11 | ||
| 26 | PATHS ${PC_VAAPI_libva_LIBDIR}) | ||
| 27 | find_library(VAAPI_libva-drm_LIBRARY NAMES va-drm | ||
| 28 | PATHS ${PC_VAAPI_libva_LIBDIR}) | ||
| 29 | |||
| 30 | if(PC_VAAPI_libva_VERSION) | ||
| 31 | set(VAAPI_VERSION_STRING ${PC_VAAPI_libva_VERSION}) | ||
| 32 | elseif(VAAPI_INCLUDE_DIR AND EXISTS "${VAAPI_INCLUDE_DIR}/va/va_version.h") | ||
| 33 | file(STRINGS "${VAAPI_INCLUDE_DIR}/va/va_version.h" vaapi_version_str REGEX "^#define[\t ]+VA_VERSION_S[\t ]+\".*\".*") | ||
| 34 | string(REGEX REPLACE "^#define[\t ]+VA_VERSION_S[\t ]+\"([^\"]+)\".*" "\\1" VAAPI_VERSION_STRING "${vaapi_version_str}") | ||
| 35 | unset(vaapi_version_str) | ||
| 36 | endif() | ||
| 37 | |||
| 38 | if(NOT VAAPI_FIND_VERSION) | ||
| 39 | set(VAAPI_FIND_VERSION 0.38.0) | ||
| 40 | endif() | ||
| 41 | |||
| 42 | include(FindPackageHandleStandardArgs) | ||
| 43 | find_package_handle_standard_args(VAAPI | ||
| 44 | REQUIRED_VARS VAAPI_libva_LIBRARY VAAPI_libva-x11_LIBRARY VAAPI_libva-drm_LIBRARY VAAPI_INCLUDE_DIR | ||
| 45 | VERSION_VAR VAAPI_VERSION_STRING) | ||
| 46 | |||
| 47 | if(VAAPI_FOUND) | ||
| 48 | set(VAAPI_INCLUDE_DIRS ${VAAPI_INCLUDE_DIR}) | ||
| 49 | set(VAAPI_LIBRARIES ${VAAPI_libva_LIBRARY} ${VAAPI_libva-x11_LIBRARY} ${VAAPI_libva-drm_LIBRARY}) | ||
| 50 | set(VAAPI_DEFINITIONS -DHAVE_LIBVA=1) | ||
| 51 | |||
| 52 | if(NOT TARGET VAAPI::VAAPI_X11) | ||
| 53 | add_library(VAAPI::VAAPI_X11 UNKNOWN IMPORTED) | ||
| 54 | set_target_properties(VAAPI::VAAPI_X11 PROPERTIES | ||
| 55 | IMPORTED_LOCATION "${VAAPI_libva-x11_LIBRARY}") | ||
| 56 | endif() | ||
| 57 | if (NOT TARGET VAAPI::VAAPI_DRM) | ||
| 58 | add_library(VAAPI::VAAPI_DRM UNKNOWN IMPORTED) | ||
| 59 | set_target_properties(VAAPI::VAAPI_DRM PROPERTIES | ||
| 60 | IMPORTED_LOCATION "${VAAPI_libva-drm_LIBRARY}") | ||
| 61 | endif() | ||
| 62 | if(NOT TARGET VAAPI::VAAPI) | ||
| 63 | add_library(VAAPI::VAAPI UNKNOWN IMPORTED) | ||
| 64 | set_target_properties(VAAPI::VAAPI PROPERTIES | ||
| 65 | IMPORTED_LOCATION "${VAAPI_libva_LIBRARY}" | ||
| 66 | INTERFACE_INCLUDE_DIRECTORIES "${VAAPI_INCLUDE_DIR}" | ||
| 67 | INTERFACE_COMPILE_DEFINITIONS HAVE_LIBVA=1 | ||
| 68 | INTERFACE_LINK_LIBRARIES "VAAPI::VAAPI_X11 VAAPI::VAAPI_DRM") | ||
| 69 | endif() | ||
| 70 | endif() | ||
| 71 | |||
| 72 | mark_as_advanced(VAAPI_INCLUDE_DIR VAAPI_libva_LIBRARY VAAPI_libva-x11_LIBRARY VAAPI_libva-drm_LIBRARY) | ||
diff --git a/project/cmake/modules/FindVDPAU.cmake b/project/cmake/modules/FindVDPAU.cmake deleted file mode 100644 index b99e03f..0000000 --- a/project/cmake/modules/FindVDPAU.cmake +++ /dev/null | |||
| @@ -1,47 +0,0 @@ | |||
| 1 | #.rst: | ||
| 2 | # FindVDPAU | ||
| 3 | # --------- | ||
| 4 | # Finds the VDPAU library | ||
| 5 | # | ||
| 6 | # This will will define the following variables:: | ||
| 7 | # | ||
| 8 | # VDPAU_FOUND - system has VDPAU | ||
| 9 | # VDPAU_INCLUDE_DIRS - the VDPAU include directory | ||
| 10 | # VDPAU_LIBRARIES - the VDPAU libraries | ||
| 11 | # VDPAU_DEFINITIONS - the VDPAU definitions | ||
| 12 | # | ||
| 13 | # and the following imported targets:: | ||
| 14 | # | ||
| 15 | # VDPAU::VDPAU - The VDPAU library | ||
| 16 | |||
| 17 | if(PKG_CONFIG_FOUND) | ||
| 18 | pkg_check_modules(PC_VDPAU vdpau QUIET) | ||
| 19 | endif() | ||
| 20 | |||
| 21 | find_path(VDPAU_INCLUDE_DIR NAMES vdpau/vdpau.h vdpau/vdpau_x11.h | ||
| 22 | PATHS ${PC_VDPAU_INCLUDEDIR}) | ||
| 23 | find_library(VDPAU_LIBRARY NAMES vdpau | ||
| 24 | PATHS ${PC_VDPAU_LIBDIR}) | ||
| 25 | |||
| 26 | set(VDPAU_VERSION ${PC_VDPAU_VERSION}) | ||
| 27 | |||
| 28 | include(FindPackageHandleStandardArgs) | ||
| 29 | find_package_handle_standard_args(VDPAU | ||
| 30 | REQUIRED_VARS VDPAU_LIBRARY VDPAU_INCLUDE_DIR | ||
| 31 | VERSION_VAR VDPAU_VERSION) | ||
| 32 | |||
| 33 | if(VDPAU_FOUND) | ||
| 34 | set(VDPAU_INCLUDE_DIRS ${VDPAU_INCLUDE_DIR}) | ||
| 35 | set(VDPAU_LIBRARIES ${VDPAU_LIBRARY}) | ||
| 36 | set(VDPAU_DEFINITIONS -DHAVE_LIBVDPAU=1) | ||
| 37 | |||
| 38 | if(NOT TARGET VDPAU::VDPAU) | ||
| 39 | add_library(VDPAU::VDPAU UNKNOWN IMPORTED) | ||
| 40 | set_target_properties(VDPAU::VDPAU PROPERTIES | ||
| 41 | IMPORTED_LOCATION "${VDPAU_LIBRARY}" | ||
| 42 | INTERFACE_INCLUDE_DIRECTORIES "${VDPAU_INCLUDE_DIR}" | ||
| 43 | INTERFACE_COMPILE_DEFINITIONS HAVE_LIBVDPAU=1) | ||
| 44 | endif() | ||
| 45 | endif() | ||
| 46 | |||
| 47 | mark_as_advanced(VDPAU_INCLUDE_DIR VDPAU_LIBRARY) | ||
diff --git a/project/cmake/modules/FindX.cmake b/project/cmake/modules/FindX.cmake deleted file mode 100644 index 19bb770..0000000 --- a/project/cmake/modules/FindX.cmake +++ /dev/null | |||
| @@ -1,57 +0,0 @@ | |||
| 1 | #.rst: | ||
| 2 | # FindX | ||
| 3 | # ----- | ||
| 4 | # Finds the X11 library | ||
| 5 | # | ||
| 6 | # This will will define the following variables:: | ||
| 7 | # | ||
| 8 | # X_FOUND - system has X11 | ||
| 9 | # X_INCLUDE_DIRS - the X11 include directory | ||
| 10 | # X_LIBRARIES - the X11 libraries | ||
| 11 | # X_DEFINITIONS - the X11 definitions | ||
| 12 | # | ||
| 13 | # and the following imported targets:: | ||
| 14 | # | ||
| 15 | # X::X - The X11 library | ||
| 16 | # X::Xext - The X11 extension library | ||
| 17 | |||
| 18 | if(PKG_CONFIG_FOUND) | ||
| 19 | pkg_check_modules(PC_X x11 xext QUIET) | ||
| 20 | endif() | ||
| 21 | |||
| 22 | find_path(X_INCLUDE_DIR NAMES X11/Xlib.h | ||
| 23 | PATHS ${PC_X_x11_INCLUDEDIR}) | ||
| 24 | find_library(X_LIBRARY NAMES X11 | ||
| 25 | PATHS ${PC_X_x11_LIBDIR}) | ||
| 26 | find_library(X_EXT_LIBRARY NAMES Xext | ||
| 27 | PATHS ${PC_X_xext_LIBDIR}) | ||
| 28 | |||
| 29 | set(X_VERSION ${PC_X_x11_VERSION}) | ||
| 30 | |||
| 31 | include(FindPackageHandleStandardArgs) | ||
| 32 | find_package_handle_standard_args(X | ||
| 33 | REQUIRED_VARS X_LIBRARY X_EXT_LIBRARY X_INCLUDE_DIR | ||
| 34 | VERSION_VAR X_VERSION) | ||
| 35 | |||
| 36 | if(X_FOUND) | ||
| 37 | set(X_LIBRARIES ${X_LIBRARY} ${X_EXT_LIBRARY}) | ||
| 38 | set(X_INCLUDE_DIRS ${X_INCLUDE_DIR}) | ||
| 39 | set(X_DEFINITIONS -DHAVE_X11=1) | ||
| 40 | |||
| 41 | if(NOT TARGET X::X) | ||
| 42 | add_library(X::X UNKNOWN IMPORTED) | ||
| 43 | set_target_properties(X::X PROPERTIES | ||
| 44 | IMPORTED_LOCATION "${X_LIBRARY}" | ||
| 45 | INTERFACE_INCLUDE_DIRECTORIES "${X_INCLUDE_DIR}" | ||
| 46 | INTERFACE_COMPILE_DEFINITIONS HAVE_X11=1) | ||
| 47 | endif() | ||
| 48 | if(NOT TARGET X::Xext) | ||
| 49 | add_library(X::Xext UNKNOWN IMPORTED) | ||
| 50 | set_target_properties(X::Xext PROPERTIES | ||
| 51 | IMPORTED_LOCATION "${X_EXT_LIBRARY}" | ||
| 52 | INTERFACE_INCLUDE_DIRECTORIES "${X_INCLUDE_DIR}" | ||
| 53 | INTERFACE_LINK_LIBRARIES X::X) | ||
| 54 | endif() | ||
| 55 | endif() | ||
| 56 | |||
| 57 | mark_as_advanced(X_INCLUDE_DIR X_LIBRARY X_EXT_LIBRARY) | ||
diff --git a/project/cmake/modules/FindXRandR.cmake b/project/cmake/modules/FindXRandR.cmake deleted file mode 100644 index 9feaedc..0000000 --- a/project/cmake/modules/FindXRandR.cmake +++ /dev/null | |||
| @@ -1,47 +0,0 @@ | |||
| 1 | #.rst: | ||
| 2 | # FindXRandR | ||
| 3 | # ---------- | ||
| 4 | # Finds the XRandR library | ||
| 5 | # | ||
| 6 | # This will will define the following variables:: | ||
| 7 | # | ||
| 8 | # XRANDR_FOUND - system has XRANDR | ||
| 9 | # XRANDR_INCLUDE_DIRS - the XRANDR include directory | ||
| 10 | # XRANDR_LIBRARIES - the XRANDR libraries | ||
| 11 | # XRANDR_DEFINITIONS - the XRANDR definitions | ||
| 12 | # | ||
| 13 | # and the following imported targets:: | ||
| 14 | # | ||
| 15 | # XRandR::XRandR - The XRANDR library | ||
| 16 | |||
| 17 | if(PKG_CONFIG_FOUND) | ||
| 18 | pkg_check_modules(PC_XRANDR xrandr QUIET) | ||
| 19 | endif() | ||
| 20 | |||
| 21 | find_path(XRANDR_INCLUDE_DIR NAMES X11/extensions/Xrandr.h | ||
| 22 | PATHS ${PC_XRANDR_INCLUDEDIR}) | ||
| 23 | find_library(XRANDR_LIBRARY NAMES Xrandr | ||
| 24 | PATHS ${PC_XRANDR_LIBDIR}) | ||
| 25 | |||
| 26 | set(XRANDR_VERSION ${PC_XRANDR_VERSION}) | ||
| 27 | |||
| 28 | include(FindPackageHandleStandardArgs) | ||
| 29 | find_package_handle_standard_args(XRandR | ||
| 30 | REQUIRED_VARS XRANDR_LIBRARY XRANDR_INCLUDE_DIR | ||
| 31 | VERSION_VAR XRANDR_VERSION) | ||
| 32 | |||
| 33 | if(XRANDR_FOUND) | ||
| 34 | set(XRANDR_LIBRARIES ${XRANDR_LIBRARY}) | ||
| 35 | set(XRANDR_INCLUDE_DIRS ${XRANDR_INCLUDE_DIR}) | ||
| 36 | set(XRANDR_DEFINITIONS -DHAVE_LIBXRANDR=1) | ||
| 37 | |||
| 38 | if(NOT TARGET XRandR::XRandR) | ||
| 39 | add_library(XRandR::XRandR UNKNOWN IMPORTED) | ||
| 40 | set_target_properties(XRandR::XRandR PROPERTIES | ||
| 41 | IMPORTED_LOCATION "${XRANDR_LIBRARY}" | ||
| 42 | INTERFACE_INCLUDE_DIRECTORIES "${XRANDR_INCLUDE_DIR}" | ||
| 43 | INTERFACE_COMPILE_DEFINITIONS HAVE_LIBXRANDR=1) | ||
| 44 | endif() | ||
| 45 | endif() | ||
| 46 | |||
| 47 | mark_as_advanced(XRANDR_INCLUDE_DIR XRANDR_LIBRARY) | ||
diff --git a/project/cmake/modules/FindXSLT.cmake b/project/cmake/modules/FindXSLT.cmake deleted file mode 100644 index f7fea9e..0000000 --- a/project/cmake/modules/FindXSLT.cmake +++ /dev/null | |||
| @@ -1,50 +0,0 @@ | |||
| 1 | #.rst: | ||
| 2 | # FindXSLT | ||
| 3 | # -------- | ||
| 4 | # Finds the XSLT library | ||
| 5 | # | ||
| 6 | # This will will define the following variables:: | ||
| 7 | # | ||
| 8 | # XSLT_FOUND - system has XSLT | ||
| 9 | # XSLT_INCLUDE_DIRS - the XSLT include directory | ||
| 10 | # XSLT_LIBRARIES - the XSLT libraries | ||
| 11 | # XSLT_DEFINITIONS - the XSLT definitions | ||
| 12 | # | ||
| 13 | # and the following imported targets:: | ||
| 14 | # | ||
| 15 | # XSLT::XSLT - The XSLT library | ||
| 16 | |||
| 17 | find_package(LibXml2 REQUIRED) | ||
| 18 | |||
| 19 | if(PKG_CONFIG_FOUND) | ||
| 20 | pkg_check_modules(PC_XSLT libxslt QUIET) | ||
| 21 | endif() | ||
| 22 | |||
| 23 | find_path(XSLT_INCLUDE_DIR NAMES libxslt/xslt.h | ||
| 24 | PATHS ${PC_XSLT_INCLUDEDIR}) | ||
| 25 | find_library(XSLT_LIBRARY NAMES xslt libxslt | ||
| 26 | PATHS ${PC_XSLT_LIBDIR}) | ||
| 27 | |||
| 28 | set(XSLT_VERSION ${PC_XSLT_VERSION}) | ||
| 29 | |||
| 30 | include(FindPackageHandleStandardArgs) | ||
| 31 | find_package_handle_standard_args(XSLT | ||
| 32 | REQUIRED_VARS XSLT_LIBRARY XSLT_INCLUDE_DIR | ||
| 33 | VERSION_VAR XSLT_VERSION) | ||
| 34 | |||
| 35 | if(XSLT_FOUND) | ||
| 36 | set(XSLT_LIBRARIES ${XSLT_LIBRARY} ${LIBXML2_LIBRARIES}) | ||
| 37 | set(XSLT_INCLUDE_DIRS ${XSLT_INCLUDE_DIR} ${LIBXML2_INCLUDE_DIR}) | ||
| 38 | set(XSLT_DEFINITIONS -DHAVE_LIBXSLT=1) | ||
| 39 | |||
| 40 | if(NOT TARGET XSLT::XSLT) | ||
| 41 | add_library(XSLT::XSLT UNKNOWN IMPORTED) | ||
| 42 | set_target_properties(XSLT::XSLT PROPERTIES | ||
| 43 | IMPORTED_LOCATION "${XSLT_LIBRARY}" | ||
| 44 | INTERFACE_INCLUDE_DIRECTORIES "${XSLT_INCLUDE_DIR} ${LIBXML2_INCLUDE_DIR}" | ||
| 45 | INTERFACE_COMPILE_DEFINITIONS HAVE_LIBXSLT=1 | ||
| 46 | INTERFACE_LINK_LIBRARIES "${LIBXML2_LIBRARIES}") | ||
| 47 | endif() | ||
| 48 | endif() | ||
| 49 | |||
| 50 | mark_as_advanced(XSLT_INCLUDE_DIR XSLT_LIBRARY) | ||
diff --git a/project/cmake/modules/FindYajl.cmake b/project/cmake/modules/FindYajl.cmake deleted file mode 100644 index c73a67b..0000000 --- a/project/cmake/modules/FindYajl.cmake +++ /dev/null | |||
| @@ -1,62 +0,0 @@ | |||
| 1 | #.rst: | ||
| 2 | # FindYajl | ||
| 3 | # -------- | ||
| 4 | # Finds the Yajl library | ||
| 5 | # | ||
| 6 | # This will will define the following variables:: | ||
| 7 | # | ||
| 8 | # YAJL_FOUND - system has Yajl | ||
| 9 | # YAJL_INCLUDE_DIRS - Yajl include directory | ||
| 10 | # YAJL_LIBRARIES - the Yajl libraries | ||
| 11 | # | ||
| 12 | # and the following imported targets:: | ||
| 13 | # | ||
| 14 | # Yajl::Yajl - The Yajl library | ||
| 15 | |||
| 16 | if(NOT Yajl_FIND_VERSION) | ||
| 17 | set(Yajl_FIND_VERSION 2.0.0) | ||
| 18 | endif() | ||
| 19 | |||
| 20 | if(PKG_CONFIG_FOUND) | ||
| 21 | pkg_check_modules(PC_YAJL yajl>=${Yajl_FIND_VERSION} QUIET) | ||
| 22 | endif() | ||
| 23 | |||
| 24 | find_path(YAJL_INCLUDE_DIR NAMES yajl/yajl_common.h | ||
| 25 | PATHS ${PC_YAJL_INCLUDEDIR}) | ||
| 26 | find_library(YAJL_LIBRARY NAMES yajl | ||
| 27 | PATHS ${PC_YAJL_LIBDIR}) | ||
| 28 | |||
| 29 | if(PC_YAJL_VERSION) | ||
| 30 | set(YAJL_VERSION_STRING ${PC_YAJL_VERSION}) | ||
| 31 | elseif(YAJL_INCLUDE_DIR AND EXISTS "${YAJL_INCLUDE_DIR}/yajl/yajl_version.h") | ||
| 32 | file(STRINGS "${YAJL_INCLUDE_DIR}/yajl/yajl_version.h" yajl_version_str REGEX "^[ \t]*#define[ \t]+YAJL_(MAJOR|MINOR|MICRO)") | ||
| 33 | string(REGEX REPLACE "YAJL_MAJOR ([0-9]+)" "\\1" YAJL_VERSION_MAJOR "${YAJL_VERSION_MAJOR}") | ||
| 34 | |||
| 35 | string(REGEX REPLACE ".*YAJL_MAJOR ([0-9]+).*" "\\1" yajl_major "${yajl_version_str}") | ||
| 36 | string(REGEX REPLACE ".*YAJL_MINOR ([0-9]+).*" "\\1" yajl_minor "${yajl_version_str}") | ||
| 37 | string(REGEX REPLACE ".*YAJL_MICRO ([0-9]+).*" "\\1" yajl_micro "${yajl_version_str}") | ||
| 38 | set(YAJL_VERSION_STRING "${yajl_major}.${yajl_minor}.${yajl_micro}") | ||
| 39 | unset(yajl_version_str) | ||
| 40 | unset(yajl_major) | ||
| 41 | unset(yajl_minor) | ||
| 42 | unset(yajl_micro) | ||
| 43 | endif() | ||
| 44 | |||
| 45 | include(FindPackageHandleStandardArgs) | ||
| 46 | find_package_handle_standard_args(Yajl | ||
| 47 | REQUIRED_VARS YAJL_LIBRARY YAJL_INCLUDE_DIR | ||
| 48 | VERSION_VAR YAJL_VERSION_STRING) | ||
| 49 | |||
| 50 | if(YAJL_FOUND) | ||
| 51 | set(YAJL_INCLUDE_DIRS ${YAJL_INCLUDE_DIR}) | ||
| 52 | set(YAJL_LIBRARIES ${YAJL_LIBRARY}) | ||
| 53 | |||
| 54 | if(NOT TARGET Yajl::Yajl) | ||
| 55 | add_library(Yajl::Yajl UNKNOWN IMPORTED) | ||
| 56 | set_target_properties(Yajl::Yajl PROPERTIES | ||
| 57 | IMPORTED_LOCATION "${YAJL_LIBRARY}" | ||
| 58 | INTERFACE_INCLUDE_DIRECTORIES "${YAJL_INCLUDE_DIR}") | ||
| 59 | endif() | ||
| 60 | endif() | ||
| 61 | |||
| 62 | mark_as_advanced(YAJL_INCLUDE_DIR YAJL_LIBRARY) | ||
diff --git a/project/cmake/modules/FindZip.cmake b/project/cmake/modules/FindZip.cmake deleted file mode 100644 index e0a38c1..0000000 --- a/project/cmake/modules/FindZip.cmake +++ /dev/null | |||
| @@ -1,46 +0,0 @@ | |||
| 1 | #.rst: | ||
| 2 | # FindZip | ||
| 3 | # ----------- | ||
| 4 | # Finds the Zip library | ||
| 5 | # | ||
| 6 | # This will will define the following variables:: | ||
| 7 | # | ||
| 8 | # ZIP_FOUND - system has Zip | ||
| 9 | # ZIP_INCLUDE_DIRS - the Zip include directory | ||
| 10 | # ZIP_LIBRARIES - the Zip libraries | ||
| 11 | # ZIP_DEFINITIONS - the Zip libraries | ||
| 12 | # | ||
| 13 | # and the following imported targets:: | ||
| 14 | # | ||
| 15 | # ZIP::ZIP - The Zip library | ||
| 16 | |||
| 17 | if(PKG_CONFIG_FOUND) | ||
| 18 | pkg_check_modules(PC_ZIP libzip QUIET) | ||
| 19 | endif() | ||
| 20 | |||
| 21 | find_path(ZIP_INCLUDE_DIR zip.h | ||
| 22 | PATHS ${PC_ZIP_INCLUDEDIR}) | ||
| 23 | find_library(ZIP_LIBRARY NAMES zip | ||
| 24 | PATHS ${PC_ZIP_LIBDIR}) | ||
| 25 | set(ZIP_VERSION ${PC_ZIP_VERSION}) | ||
| 26 | |||
| 27 | include(FindPackageHandleStandardArgs) | ||
| 28 | find_package_handle_standard_args(ZIP | ||
| 29 | REQUIRED_VARS ZIP_LIBRARY ZIP_INCLUDE_DIR | ||
| 30 | VERSION_VAR ZIP_VERSION) | ||
| 31 | |||
| 32 | if(ZIP_FOUND) | ||
| 33 | set(ZIP_LIBRARIES ${ZIP_LIBRARY}) | ||
| 34 | set(ZIP_INCLUDE_DIRS ${ZIP_INCLUDE_DIR}) | ||
| 35 | set(ZIP_DEFINITIONS "${PC_ZIP_CFLAGS}") | ||
| 36 | |||
| 37 | if(NOT TARGET ZIP::ZIP) | ||
| 38 | add_library(ZIP::ZIP UNKNOWN IMPORTED) | ||
| 39 | set_target_properties(ZIP::ZIP PROPERTIES | ||
| 40 | IMPORTED_LOCATION "${ZIP_LIBRARY}" | ||
| 41 | INTERFACE_INCLUDE_DIRECTORIES "${ZIP_INCLUDE_DIR}" | ||
| 42 | INTERFACE_COMPILE_DEFINITIONS "${PC_ZIP_CFLAGS}") | ||
| 43 | endif() | ||
| 44 | endif() | ||
| 45 | |||
| 46 | mark_as_advanced(ZIP_INCLUDE_DIR ZIP_LIBRARY) | ||
diff --git a/project/cmake/modules/LDGOLD.cmake b/project/cmake/modules/LDGOLD.cmake deleted file mode 100644 index ad19c6b..0000000 --- a/project/cmake/modules/LDGOLD.cmake +++ /dev/null | |||
| @@ -1,45 +0,0 @@ | |||
| 1 | option(ENABLE_LDGOLD "Use GNU gold linker" ON) | ||
| 2 | |||
| 3 | set(LDGOLD_FOUND FALSE) | ||
| 4 | if(ENABLE_LDGOLD) | ||
| 5 | execute_process(COMMAND ${CMAKE_C_COMPILER} -fuse-ld=gold -Wl,--version ERROR_QUIET OUTPUT_VARIABLE LD_VERSION) | ||
| 6 | if(LD_VERSION MATCHES "GNU gold") | ||
| 7 | set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=gold") | ||
| 8 | set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=gold") | ||
| 9 | set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=gold") | ||
| 10 | set(LDGOLD_FOUND TRUE) | ||
| 11 | message(STATUS "Linker: GNU gold") | ||
| 12 | else() | ||
| 13 | message(WARNING "GNU gold linker is not available, falling back to default system linker") | ||
| 14 | endif() | ||
| 15 | else() | ||
| 16 | message(STATUS "Linker: Default system linker") | ||
| 17 | endif() | ||
| 18 | |||
| 19 | set(DEFAULT_ENABLE_DEBUGFISSION FALSE) | ||
| 20 | if(CMAKE_BUILD_TYPE STREQUAL Debug OR | ||
| 21 | CMAKE_BUILD_TYPE STREQUAL RelWithDebInfo AND | ||
| 22 | LDGOLD_FOUND) | ||
| 23 | set(DEFAULT_ENABLE_DEBUGFISSION TRUE) | ||
| 24 | endif() | ||
| 25 | |||
| 26 | include(CMakeDependentOption) | ||
| 27 | cmake_dependent_option(ENABLE_DEBUGFISSION "Enable Debug Fission support" ON | ||
| 28 | "DEFAULT_ENABLE_DEBUGFISSION" OFF) | ||
| 29 | |||
| 30 | set(DEBUGFISSION_FOUND FALSE) | ||
| 31 | if(ENABLE_DEBUGFISSION) | ||
| 32 | include(TestCXXAcceptsFlag) | ||
| 33 | check_cxx_accepts_flag(-gsplit-dwarf CXX_ACCEPTS_GSPLIT_DWARF) | ||
| 34 | if(CXX_ACCEPTS_GSPLIT_DWARF) | ||
| 35 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -gsplit-dwarf") | ||
| 36 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -gsplit-dwarf") | ||
| 37 | set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--gdb-index") | ||
| 38 | set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--gdb-index") | ||
| 39 | set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--gdb-index") | ||
| 40 | set(DEBUGFISSION_FOUND TRUE) | ||
| 41 | message(STATUS "Debug Fission enabled") | ||
| 42 | else() | ||
| 43 | message(WARNING "Debug Fission is not available") | ||
| 44 | endif() | ||
| 45 | endif() | ||
diff --git a/project/cmake/modules/extra/ECMEnableSanitizers.cmake b/project/cmake/modules/extra/ECMEnableSanitizers.cmake deleted file mode 100644 index aa7092d..0000000 --- a/project/cmake/modules/extra/ECMEnableSanitizers.cmake +++ /dev/null | |||
| @@ -1,149 +0,0 @@ | |||
| 1 | #.rst: | ||
| 2 | # ECMEnableSanitizers | ||
| 3 | # ------------------- | ||
| 4 | # | ||
| 5 | # Enable compiler sanitizer flags. | ||
| 6 | # | ||
| 7 | # The following sanitizers are supported: | ||
| 8 | # | ||
| 9 | # - Address Sanitizer | ||
| 10 | # - Memory Sanitizer | ||
| 11 | # - Thread Sanitizer | ||
| 12 | # - Leak Sanitizer | ||
| 13 | # - Undefined Behaviour Sanitizer | ||
| 14 | # | ||
| 15 | # All of them are implemented in Clang, depending on your version, and | ||
| 16 | # there is an work in progress in GCC, where some of them are currently | ||
| 17 | # implemented. | ||
| 18 | # | ||
| 19 | # This module will check your current compiler version to see if it | ||
| 20 | # supports the sanitizers that you want to enable | ||
| 21 | # | ||
| 22 | # Usage | ||
| 23 | # ===== | ||
| 24 | # | ||
| 25 | # Simply add:: | ||
| 26 | # | ||
| 27 | # include(ECMEnableSanitizers) | ||
| 28 | # | ||
| 29 | # to your ``CMakeLists.txt``. Note that this module is included in | ||
| 30 | # KDECompilerSettings, so projects using that module do not need to also | ||
| 31 | # include this one. | ||
| 32 | # | ||
| 33 | # The sanitizers are not enabled by default. Instead, you must set | ||
| 34 | # ``ECM_ENABLE_SANITIZERS`` (either in your ``CMakeLists.txt`` or on the | ||
| 35 | # command line) to a semicolon-separated list of sanitizers you wish to enable. | ||
| 36 | # The options are: | ||
| 37 | # | ||
| 38 | # - address | ||
| 39 | # - memory | ||
| 40 | # - thread | ||
| 41 | # - leak | ||
| 42 | # - undefined | ||
| 43 | # | ||
| 44 | # The sanitizers "address", "memory" and "thread" are mutually exclusive. You | ||
| 45 | # cannot enable two of them in the same build. | ||
| 46 | # | ||
| 47 | # "leak" requires the "address" sanitizer. | ||
| 48 | # | ||
| 49 | # .. note:: | ||
| 50 | # | ||
| 51 | # To reduce the overhead induced by the instrumentation of the sanitizers, it | ||
| 52 | # is advised to enable compiler optimizations (``-O1`` or higher). | ||
| 53 | # | ||
| 54 | # Example | ||
| 55 | # ======= | ||
| 56 | # | ||
| 57 | # This is an example of usage:: | ||
| 58 | # | ||
| 59 | # mkdir build | ||
| 60 | # cd build | ||
| 61 | # cmake -DECM_ENABLE_SANITIZERS='address;leak;undefined' .. | ||
| 62 | # | ||
| 63 | # .. note:: | ||
| 64 | # | ||
| 65 | # Most of the sanitizers will require Clang. To enable it, use:: | ||
| 66 | # | ||
| 67 | # -DCMAKE_CXX_COMPILER=clang++ | ||
| 68 | # | ||
| 69 | # Since 1.3.0. | ||
| 70 | |||
| 71 | #============================================================================= | ||
| 72 | # Copyright 2014 Mathieu Tarral <mathieu.tarral@gmail.com> | ||
| 73 | # | ||
| 74 | # Distributed under the OSI-approved BSD License (the "License"); | ||
| 75 | # see accompanying file COPYING-CMAKE-SCRIPTS for details. | ||
| 76 | # | ||
| 77 | # This software is distributed WITHOUT ANY WARRANTY; without even the | ||
| 78 | # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
| 79 | # See the License for more information. | ||
| 80 | #============================================================================= | ||
| 81 | # (To distribute this file outside of extra-cmake-modules, substitute the full | ||
| 82 | # License text for the above reference.) | ||
| 83 | |||
| 84 | # MACRO check_compiler_version | ||
| 85 | #----------------------------- | ||
| 86 | macro (check_compiler_version gcc_required_version clang_required_version) | ||
| 87 | if ( | ||
| 88 | ( | ||
| 89 | CMAKE_CXX_COMPILER_ID MATCHES "GNU" | ||
| 90 | AND | ||
| 91 | CMAKE_CXX_COMPILER_VERSION VERSION_LESS ${gcc_required_version} | ||
| 92 | ) | ||
| 93 | OR | ||
| 94 | ( | ||
| 95 | CMAKE_CXX_COMPILER_ID MATCHES "Clang" | ||
| 96 | AND | ||
| 97 | CMAKE_CXX_COMPILER_VERSION VERSION_LESS ${clang_required_version} | ||
| 98 | ) | ||
| 99 | ) | ||
| 100 | # error ! | ||
| 101 | message(FATAL_ERROR "You ask to enable the sanitizer ${CUR_SANITIZER}, | ||
| 102 | but your compiler ${CMAKE_CXX_COMPILER_ID} version ${CMAKE_CXX_COMPILER_VERSION} | ||
| 103 | does not support it ! | ||
| 104 | You should use at least GCC ${gcc_required_version} or Clang ${clang_required_version} | ||
| 105 | (99.99 means not implemented yet)") | ||
| 106 | endif () | ||
| 107 | endmacro () | ||
| 108 | |||
| 109 | # MACRO check_compiler_support | ||
| 110 | #------------------------------ | ||
| 111 | macro (enable_sanitizer_flags sanitize_option) | ||
| 112 | if (${sanitize_option} MATCHES "address") | ||
| 113 | check_compiler_version("4.8" "3.1") | ||
| 114 | set(XSAN_COMPILE_FLAGS "-fsanitize=address -fno-omit-frame-pointer -fno-optimize-sibling-calls") | ||
| 115 | set(XSAN_LINKER_FLAGS "asan") | ||
| 116 | elseif (${sanitize_option} MATCHES "thread") | ||
| 117 | check_compiler_version("4.8" "3.1") | ||
| 118 | set(XSAN_COMPILE_FLAGS "-fsanitize=thread") | ||
| 119 | set(XSAN_LINKER_FLAGS "tsan") | ||
| 120 | elseif (${sanitize_option} MATCHES "memory") | ||
| 121 | check_compiler_version("99.99" "3.1") | ||
| 122 | set(XSAN_COMPILE_FLAGS "-fsanitize=memory") | ||
| 123 | elseif (${sanitize_option} MATCHES "leak") | ||
| 124 | check_compiler_version("4.9" "3.4") | ||
| 125 | set(XSAN_COMPILE_FLAGS "-fsanitize=leak") | ||
| 126 | set(XSAN_LINKER_FLAGS "lsan") | ||
| 127 | elseif (${sanitize_option} MATCHES "undefined") | ||
| 128 | check_compiler_version("4.9" "3.1") | ||
| 129 | set(XSAN_COMPILE_FLAGS "-fsanitize=undefined -fno-omit-frame-pointer -fno-optimize-sibling-calls") | ||
| 130 | else () | ||
| 131 | message(FATAL_ERROR "Compiler sanitizer option \"${sanitize_option}\" not supported.") | ||
| 132 | endif () | ||
| 133 | endmacro () | ||
| 134 | |||
| 135 | # for each element of the ECM_ENABLE_SANITIZERS list | ||
| 136 | foreach ( CUR_SANITIZER ${ECM_ENABLE_SANITIZERS} ) | ||
| 137 | # lowercase filter | ||
| 138 | string(TOLOWER ${CUR_SANITIZER} CUR_SANITIZER) | ||
| 139 | # check option and enable appropriate flags | ||
| 140 | enable_sanitizer_flags ( ${CUR_SANITIZER} ) | ||
| 141 | set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${XSAN_COMPILE_FLAGS}" ) | ||
| 142 | if(CMAKE_CXX_COMPILER_ID MATCHES "GNU") | ||
| 143 | link_libraries(${XSAN_LINKER_FLAGS}) | ||
| 144 | endif() | ||
| 145 | if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") | ||
| 146 | string(REPLACE "-Wl,--no-undefined" "" CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS}") | ||
| 147 | string(REPLACE "-Wl,--no-undefined" "" CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS}") | ||
| 148 | endif () | ||
| 149 | endforeach () | ||
