diff --git a/cmake/3rdparty/extra-cmake-modules/find-modules/FindEGL.cmake b/cmake/3rdparty/extra-cmake-modules/find-modules/FindEGL.cmake index a3573bacd4..0733f1f702 100644 --- a/cmake/3rdparty/extra-cmake-modules/find-modules/FindEGL.cmake +++ b/cmake/3rdparty/extra-cmake-modules/find-modules/FindEGL.cmake @@ -120,6 +120,10 @@ list(APPEND CMAKE_REQUIRED_LIBRARIES "${EGL_LIBRARY}") list(APPEND CMAKE_REQUIRED_INCLUDES "${EGL_INCLUDE_DIR}") list(APPEND CMAKE_REQUIRED_DEFINITIONS "${EGL_DEFINITIONS}") +if(_qt_igy_gui_libs) + list(APPEND CMAKE_REQUIRED_LIBRARIES "${_qt_igy_gui_libs}") +endif() + check_cxx_source_compiles(" #include diff --git a/cmake/FindGLESv2.cmake b/cmake/FindGLESv2.cmake index 25b9044bb2..6d7147f563 100644 --- a/cmake/FindGLESv2.cmake +++ b/cmake/FindGLESv2.cmake @@ -15,6 +15,9 @@ else() if(EGL_LIBRARY) list(APPEND CMAKE_REQUIRED_LIBRARIES "${EGL_LIBRARY}") endif() + if(_qt_igy_gui_libs) + list(APPEND CMAKE_REQUIRED_LIBRARIES "${_qt_igy_gui_libs}") + endif() set(_includes "${CMAKE_REQUIRED_INCLUDES}") list(APPEND CMAKE_REQUIRED_INCLUDES "${GLESv2_INCLUDE_DIR}") diff --git a/cmake/platforms/FindIntegrityPlatformGraphics.cmake b/cmake/platforms/FindIntegrityPlatformGraphics.cmake new file mode 100644 index 0000000000..cfcd260740 --- /dev/null +++ b/cmake/platforms/FindIntegrityPlatformGraphics.cmake @@ -0,0 +1,26 @@ +#.rst: +# IntegrityPlatformGraphics +# --------- +find_package_handle_standard_args(IntegrityPlatformGraphics + FOUND_VAR + IntegrityPlatformGraphics_FOUND + REQUIRED_VARS + IntegrityPlatformGraphics_LIBRARY + IntegrityPlatformGraphics_INCLUDE_DIR +) + +if(IntegrityPlatformGraphics_FOUND + AND NOT TARGET IntegrityPlatformGraphics::IntegrityPlatformGraphics) + add_library(IntegrityPlatformGraphics::IntegrityPlatformGraphics STATIC IMPORTED) + set_target_properties(IntegrityPlatformGraphics::IntegrityPlatformGraphics PROPERTIES + IMPORTED_LOCATION "${IntegrityPlatformGraphics_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES "${IntegrityPlatformGraphics_INCLUDE_DIR}" + ) + target_link_libraries(IntegrityPlatformGraphics::IntegrityPlatformGraphics + INTERFACE ${IntegrityPlatformGraphics_LIBRARIES_PACK}) +endif() + +mark_as_advanced(IntegrityPlatformGraphics_LIBRARY) + +# compatibility variables +set(IntegrityPlatformGraphics_LIBRARIES ${IntegrityPlatformGraphics_LIBRARY}) diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt index c0adb60c01..e9a07f124e 100644 --- a/src/gui/CMakeLists.txt +++ b/src/gui/CMakeLists.txt @@ -330,6 +330,13 @@ if(QT_FEATURE_opengl) if(QT_FEATURE_opengles2) find_package(GLESv2) target_link_libraries(Gui PUBLIC GLESv2::GLESv2) + + if(INTEGRITY AND _qt_igy_gui_libs) + find_package(IntegrityPlatformGraphics) + target_link_libraries(Gui + INTERFACE $) + endif() + elseif(NOT QT_FEATURE_opengl_dynamic) target_link_libraries(Gui PUBLIC WrapOpenGL::WrapOpenGL) endif() diff --git a/src/gui/configure.cmake b/src/gui/configure.cmake index af6d63be8c..8f6d227a30 100644 --- a/src/gui/configure.cmake +++ b/src/gui/configure.cmake @@ -30,6 +30,11 @@ qt_find_package(ATSPI2 PROVIDED_TARGETS PkgConfig::ATSPI2 MODULE_NAME gui QMAKE_ qt_find_package(DirectFB PROVIDED_TARGETS PkgConfig::DirectFB MODULE_NAME gui QMAKE_LIB directfb) qt_find_package(Libdrm PROVIDED_TARGETS Libdrm::Libdrm MODULE_NAME gui QMAKE_LIB drm) qt_find_package(EGL PROVIDED_TARGETS EGL::EGL MODULE_NAME gui QMAKE_LIB egl) +if(INTEGRITY AND _qt_igy_gui_libs) + qt_find_package(IntegrityPlatformGraphics + PROVIDED_TARGETS IntegrityPlatformGraphics::IntegrityPlatformGraphics + MODULE_NAME gui QMAKE_LIB integrity_platform_graphics) +endif() qt_find_package(WrapSystemFreetype 2.2.0 PROVIDED_TARGETS WrapSystemFreetype::WrapSystemFreetype MODULE_NAME gui QMAKE_LIB freetype) set_package_properties(WrapFreetype PROPERTIES TYPE REQUIRED) if(QT_FEATURE_system_zlib) @@ -289,11 +294,16 @@ fbGetDisplayByIndex(0); "# FIXME: qmake: ['DEFINES += EGL_API_FB=1', '!integrity: DEFINES += LINUX=1'] ) +set(test_libs EGL::EGL) +if(INTEGRITY AND _qt_igy_gui_libs) + set(test_libs ${test_libs} IntegrityPlatformGraphics::IntegrityPlatformGraphics) +endif() + # egl-openwfd qt_config_compile_test(egl_openwfd LABEL "OpenWFD EGL" LIBRARIES - EGL::EGL + ${test_libs} CODE "#include @@ -397,10 +407,15 @@ if(WASM) endif() # special case end +set(test_libs GLESv2::GLESv2) +if(INTEGRITY AND _qt_igy_gui_libs) + set(test_libs ${test_libs} IntegrityPlatformGraphics::IntegrityPlatformGraphics) +endif() + qt_config_compile_test(opengles3 LABEL "OpenGL ES 3.0" LIBRARIES - GLESv2::GLESv2 + ${test_libs} # special case begin COMPILE_OPTIONS ${extra_compiler_options} # special case end @@ -425,11 +440,12 @@ glMapBufferRange(GL_ARRAY_BUFFER, 0, 0, GL_MAP_READ_BIT); } ") + # opengles31 qt_config_compile_test(opengles31 LABEL "OpenGL ES 3.1" LIBRARIES - GLESv2::GLESv2 + ${test_libs} CODE "#include @@ -447,7 +463,7 @@ glProgramUniform1i(0, 0, 0); qt_config_compile_test(opengles32 LABEL "OpenGL ES 3.2" LIBRARIES - GLESv2::GLESv2 + ${test_libs} CODE "#include diff --git a/src/plugins/platforms/eglfs/CMakeLists.txt b/src/plugins/platforms/eglfs/CMakeLists.txt index 61adb94778..c8b398e7a2 100644 --- a/src/plugins/platforms/eglfs/CMakeLists.txt +++ b/src/plugins/platforms/eglfs/CMakeLists.txt @@ -56,6 +56,11 @@ qt_internal_extend_target(EglFSDeviceIntegrationPrivate CONDITION TARGET Qt::Inp Qt::InputSupportPrivate ) +qt_internal_extend_target(EglFSDeviceIntegrationPrivate CONDITION INTEGRITY AND TARGET IntegrityPlatformGraphics::IntegrityPlatformGraphics + LIBRARIES + IntegrityPlatformGraphics::IntegrityPlatformGraphics +) + qt_internal_extend_target(EglFSDeviceIntegrationPrivate CONDITION QT_FEATURE_opengl SOURCES api/qeglfscontext.cpp api/qeglfscontext_p.h