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 19:58:00 +0000
commit6a2f613bb76c8a4e6b4cbf9908116cc22f8123ef (patch)
tree8c870ab4f0fd5b87df56a4ead5ac7856d7051e47 /cmake
parent2c0cd65fbaef5da5b5b82e684e2946b68ee2a3a9 (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})