qtbase/cmake/platforms/FindIntegrityPlatformGraphics.cmake
Alexey Edelev 26d9fca58e Generalize PlatformGraphics
Add the unified PlatformGraphics module, which looks for either Integrity
or VxWorks platform graphics.

The PlatformGraphics module creates the interface
PlatformGraphics::PlatformGraphics target which links the respective
platform graphics target. It's expected that from the platform graphics
targets to deliver the consistent subset of definitions, libraries,
include directories, compiler and linker flags and also the special
<platform>_REQUIRED_<LIBRARIES|INCLUDES|DEFINITIONS> variables.

The <platform>_REQUIRED_<LIBRARIES|INCLUDES|DEFINITIONS> variables are
consumed by the PlatformGraphics::PlatformGraphics and stored in the
respective _qt_internal_platform_graphics_required_<type> property, to
access the value without scope limitations. The property then is
checked by the EGL and GLESv2 modules(this can be done elsewhere too)
and is appended to the CMAKE_REQUIRED_<type> variable before running
the respective compiler checks.

Task-number: QTBUG-128455
Change-Id: Id1987c6294327509a14fbeeb7b8bf39aad6f486c
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Karim Pinter <karim.pinter@qt.io>
(cherry picked from commit 3322f585eb5ad11acc1f93ecaafb42e30e37b197)
2024-09-13 21:58:04 +02:00

36 lines
1.3 KiB
CMake

# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: BSD-3-Clause
#.rst:
# IntegrityPlatformGraphics
# ---------
# Temporary fall back to allow integrating this pachset without the
# toolchain file updated.
set(IntegrityPlatformGraphics_REQUIRED_LIBRARIES ${_qt_igy_gui_libs})
find_package_handle_standard_args(IntegrityPlatformGraphics
FOUND_VAR
IntegrityPlatformGraphics_FOUND
REQUIRED_VARS
IntegrityPlatformGraphics_LIBRARY
IntegrityPlatformGraphics_INCLUDE_DIR
IntegrityPlatformGraphics_REQUIRED_LIBRARIES
)
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})