summaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorTatiana Borisova <tatiana.borisova@qt.io>2022-03-24 15:09:25 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-04-05 16:56:05 +0000
commitb96267fe1a2c493aa958deb4774879e831045302 (patch)
treeb26e7386f7395a2218a0c8def000592879a6d46c /cmake
parent94f81129d08e7c36cefb0a967a9a8fb3a7fb8808 (diff)
Reorganize work with graphical libraries on INTEGRITY
- Currently we manually unpack all platform libraries, that are required for GUI apps, and pack it into single eglmegapack.a library. It could be better do not execute such additional step, but have possibility to add required graphical libs to cmake interface lib via toolchain file list variable. Change-Id: Ic4122600f02e6828d528ee4f00075f8c27f42e38 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 8116fdde1c13fe00fb03414b56da2d66e215f279) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/3rdparty/extra-cmake-modules/find-modules/FindEGL.cmake4
-rw-r--r--cmake/FindGLESv2.cmake3
-rw-r--r--cmake/platforms/FindIntegrityPlatformGraphics.cmake26
3 files changed, 33 insertions, 0 deletions
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 <EGL/egl.h>
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})