From 1fc226e0eb2d0cee924aa1509412cb6078143cd1 Mon Sep 17 00:00:00 2001 From: Evgeny Grin Date: Sun, 9 Aug 2020 15:57:06 +0300 Subject: [PATCH 01/13] CheckPlatformSupport.cmake: really use cache for HAVE_DRM_EDID_PARSER --- src/libcec/cmake/CheckPlatformSupport.cmake | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/libcec/cmake/CheckPlatformSupport.cmake b/src/libcec/cmake/CheckPlatformSupport.cmake index a7f65596..778c7211 100644 --- a/src/libcec/cmake/CheckPlatformSupport.cmake +++ b/src/libcec/cmake/CheckPlatformSupport.cmake @@ -37,7 +37,6 @@ SET(HAVE_AOCEC_API OFF CACHE BOOL "aocec not supported") # Pulse-Eight devices are always supported set(HAVE_P8_USB ON CACHE BOOL "p8 usb-cec supported" FORCE) set(HAVE_P8_USB_DETECT OFF CACHE BOOL "p8 usb-cec detection not supported") -set(HAVE_DRM_EDID_PARSER OFF CACHE BOOL "drm edid parser not supported") # Raspberry Pi libs and headers are in a non-standard path on some distributions set(RPI_INCLUDE_DIR "" CACHE FILEPATH "root path to Raspberry Pi includes") set(RPI_LIB_DIR "" CACHE FILEPATH "root path to Raspberry Pi libs") @@ -81,8 +80,7 @@ else() # always try DRM on Linux if other methods fail if(NOT CMAKE_SYSTEM_NAME MATCHES "FreeBSD") - set(HAVE_DRM_EDID_PARSER ON CACHE BOOL "drm edid parser not supported" FORCE) - set(LIB_INFO "${LIB_INFO}, DRM") + set(HAVE_DRM_EDID_PARSER ON CACHE BOOL "drm edid parser supported") endif() # flock @@ -195,6 +193,12 @@ check_library_exists(rt clock_gettime "" HAVE_RT) # check for dlopen check_library_exists(dl dlopen "" HAVE_DLOPEN) +if (HAVE_DRM_EDID_PARSER) + set(LIB_INFO "${LIB_INFO}, DRM") +else() + set(HAVE_DRM_EDID_PARSER OFF CACHE BOOL "DRM EDID parser supported") +endif() + SET(SKIP_PYTHON_WRAPPER 0 CACHE STRING "Define to 1 to not generate the Python wrapper") if (${SKIP_PYTHON_WRAPPER}) From 4006474e942a419e5283317f191758a253be72c8 Mon Sep 17 00:00:00 2001 From: Evgeny Grin Date: Mon, 10 Aug 2020 11:27:58 +0300 Subject: [PATCH 02/13] CheckPlatformSupport.cmake: don't override HAVE_LIBUDEV variable, Mark HAVE_P8_USB_DETECT as internal (no way to define it externally), Always enable HAVE_P8_USB_DETECT on linux (for SYSFS detection), Fixed CMAKE_REQUIRED_LIBRARIES if libudev is used. --- src/libcec/cmake/CheckPlatformSupport.cmake | 49 ++++++++++++++------- 1 file changed, 32 insertions(+), 17 deletions(-) diff --git a/src/libcec/cmake/CheckPlatformSupport.cmake b/src/libcec/cmake/CheckPlatformSupport.cmake index 778c7211..fd99b142 100644 --- a/src/libcec/cmake/CheckPlatformSupport.cmake +++ b/src/libcec/cmake/CheckPlatformSupport.cmake @@ -28,7 +28,6 @@ include(FindPkgConfig) # defaults SET(HAVE_RANDR OFF CACHE BOOL "xrandr not supported") -SET(HAVE_LIBUDEV OFF CACHE BOOL "udev not supported") SET(HAVE_RPI_API OFF CACHE BOOL "raspberry pi not supported") SET(HAVE_TDA995X_API OFF CACHE BOOL "tda995x not supported") SET(HAVE_EXYNOS_API OFF CACHE BOOL "exynos not supported") @@ -36,7 +35,6 @@ SET(HAVE_LINUX_API OFF CACHE BOOL "linux not supported") SET(HAVE_AOCEC_API OFF CACHE BOOL "aocec not supported") # Pulse-Eight devices are always supported set(HAVE_P8_USB ON CACHE BOOL "p8 usb-cec supported" FORCE) -set(HAVE_P8_USB_DETECT OFF CACHE BOOL "p8 usb-cec detection not supported") # Raspberry Pi libs and headers are in a non-standard path on some distributions set(RPI_INCLUDE_DIR "" CACHE FILEPATH "root path to Raspberry Pi includes") set(RPI_LIB_DIR "" CACHE FILEPATH "root path to Raspberry Pi libs") @@ -63,8 +61,8 @@ if(WIN32) message(FATAL_ERROR "Unknown architecture id: ${MSVC_C_ARCHITECTURE_ID}") endif() - set(HAVE_P8_USB_DETECT ON CACHE BOOL "p8 usb-cec detection supported" FORCE) - set(LIB_INFO "${LIB_INFO}, features: P8_USB, P8_detect") + set(HAVE_P8_USB_DETECT ON CACHE INTERNAL "p8 usb-cec detection supported") + set(LIB_INFO "${LIB_INFO}, features: P8_USB") list(APPEND CEC_SOURCES_PLATFORM platform/windows/os-edid.cpp platform/windows/serialport.cpp) @@ -88,22 +86,20 @@ else() check_function_exists(flock HAVE_FLOCK) # udev - pkg_check_modules(UDEV udev) - if (UDEV_FOUND) - set(PLATFORM_LIBREQUIRES "${PLATFORM_LIBREQUIRES} ${UDEV_LIBRARIES}") - else() - # fall back to finding libudev.pc - pkg_check_modules(UDEV libudev) + if(NOT DEFINED HAVE_LIBUDEV OR HAVE_LIBUDEV) + pkg_check_modules(UDEV udev) if (UDEV_FOUND) - set(PLATFORM_LIBREQUIRES "${PLATFORM_LIBREQUIRES} libudev") + set(PLATFORM_LIBREQUIRES "${PLATFORM_LIBREQUIRES} ${UDEV_LIBRARIES}") + list(APPEND CMAKE_REQUIRED_LIBRARIES "${UDEV_LIBRARIES}") + else() + # fall back to finding libudev.pc + pkg_check_modules(UDEV libudev) + if (UDEV_FOUND) + set(PLATFORM_LIBREQUIRES "${PLATFORM_LIBREQUIRES} libudev") + list(APPEND CMAKE_REQUIRED_LIBRARIES "libudev") + endif() endif() endif() - if (UDEV_FOUND) - SET(HAVE_LIBUDEV ON CACHE BOOL "udev supported" FORCE) - set(LIB_INFO "${LIB_INFO}, P8_detect") - list(APPEND CMAKE_REQUIRED_LIBRARIES "${UDEV_LIBRARIES}") - set(HAVE_P8_USB_DETECT ON CACHE BOOL "p8 usb-cec detection supported" FORCE) - endif() # xrandr check_include_files("X11/Xlib.h;X11/Xatom.h;X11/extensions/Xrandr.h" HAVE_RANDR_HEADERS) @@ -199,6 +195,25 @@ else() set(HAVE_DRM_EDID_PARSER OFF CACHE BOOL "DRM EDID parser supported") endif() +if (UDEV_FOUND) + SET(HAVE_LIBUDEV ON CACHE BOOL "udev supported") + set(HAVE_P8_USB_DETECT ON CACHE INTERNAL "p8 USB-CEC detection supported") +elseif (HAVE_LIBUDEV) + message(FATAL_ERROR "udev library not found") +else() + SET(HAVE_LIBUDEV OFF CACHE BOOL "udev supported") +endif() + +if (CMAKE_SYSTEM_NAME STREQUAL "Linux") + set(HAVE_P8_USB_DETECT ON CACHE INTERNAL "p8 USB-CEC detection supported") +elseif (NOT DEFINED HAVE_P8_USB_DETECT) + set(HAVE_P8_USB_DETECT OFF CACHE INTERNAL "p8 USB-CEC detection supported") +endif() + +if (HAVE_P8_USB_DETECT) + set(LIB_INFO "${LIB_INFO}, P8_detect") +endif() + SET(SKIP_PYTHON_WRAPPER 0 CACHE STRING "Define to 1 to not generate the Python wrapper") if (${SKIP_PYTHON_WRAPPER}) From 89ce0a7b77b729c945802282f6f71b7a1b71363b Mon Sep 17 00:00:00 2001 From: Evgeny Grin Date: Mon, 10 Aug 2020 11:59:44 +0300 Subject: [PATCH 03/13] CheckPlatformSupport.cmake: don't override defined HAVE_RANDR --- src/libcec/cmake/CheckPlatformSupport.cmake | 22 ++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/src/libcec/cmake/CheckPlatformSupport.cmake b/src/libcec/cmake/CheckPlatformSupport.cmake index fd99b142..667a5803 100644 --- a/src/libcec/cmake/CheckPlatformSupport.cmake +++ b/src/libcec/cmake/CheckPlatformSupport.cmake @@ -27,7 +27,6 @@ include(CheckSymbolExists) include(FindPkgConfig) # defaults -SET(HAVE_RANDR OFF CACHE BOOL "xrandr not supported") SET(HAVE_RPI_API OFF CACHE BOOL "raspberry pi not supported") SET(HAVE_TDA995X_API OFF CACHE BOOL "tda995x not supported") SET(HAVE_EXYNOS_API OFF CACHE BOOL "exynos not supported") @@ -102,12 +101,12 @@ else() endif() # xrandr - check_include_files("X11/Xlib.h;X11/Xatom.h;X11/extensions/Xrandr.h" HAVE_RANDR_HEADERS) - check_library_exists(Xrandr XRRGetScreenResources "" HAVE_RANDR_LIB) - if (HAVE_RANDR_HEADERS AND HAVE_RANDR_LIB) - set(LIB_INFO "${LIB_INFO}, randr") - list(APPEND CEC_SOURCES_PLATFORM platform/X11/randr-edid.cpp) - SET(HAVE_RANDR ON CACHE BOOL "xrandr supported" FORCE) + if(NOT DEFINED HAVE_RANDR OR HAVE_RANDR) + check_include_files("X11/Xlib.h;X11/Xatom.h;X11/extensions/Xrandr.h" HAVE_RANDR_HEADERS) + check_library_exists(Xrandr XRRGetScreenResources "" HAVE_RANDR_LIB) + if (HAVE_RANDR_HEADERS AND HAVE_RANDR_LIB) + list(APPEND CEC_SOURCES_PLATFORM platform/X11/randr-edid.cpp) + endif() endif() # raspberry pi @@ -214,6 +213,15 @@ if (HAVE_P8_USB_DETECT) set(LIB_INFO "${LIB_INFO}, P8_detect") endif() +if (HAVE_RANDR_HEADERS AND HAVE_RANDR_LIB) + SET(HAVE_RANDR ON CACHE BOOL "xrandr supported") + set(LIB_INFO "${LIB_INFO}, randr") +elseif (HAVE_RANDR) + message(FATAL_ERROR "randr headers or library not found") +else() + SET(HAVE_RANDR OFF CACHE BOOL "xrandr supported") +endif() + SET(SKIP_PYTHON_WRAPPER 0 CACHE STRING "Define to 1 to not generate the Python wrapper") if (${SKIP_PYTHON_WRAPPER}) From 43794d1649eec76fda7db933c14a76ec7ee51456 Mon Sep 17 00:00:00 2001 From: Evgeny Grin Date: Mon, 10 Aug 2020 12:26:23 +0300 Subject: [PATCH 04/13] CheckPlatformSupport.cmake: don't override cache var HAVE_RPI_API --- src/libcec/cmake/CheckPlatformSupport.cmake | 39 +++++++++++++-------- 1 file changed, 24 insertions(+), 15 deletions(-) diff --git a/src/libcec/cmake/CheckPlatformSupport.cmake b/src/libcec/cmake/CheckPlatformSupport.cmake index 667a5803..f4320c1b 100644 --- a/src/libcec/cmake/CheckPlatformSupport.cmake +++ b/src/libcec/cmake/CheckPlatformSupport.cmake @@ -27,7 +27,6 @@ include(CheckSymbolExists) include(FindPkgConfig) # defaults -SET(HAVE_RPI_API OFF CACHE BOOL "raspberry pi not supported") SET(HAVE_TDA995X_API OFF CACHE BOOL "tda995x not supported") SET(HAVE_EXYNOS_API OFF CACHE BOOL "exynos not supported") SET(HAVE_LINUX_API OFF CACHE BOOL "linux not supported") @@ -110,20 +109,21 @@ else() endif() # raspberry pi - find_library(RPI_BCM_HOST bcm_host "${RPI_LIB_DIR}") - check_library_exists(bcm_host bcm_host_init "${RPI_LIB_DIR}" HAVE_RPI_LIB) - if (HAVE_RPI_LIB) - SET(HAVE_RPI_API ON CACHE BOOL "raspberry pi supported" FORCE) - find_library(RPI_VCOS vcos "${RPI_LIB_DIR}") - find_library(RPI_VCHIQ_ARM vchiq_arm "${RPI_LIB_DIR}") - include_directories(${RPI_INCLUDE_DIR} ${RPI_INCLUDE_DIR}/interface/vcos/pthreads ${RPI_INCLUDE_DIR}/interface/vmcs_host/linux) - - set(LIB_INFO "${LIB_INFO}, RPi") - set(CEC_SOURCES_ADAPTER_RPI adapter/RPi/RPiCECAdapterDetection.cpp - adapter/RPi/RPiCECAdapterCommunication.cpp - adapter/RPi/RPiCECAdapterMessageQueue.cpp) - source_group("Source Files\\adapter\\RPi" FILES ${CEC_SOURCES_ADAPTER_RPI}) - list(APPEND CEC_SOURCES ${CEC_SOURCES_ADAPTER_RPI}) + if(NOT DEFINED HAVE_RPI_API OR HAVE_RPI_API) + find_library(RPI_BCM_HOST bcm_host "${RPI_LIB_DIR}") + check_library_exists(bcm_host bcm_host_init "${RPI_LIB_DIR}" HAVE_RPI_LIB) + if (HAVE_RPI_LIB) + SET(HAVE_RPI_API ON CACHE BOOL "raspberry pi supported" FORCE) + find_library(RPI_VCOS vcos "${RPI_LIB_DIR}") + find_library(RPI_VCHIQ_ARM vchiq_arm "${RPI_LIB_DIR}") + include_directories(${RPI_INCLUDE_DIR} ${RPI_INCLUDE_DIR}/interface/vcos/pthreads ${RPI_INCLUDE_DIR}/interface/vmcs_host/linux) + + set(CEC_SOURCES_ADAPTER_RPI adapter/RPi/RPiCECAdapterDetection.cpp + adapter/RPi/RPiCECAdapterCommunication.cpp + adapter/RPi/RPiCECAdapterMessageQueue.cpp) + source_group("Source Files\\adapter\\RPi" FILES ${CEC_SOURCES_ADAPTER_RPI}) + list(APPEND CEC_SOURCES ${CEC_SOURCES_ADAPTER_RPI}) + endif() endif() # TDA995x @@ -222,6 +222,15 @@ else() SET(HAVE_RANDR OFF CACHE BOOL "xrandr supported") endif() +if (HAVE_RPI_LIB) + SET(HAVE_RPI_API ON CACHE BOOL "Raspberry Pi supported") + set(LIB_INFO "${LIB_INFO}, RPi") +elseif (HAVE_RPI_API) + message(FATAL_ERROR "Raspberry PI library not found") +else() + SET(HAVE_RPI_API OFF CACHE BOOL "Raspberry Pi supported") +endif() + SET(SKIP_PYTHON_WRAPPER 0 CACHE STRING "Define to 1 to not generate the Python wrapper") if (${SKIP_PYTHON_WRAPPER}) From a82ee2a990f0fe275507fb571ed6a4c35b862447 Mon Sep 17 00:00:00 2001 From: Evgeny Grin Date: Mon, 10 Aug 2020 12:34:40 +0300 Subject: [PATCH 05/13] CheckPlatformSupport.cmake: don't override cache var HAVE_TDA995X_API --- src/libcec/cmake/CheckPlatformSupport.cmake | 26 ++++++++++++++------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/src/libcec/cmake/CheckPlatformSupport.cmake b/src/libcec/cmake/CheckPlatformSupport.cmake index f4320c1b..529139ff 100644 --- a/src/libcec/cmake/CheckPlatformSupport.cmake +++ b/src/libcec/cmake/CheckPlatformSupport.cmake @@ -27,7 +27,6 @@ include(CheckSymbolExists) include(FindPkgConfig) # defaults -SET(HAVE_TDA995X_API OFF CACHE BOOL "tda995x not supported") SET(HAVE_EXYNOS_API OFF CACHE BOOL "exynos not supported") SET(HAVE_LINUX_API OFF CACHE BOOL "linux not supported") SET(HAVE_AOCEC_API OFF CACHE BOOL "aocec not supported") @@ -127,14 +126,14 @@ else() endif() # TDA995x - check_include_files("tda998x_ioctl.h;comps/tmdlHdmiCEC/inc/tmdlHdmiCEC_Types.h" HAVE_TDA995X_API_INC) - if (HAVE_TDA995X_API_INC) - SET(HAVE_TDA995X_API ON CACHE BOOL "tda995x supported" FORCE) - set(LIB_INFO "${LIB_INFO}, TDA995x") - set(CEC_SOURCES_ADAPTER_TDA995x adapter/TDA995x/TDA995xCECAdapterDetection.cpp - adapter/TDA995x/TDA995xCECAdapterCommunication.cpp) - source_group("Source Files\\adapter\\TDA995x" FILES ${CEC_SOURCES_ADAPTER_TDA995x}) - list(APPEND CEC_SOURCES ${CEC_SOURCES_ADAPTER_TDA995x}) + if(NOT DEFINED HAVE_TDA995X_API OR HAVE_TDA995X_API) + check_include_files("tda998x_ioctl.h;comps/tmdlHdmiCEC/inc/tmdlHdmiCEC_Types.h" HAVE_TDA995X_API_INC) + if (HAVE_TDA995X_API_INC) + set(CEC_SOURCES_ADAPTER_TDA995x adapter/TDA995x/TDA995xCECAdapterDetection.cpp + adapter/TDA995x/TDA995xCECAdapterCommunication.cpp) + source_group("Source Files\\adapter\\TDA995x" FILES ${CEC_SOURCES_ADAPTER_TDA995x}) + list(APPEND CEC_SOURCES ${CEC_SOURCES_ADAPTER_TDA995x}) + endif() endif() # Exynos @@ -231,6 +230,15 @@ else() SET(HAVE_RPI_API OFF CACHE BOOL "Raspberry Pi supported") endif() +if (HAVE_TDA995X_API_INC) + SET(HAVE_TDA995X_API ON CACHE BOOL "TDA995x supported") + set(LIB_INFO "${LIB_INFO}, TDA995x") +elseif (HAVE_TDA995X_API) + message(FATAL_ERROR "tda995x headers not found") +else() + SET(HAVE_TDA995X_API OFF CACHE BOOL "TDA995x supported") +endif() + SET(SKIP_PYTHON_WRAPPER 0 CACHE STRING "Define to 1 to not generate the Python wrapper") if (${SKIP_PYTHON_WRAPPER}) From 569a4a37c932affd96d0767a958922ccc6d5959b Mon Sep 17 00:00:00 2001 From: Evgeny Grin Date: Mon, 10 Aug 2020 12:43:50 +0300 Subject: [PATCH 06/13] CheckPlatformSupport.cmake: fixed HAVE_EXYNOS_API usage Avoid resolving variable otherwise variable content could be treated as name of another variable --- src/libcec/cmake/CheckPlatformSupport.cmake | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/libcec/cmake/CheckPlatformSupport.cmake b/src/libcec/cmake/CheckPlatformSupport.cmake index 529139ff..51da9e7c 100644 --- a/src/libcec/cmake/CheckPlatformSupport.cmake +++ b/src/libcec/cmake/CheckPlatformSupport.cmake @@ -27,7 +27,6 @@ include(CheckSymbolExists) include(FindPkgConfig) # defaults -SET(HAVE_EXYNOS_API OFF CACHE BOOL "exynos not supported") SET(HAVE_LINUX_API OFF CACHE BOOL "linux not supported") SET(HAVE_AOCEC_API OFF CACHE BOOL "aocec not supported") # Pulse-Eight devices are always supported @@ -137,9 +136,7 @@ else() endif() # Exynos - if (${HAVE_EXYNOS_API}) - set(LIB_INFO "${LIB_INFO}, Exynos") - SET(HAVE_EXYNOS_API ON CACHE BOOL "exynos supported" FORCE) + if (HAVE_EXYNOS_API) set(CEC_SOURCES_ADAPTER_EXYNOS adapter/Exynos/ExynosCECAdapterDetection.cpp adapter/Exynos/ExynosCECAdapterCommunication.cpp) source_group("Source Files\\adapter\\Exynos" FILES ${CEC_SOURCES_ADAPTER_EXYNOS}) @@ -239,6 +236,12 @@ else() SET(HAVE_TDA995X_API OFF CACHE BOOL "TDA995x supported") endif() +if (HAVE_EXYNOS_API) + set(LIB_INFO "${LIB_INFO}, Exynos") +else() + SET(HAVE_EXYNOS_API OFF CACHE BOOL "Exynos supported") +endif() + SET(SKIP_PYTHON_WRAPPER 0 CACHE STRING "Define to 1 to not generate the Python wrapper") if (${SKIP_PYTHON_WRAPPER}) From cc6fa2ba726b5637e5df548139d7f5348d5d3ef5 Mon Sep 17 00:00:00 2001 From: Evgeny Grin Date: Mon, 10 Aug 2020 12:52:26 +0300 Subject: [PATCH 07/13] CheckPlatformSupport.cmake: fixed HAVE_LINUX_API usage, fixed misleading description "Linux supported: no" description could mislead users --- src/libcec/cmake/CheckPlatformSupport.cmake | 13 ++++++++----- src/libcec/cmake/DisplayPlatformSupport.cmake | 4 ++-- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/libcec/cmake/CheckPlatformSupport.cmake b/src/libcec/cmake/CheckPlatformSupport.cmake index 51da9e7c..16951cc7 100644 --- a/src/libcec/cmake/CheckPlatformSupport.cmake +++ b/src/libcec/cmake/CheckPlatformSupport.cmake @@ -9,7 +9,7 @@ # HAVE_RPI_API ON if Raspberry Pi is supported # HAVE_TDA995X_API ON if TDA995X is supported # HAVE_EXYNOS_API ON if Exynos is supported -# HAVE_LINUX_API ON if Linux is supported +# HAVE_LINUX_API ON if Linux kernel CEC framework is supported # HAVE_AOCEC_API ON if AOCEC is supported # HAVE_IMX_API ON if iMX.6 is supported # HAVE_P8_USB ON if Pulse-Eight devices are supported @@ -27,7 +27,6 @@ include(CheckSymbolExists) include(FindPkgConfig) # defaults -SET(HAVE_LINUX_API OFF CACHE BOOL "linux not supported") SET(HAVE_AOCEC_API OFF CACHE BOOL "aocec not supported") # Pulse-Eight devices are always supported set(HAVE_P8_USB ON CACHE BOOL "p8 usb-cec supported" FORCE) @@ -144,9 +143,7 @@ else() endif() # Linux - if (${HAVE_LINUX_API}) - set(LIB_INFO "${LIB_INFO}, Linux") - SET(HAVE_LINUX_API ON CACHE BOOL "linux supported" FORCE) + if (HAVE_LINUX_API) set(CEC_SOURCES_ADAPTER_LINUX adapter/Linux/LinuxCECAdapterDetection.cpp adapter/Linux/LinuxCECAdapterCommunication.cpp) source_group("Source Files\\adapter\\Linux" FILES ${CEC_SOURCES_ADAPTER_LINUX}) @@ -242,6 +239,12 @@ else() SET(HAVE_EXYNOS_API OFF CACHE BOOL "Exynos supported") endif() +if (HAVE_LINUX_API) + set(LIB_INFO "${LIB_INFO}, Linux_kernel_API") +else() + SET(HAVE_LINUX_API OFF CACHE BOOL "Linux kernel CEC framework supported") +endif() + SET(SKIP_PYTHON_WRAPPER 0 CACHE STRING "Define to 1 to not generate the Python wrapper") if (${SKIP_PYTHON_WRAPPER}) diff --git a/src/libcec/cmake/DisplayPlatformSupport.cmake b/src/libcec/cmake/DisplayPlatformSupport.cmake index 8b2a558f..f97a11ea 100644 --- a/src/libcec/cmake/DisplayPlatformSupport.cmake +++ b/src/libcec/cmake/DisplayPlatformSupport.cmake @@ -45,9 +45,9 @@ else() endif() if (HAVE_LINUX_API) - message(STATUS "Linux support: yes") + message(STATUS "Linux kernel CEC framework support: yes") else() - message(STATUS "Linux support: no") + message(STATUS "Linux kernel CEC framework support: no") endif() if (HAVE_AOCEC_API) From 238e4859079d67d0910c10a22fbdc72769603533 Mon Sep 17 00:00:00 2001 From: Evgeny Grin Date: Mon, 10 Aug 2020 12:58:41 +0300 Subject: [PATCH 08/13] CheckPlatformSupport.cmake: fixed usage of HAVE_AOCEC_API var --- src/libcec/cmake/CheckPlatformSupport.cmake | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/libcec/cmake/CheckPlatformSupport.cmake b/src/libcec/cmake/CheckPlatformSupport.cmake index 16951cc7..d7daa69e 100644 --- a/src/libcec/cmake/CheckPlatformSupport.cmake +++ b/src/libcec/cmake/CheckPlatformSupport.cmake @@ -27,7 +27,6 @@ include(CheckSymbolExists) include(FindPkgConfig) # defaults -SET(HAVE_AOCEC_API OFF CACHE BOOL "aocec not supported") # Pulse-Eight devices are always supported set(HAVE_P8_USB ON CACHE BOOL "p8 usb-cec supported" FORCE) # Raspberry Pi libs and headers are in a non-standard path on some distributions @@ -151,15 +150,11 @@ else() endif() # AOCEC - if (${HAVE_AOCEC_API}) - set(LIB_INFO "${LIB_INFO}, AOCEC") - SET(HAVE_AOCEC_API ON CACHE BOOL "AOCEC supported" FORCE) + if (HAVE_AOCEC_API) set(CEC_SOURCES_ADAPTER_AOCEC adapter/AOCEC/AOCECAdapterDetection.cpp adapter/AOCEC/AOCECAdapterCommunication.cpp) source_group("Source Files\\adapter\\AOCEC" FILES ${CEC_SOURCES_ADAPTER_AOCEC}) list(APPEND CEC_SOURCES ${CEC_SOURCES_ADAPTER_AOCEC}) - else() - set(HAVE_AOCEC_API 0) endif() # i.MX6 @@ -245,6 +240,12 @@ else() SET(HAVE_LINUX_API OFF CACHE BOOL "Linux kernel CEC framework supported") endif() +if (HAVE_AOCEC_API) + set(LIB_INFO "${LIB_INFO}, AOCEC") +else() + SET(HAVE_AOCEC_API OFF CACHE BOOL "AOCEC supported") +endif() + SET(SKIP_PYTHON_WRAPPER 0 CACHE STRING "Define to 1 to not generate the Python wrapper") if (${SKIP_PYTHON_WRAPPER}) From e127adaba85bec1070a738f48f473025895ecae1 Mon Sep 17 00:00:00 2001 From: Evgeny Grin Date: Mon, 10 Aug 2020 13:07:11 +0300 Subject: [PATCH 09/13] CheckPlatformSupport.cmake: fixed usage of HAVE_IMX_API, marked as CACHE var, added description --- src/libcec/cmake/CheckPlatformSupport.cmake | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/libcec/cmake/CheckPlatformSupport.cmake b/src/libcec/cmake/CheckPlatformSupport.cmake index d7daa69e..3b9023c1 100644 --- a/src/libcec/cmake/CheckPlatformSupport.cmake +++ b/src/libcec/cmake/CheckPlatformSupport.cmake @@ -158,15 +158,11 @@ else() endif() # i.MX6 - if (${HAVE_IMX_API}) - set(LIB_INFO "${LIB_INFO}, 'i.MX6'") - set(HAVE_IMX_API 1) + if (HAVE_IMX_API) set(CEC_SOURCES_ADAPTER_IMX adapter/IMX/IMXCECAdapterCommunication.cpp adapter/IMX/IMXCECAdapterDetection.cpp) source_group("Source Files\\adapter\\IMX" FILES ${CEC_SOURCES_ADAPTER_IMX}) list(APPEND CEC_SOURCES ${CEC_SOURCES_ADAPTER_IMX}) - else() - set(HAVE_IMX_API 0) endif() endif() @@ -246,6 +242,12 @@ else() SET(HAVE_AOCEC_API OFF CACHE BOOL "AOCEC supported") endif() +if (HAVE_IMX_API) + set(LIB_INFO "${LIB_INFO}, 'i.MX6'") +else() + SET(HAVE_IMX_API OFF CACHE BOOL "i.MX6 SoC supported") +endif() + SET(SKIP_PYTHON_WRAPPER 0 CACHE STRING "Define to 1 to not generate the Python wrapper") if (${SKIP_PYTHON_WRAPPER}) From 8f9ba8204d8f26b4a3f275c0fc6b5f76fd3f2169 Mon Sep 17 00:00:00 2001 From: Evgeny Grin Date: Mon, 10 Aug 2020 13:11:06 +0300 Subject: [PATCH 10/13] CheckPlatformSupport.cmake: unified LIB_INFO assignment --- src/libcec/cmake/CheckPlatformSupport.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libcec/cmake/CheckPlatformSupport.cmake b/src/libcec/cmake/CheckPlatformSupport.cmake index 3b9023c1..097a8776 100644 --- a/src/libcec/cmake/CheckPlatformSupport.cmake +++ b/src/libcec/cmake/CheckPlatformSupport.cmake @@ -56,7 +56,6 @@ if(WIN32) endif() set(HAVE_P8_USB_DETECT ON CACHE INTERNAL "p8 usb-cec detection supported") - set(LIB_INFO "${LIB_INFO}, features: P8_USB") list(APPEND CEC_SOURCES_PLATFORM platform/windows/os-edid.cpp platform/windows/serialport.cpp) @@ -68,7 +67,6 @@ else() list(APPEND CEC_SOURCES_PLATFORM platform/posix/os-edid.cpp platform/posix/serialport.cpp) set(LIB_DESTINATION "${CMAKE_INSTALL_LIBDIR}") - set(LIB_INFO "${LIB_INFO}, features: P8_USB") # always try DRM on Linux if other methods fail if(NOT CMAKE_SYSTEM_NAME MATCHES "FreeBSD") @@ -172,6 +170,8 @@ check_library_exists(rt clock_gettime "" HAVE_RT) # check for dlopen check_library_exists(dl dlopen "" HAVE_DLOPEN) +set(LIB_INFO "${LIB_INFO}, features: P8_USB") + if (HAVE_DRM_EDID_PARSER) set(LIB_INFO "${LIB_INFO}, DRM") else() From da5615267023c29489f867e85aa84b07aee82b23 Mon Sep 17 00:00:00 2001 From: Evgeny Grin Date: Mon, 10 Aug 2020 13:14:06 +0300 Subject: [PATCH 11/13] CheckPlatformSupport.cmake: removed duplicated definition of RPI_{LIB,INCLUDE}_DIR --- src/libcec/cmake/CheckPlatformSupport.cmake | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/libcec/cmake/CheckPlatformSupport.cmake b/src/libcec/cmake/CheckPlatformSupport.cmake index 097a8776..e98ed69e 100644 --- a/src/libcec/cmake/CheckPlatformSupport.cmake +++ b/src/libcec/cmake/CheckPlatformSupport.cmake @@ -17,9 +17,6 @@ # HAVE_DRM_EDID_PARSER ON if DRM EDID parsing is supported # -set(RPI_LIB_DIR "" CACHE STRING "Path to Raspberry Pi libraries") -set(RPI_INCLUDE_DIR "" CACHE STRING "Path to Raspberry Pi headers") - set(PLATFORM_LIBREQUIRES "") include(CheckFunctionExists) @@ -30,8 +27,8 @@ include(FindPkgConfig) # Pulse-Eight devices are always supported set(HAVE_P8_USB ON CACHE BOOL "p8 usb-cec supported" FORCE) # Raspberry Pi libs and headers are in a non-standard path on some distributions -set(RPI_INCLUDE_DIR "" CACHE FILEPATH "root path to Raspberry Pi includes") -set(RPI_LIB_DIR "" CACHE FILEPATH "root path to Raspberry Pi libs") +set(RPI_INCLUDE_DIR "" CACHE FILEPATH "path to Raspberry Pi includes") +set(RPI_LIB_DIR "" CACHE FILEPATH "path to Raspberry Pi libs") if(WIN32) # Windows From cd1f8d8fa6379ee1457812fe665e3024f2bd3059 Mon Sep 17 00:00:00 2001 From: Evgeny Grin Date: Mon, 10 Aug 2020 13:37:07 +0300 Subject: [PATCH 12/13] cmake files: improved and unified descriptions and reporting --- src/libcec/cmake/CheckPlatformSupport.cmake | 6 +++--- src/libcec/cmake/DisplayPlatformSupport.cmake | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/libcec/cmake/CheckPlatformSupport.cmake b/src/libcec/cmake/CheckPlatformSupport.cmake index e98ed69e..0d4dcd14 100644 --- a/src/libcec/cmake/CheckPlatformSupport.cmake +++ b/src/libcec/cmake/CheckPlatformSupport.cmake @@ -207,13 +207,13 @@ if (HAVE_RPI_LIB) SET(HAVE_RPI_API ON CACHE BOOL "Raspberry Pi supported") set(LIB_INFO "${LIB_INFO}, RPi") elseif (HAVE_RPI_API) - message(FATAL_ERROR "Raspberry PI library not found") + message(FATAL_ERROR "Raspberry Pi library not found") else() SET(HAVE_RPI_API OFF CACHE BOOL "Raspberry Pi supported") endif() if (HAVE_TDA995X_API_INC) - SET(HAVE_TDA995X_API ON CACHE BOOL "TDA995x supported") + SET(HAVE_TDA995X_API ON CACHE BOOL "NXP TDA995x supported") set(LIB_INFO "${LIB_INFO}, TDA995x") elseif (HAVE_TDA995X_API) message(FATAL_ERROR "tda995x headers not found") @@ -236,7 +236,7 @@ endif() if (HAVE_AOCEC_API) set(LIB_INFO "${LIB_INFO}, AOCEC") else() - SET(HAVE_AOCEC_API OFF CACHE BOOL "AOCEC supported") + SET(HAVE_AOCEC_API OFF CACHE BOOL "AOCEC (Odroid C2/Amlogic S905) SoC supported") endif() if (HAVE_IMX_API) diff --git a/src/libcec/cmake/DisplayPlatformSupport.cmake b/src/libcec/cmake/DisplayPlatformSupport.cmake index f97a11ea..69f1ec14 100644 --- a/src/libcec/cmake/DisplayPlatformSupport.cmake +++ b/src/libcec/cmake/DisplayPlatformSupport.cmake @@ -27,9 +27,9 @@ else() endif() if (HAVE_TDA995X_API) - message(STATUS "TDA995x support: yes") + message(STATUS "NXP TDA995x support: yes") else() - message(STATUS "TDA995x support: no") + message(STATUS "NXP TDA995x support: no") endif() if (HAVE_EXYNOS_API) @@ -51,15 +51,15 @@ else() endif() if (HAVE_AOCEC_API) - message(STATUS "AOCEC support: yes") + message(STATUS "AOCEC (Odroid C2) SoC support: yes") else() - message(STATUS "AOCEC support: no") + message(STATUS "AOCEC (Odroid C2) SoC support: no") endif() if (HAVE_IMX_API) - message(STATUS "i.MX6 support: yes") + message(STATUS "i.MX6 SoC support: yes") else() - message(STATUS "i.MX6 support: no") + message(STATUS "i.MX6 SoC support: no") endif() if (HAVE_PYTHON) From 7582e6554b52b857c25e08dd19e5e5443f3aabab Mon Sep 17 00:00:00 2001 From: Evgeny Grin Date: Mon, 10 Aug 2020 14:48:25 +0300 Subject: [PATCH 13/13] CheckPlatformSupport.cmake: corrected comments to properly document real behaviour --- src/libcec/cmake/CheckPlatformSupport.cmake | 24 +++++++++++++-------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/src/libcec/cmake/CheckPlatformSupport.cmake b/src/libcec/cmake/CheckPlatformSupport.cmake index 0d4dcd14..00ba55e3 100644 --- a/src/libcec/cmake/CheckPlatformSupport.cmake +++ b/src/libcec/cmake/CheckPlatformSupport.cmake @@ -4,17 +4,23 @@ # PLATFORM_LIBREQUIRES dependencies # LIB_INFO supported features and compilation information # LIB_DESTINATION destination for the .so/.dll files -# HAVE_RANDR ON if xrandr is supported -# HAVE_LIBUDEV ON if udev is supported -# HAVE_RPI_API ON if Raspberry Pi is supported -# HAVE_TDA995X_API ON if TDA995X is supported -# HAVE_EXYNOS_API ON if Exynos is supported -# HAVE_LINUX_API ON if Linux kernel CEC framework is supported -# HAVE_AOCEC_API ON if AOCEC is supported -# HAVE_IMX_API ON if iMX.6 is supported # HAVE_P8_USB ON if Pulse-Eight devices are supported # HAVE_P8_USB_DETECT ON if Pulse-Eight devices can be auto-detected -# HAVE_DRM_EDID_PARSER ON if DRM EDID parsing is supported +# +# The following variables are set automatically, if not defined by user +# HAVE_DRM_EDID_PARSER ON if DRM EDID parsing is supported, otherwise OFF +# HAVE_LIBUDEV ON if udev is supported, otherwise OFF +# HAVE_RANDR ON if xrandr is supported, otherwise OFF +# HAVE_RPI_API ON if Raspberry Pi is supported, otherwise OFF +# +# The following variables must be defined to enable suppport for various features +# HAVE_TDA995X_API ON to enable NXP TDA995x support +# HAVE_EXYNOS_API ON to enable Exynos SoC support +# HAVE_LINUX_API ON to enable Linux kernel CEC framework support +# HAVE_AOCEC_API ON to enable AOCEC (Odroid C2/Amlogic S905) SoC support +# HAVE_IMX_API ON to enable iMX.6 SoC support +# RPI_INCLUDE_DIR PATH to Raspberry Pi includes +# RPI_LIB_DIR PATH to Raspberry Pi libs # set(PLATFORM_LIBREQUIRES "")