CMake Build: Fix libdrm detection and compilation on QNX

On QNX 7.1 x86drm.h is located under <...>/usr/include/libdrm, unlike
linux where it's present under /usr/include.

find_path would not find it on QNX, and instead get /usr/include from
host, which resulted in a failure to compile.

Task-number: QTBUG-83202
Change-Id: I03d6c2d4dfbe91bb70df0a322e84890bd7c8548a
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This commit is contained in:
Cristian Adam 2020-08-18 19:07:47 +02:00
parent 41800c3c31
commit 12e4b63d28
3 changed files with 23 additions and 7 deletions

View File

@ -78,6 +78,8 @@ if(NOT WIN32)
xf86drm.h xf86drm.h
HINTS HINTS
${PKG_Libdrm_INCLUDE_DIRS} ${PKG_Libdrm_INCLUDE_DIRS}
PATH_SUFFIXES
libdrm
) )
find_library(Libdrm_LIBRARY find_library(Libdrm_LIBRARY
NAMES NAMES
@ -103,14 +105,14 @@ if(NOT WIN32)
IMPORTED_LOCATION "${Libdrm_LIBRARY}" IMPORTED_LOCATION "${Libdrm_LIBRARY}"
INTERFACE_COMPILE_OPTIONS "${Libdrm_DEFINITIONS}" INTERFACE_COMPILE_OPTIONS "${Libdrm_DEFINITIONS}"
INTERFACE_INCLUDE_DIRECTORIES "${Libdrm_INCLUDE_DIR}" INTERFACE_INCLUDE_DIRECTORIES "${Libdrm_INCLUDE_DIR}"
INTERFACE_INCLUDE_DIRECTORIES "${Libdrm_INCLUDE_DIR}/libdrm"
) )
if(EXISTS "${Libdrm_INCLUDE_DIR}/drm") foreach(suffix libdrm drm)
if(EXISTS "${Libdrm_INCLUDE_DIR}/${suffix}")
set_property(TARGET Libdrm::Libdrm APPEND PROPERTY set_property(TARGET Libdrm::Libdrm APPEND PROPERTY
INTERFACE_INCLUDE_DIRECTORIES "${Libdrm_INCLUDE_DIR}/drm" INTERFACE_INCLUDE_DIRECTORIES "${Libdrm_INCLUDE_DIR}/${suffix}"
) )
endif() endif()
endforeach()
endif() endif()
mark_as_advanced(Libdrm_LIBRARY Libdrm_INCLUDE_DIR) mark_as_advanced(Libdrm_LIBRARY Libdrm_INCLUDE_DIR)

View File

@ -30,3 +30,10 @@ qt_internal_add_plugin(QEglFSKmsEglDeviceIntegrationPlugin
#### Keys ignored in scope 1:.:.:eglfs_kms_egldevice.pro:<TRUE>: #### Keys ignored in scope 1:.:.:eglfs_kms_egldevice.pro:<TRUE>:
# OTHER_FILES = "$$PWD/eglfs_kms_egldevice.json" # OTHER_FILES = "$$PWD/eglfs_kms_egldevice.json"
# begin special case
qt_extend_target(QEglFSKmsEglDeviceIntegrationPlugin
CONDITION QNX
COMPILE_OPTIONS -fpermissive
)
# end special case

View File

@ -26,3 +26,10 @@ qt_add_module(EglFsKmsSupport
Qt::GuiPrivate Qt::GuiPrivate
Qt::KmsSupportPrivate Qt::KmsSupportPrivate
) )
# begin special case
qt_extend_target(EglFsKmsSupport
CONDITION QNX
COMPILE_OPTIONS -fpermissive
)
# end special case