init
Some checks failed
Docker. / Ubuntu (push) Has been cancelled
User-agent updater. / User-agent (push) Failing after 15s
Lock Threads / lock (push) Failing after 10s
Waiting for answer. / waiting-for-answer (push) Failing after 22s
Needs user action. / needs-user-action (push) Failing after 8s
Can't reproduce. / cant-reproduce (push) Failing after 8s
Close stale issues and PRs / stale (push) Has been cancelled
Some checks failed
Docker. / Ubuntu (push) Has been cancelled
User-agent updater. / User-agent (push) Failing after 15s
Lock Threads / lock (push) Failing after 10s
Waiting for answer. / waiting-for-answer (push) Failing after 22s
Needs user action. / needs-user-action (push) Failing after 8s
Can't reproduce. / cant-reproduce (push) Failing after 8s
Close stale issues and PRs / stale (push) Has been cancelled
This commit is contained in:
427
cmake/external/qt/CMakeLists.txt
vendored
Normal file
427
cmake/external/qt/CMakeLists.txt
vendored
Normal file
@@ -0,0 +1,427 @@
|
||||
# This file is part of Desktop App Toolkit,
|
||||
# a set of libraries for developing nice desktop applications.
|
||||
#
|
||||
# For license and copyright information please follow this link:
|
||||
# https://github.com/desktop-app/legal/blob/master/LEGAL
|
||||
|
||||
add_library(external_qt INTERFACE IMPORTED GLOBAL)
|
||||
add_library(desktop-app::external_qt ALIAS external_qt)
|
||||
|
||||
add_subdirectory(qt_static_plugins)
|
||||
|
||||
if (DESKTOP_APP_USE_PACKAGED)
|
||||
target_link_libraries(external_qt
|
||||
INTERFACE
|
||||
Qt::Core
|
||||
Qt::CorePrivate
|
||||
Qt::Gui
|
||||
Qt::GuiPrivate
|
||||
Qt::Widgets
|
||||
Qt::WidgetsPrivate
|
||||
Qt::Network
|
||||
Qt::Svg
|
||||
)
|
||||
|
||||
if (TARGET Qt::OpenGL)
|
||||
target_link_libraries(external_qt INTERFACE Qt::OpenGL)
|
||||
endif()
|
||||
|
||||
if (TARGET Qt::OpenGLWidgets)
|
||||
target_link_libraries(external_qt INTERFACE Qt::OpenGLWidgets)
|
||||
endif()
|
||||
|
||||
if (TARGET Qt::DBus)
|
||||
target_link_libraries(external_qt INTERFACE Qt::DBus)
|
||||
endif()
|
||||
|
||||
if (TARGET Qt::Quick)
|
||||
target_link_libraries(external_qt INTERFACE Qt::Quick)
|
||||
endif()
|
||||
|
||||
if (TARGET Qt::QuickWidgets)
|
||||
target_link_libraries(external_qt INTERFACE Qt::QuickWidgets)
|
||||
endif()
|
||||
|
||||
if (TARGET Qt::WaylandCompositor)
|
||||
target_link_libraries(external_qt INTERFACE Qt::WaylandCompositor)
|
||||
endif()
|
||||
|
||||
return()
|
||||
endif()
|
||||
|
||||
target_include_directories(external_qt SYSTEM
|
||||
INTERFACE
|
||||
${qt_loc}/include
|
||||
${qt_loc}/include/QtCore
|
||||
${qt_loc}/include/QtGui
|
||||
$<$<TARGET_EXISTS:Qt::OpenGL>:${qt_loc}/include/QtOpenGL>
|
||||
${qt_loc}/include/QtWidgets
|
||||
$<$<TARGET_EXISTS:Qt::OpenGLWidgets>:${qt_loc}/include/QtOpenGLWidgets>
|
||||
${qt_loc}/include/QtSvg
|
||||
$<$<TARGET_EXISTS:Qt::DBus>:${qt_loc}/include/QtDBus>
|
||||
$<$<TARGET_EXISTS:Qt::Quick>:${qt_loc}/include/QtQuick>
|
||||
$<$<TARGET_EXISTS:Qt::QuickWidgets>:${qt_loc}/include/QtQuickWidgets>
|
||||
$<$<TARGET_EXISTS:Qt::WaylandCompositor>:${qt_loc}/include/QtWaylandCompositor>
|
||||
${qt_loc}/include/QtCore/${QT_VERSION}
|
||||
${qt_loc}/include/QtGui/${QT_VERSION}
|
||||
${qt_loc}/include/QtWidgets/${QT_VERSION}
|
||||
${qt_loc}/include/QtCore/${QT_VERSION}/QtCore
|
||||
${qt_loc}/include/QtGui/${QT_VERSION}/QtGui
|
||||
${qt_loc}/include/QtWidgets/${QT_VERSION}/QtWidgets
|
||||
)
|
||||
|
||||
target_compile_definitions(external_qt
|
||||
INTERFACE
|
||||
_REENTRANT
|
||||
QT_STATICPLUGIN
|
||||
QT_PLUGIN
|
||||
QT_CORE_LIB
|
||||
QT_GUI_LIB
|
||||
$<$<TARGET_EXISTS:Qt::OpenGL>:QT_OPENGL_LIB>
|
||||
QT_WIDGETS_LIB
|
||||
$<$<TARGET_EXISTS:Qt::OpenGLWidgets>:QT_OPENGLWIDGETS_LIB>
|
||||
QT_NETWORK_LIB
|
||||
QT_SVG_LIB
|
||||
$<$<TARGET_EXISTS:Qt::DBus>:QT_DBUS_LIB>
|
||||
$<$<TARGET_EXISTS:Qt::Quick>:QT_QUICK_LIB>
|
||||
$<$<TARGET_EXISTS:Qt::QuickWidgets>:QT_QUICKWIDGETS_LIB>
|
||||
$<$<TARGET_EXISTS:Qt::WaylandCompositor>:QT_WAYLANDCOMPOSITOR_LIB>
|
||||
)
|
||||
|
||||
if (WIN32)
|
||||
set(qt_lib_prefix "")
|
||||
set(qt_lib_suffix $<$<CONFIG:Debug>:d>.lib)
|
||||
|
||||
target_compile_definitions(external_qt
|
||||
INTERFACE
|
||||
_SILENCE_STDEXT_ARR_ITERS_DEPRECATION_WARNING
|
||||
)
|
||||
else()
|
||||
set(qt_lib_prefix lib)
|
||||
if (APPLE)
|
||||
set(qt_lib_suffix $<$<CONFIG:Debug>:_debug>.a)
|
||||
else()
|
||||
set(qt_lib_suffix .a)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(common_qt_libs
|
||||
plugins/imageformats/${qt_lib_prefix}qwebp
|
||||
plugins/imageformats/${qt_lib_prefix}qgif
|
||||
plugins/imageformats/${qt_lib_prefix}qjpeg
|
||||
lib/${qt_lib_prefix}Qt${QT_VERSION_MAJOR}Svg
|
||||
lib/${qt_lib_prefix}Qt${QT_VERSION_MAJOR}Network
|
||||
lib/${qt_lib_prefix}Qt${QT_VERSION_MAJOR}Widgets
|
||||
lib/${qt_lib_prefix}Qt${QT_VERSION_MAJOR}Gui
|
||||
lib/${qt_lib_prefix}Qt${QT_VERSION_MAJOR}Core
|
||||
)
|
||||
|
||||
if (TARGET Qt::OpenGL)
|
||||
list(PREPEND common_qt_libs
|
||||
lib/${qt_lib_prefix}Qt${QT_VERSION_MAJOR}OpenGL
|
||||
)
|
||||
endif()
|
||||
|
||||
if (TARGET Qt::OpenGLWidgets)
|
||||
list(PREPEND common_qt_libs
|
||||
lib/${qt_lib_prefix}Qt${QT_VERSION_MAJOR}OpenGLWidgets
|
||||
)
|
||||
endif()
|
||||
|
||||
if (TARGET Qt::Quick)
|
||||
list(PREPEND common_qt_libs
|
||||
lib/${qt_lib_prefix}Qt${QT_VERSION_MAJOR}Quick
|
||||
lib/${qt_lib_prefix}Qt${QT_VERSION_MAJOR}Qml
|
||||
)
|
||||
endif()
|
||||
|
||||
if (TARGET Qt::QuickWidgets)
|
||||
list(PREPEND common_qt_libs
|
||||
lib/${qt_lib_prefix}Qt${QT_VERSION_MAJOR}QuickWidgets
|
||||
)
|
||||
endif()
|
||||
|
||||
if (QT_VERSION_MAJOR GREATER_EQUAL 6)
|
||||
list(APPEND common_qt_libs
|
||||
lib/${qt_lib_prefix}Qt${QT_VERSION_MAJOR}BundledHarfbuzz
|
||||
lib/${qt_lib_prefix}Qt${QT_VERSION_MAJOR}BundledLibpng
|
||||
lib/${qt_lib_prefix}Qt${QT_VERSION_MAJOR}BundledPcre2
|
||||
)
|
||||
else()
|
||||
list(APPEND common_qt_libs
|
||||
lib/${qt_lib_prefix}qtharfbuzz
|
||||
lib/${qt_lib_prefix}qtlibpng
|
||||
lib/${qt_lib_prefix}qtpcre2
|
||||
)
|
||||
|
||||
endif()
|
||||
|
||||
set(qt_libs_list "")
|
||||
if (QT_VERSION_MAJOR GREATER_EQUAL 6)
|
||||
list(APPEND qt_libs_list
|
||||
$<TARGET_OBJECTS:Qt${QT_VERSION_MAJOR}::QWebpPlugin_init>
|
||||
$<TARGET_OBJECTS:Qt${QT_VERSION_MAJOR}::QJpegPlugin_init>
|
||||
$<TARGET_OBJECTS:Qt${QT_VERSION_MAJOR}::QGifPlugin_init>
|
||||
)
|
||||
endif()
|
||||
|
||||
if (WIN32)
|
||||
target_include_directories(external_qt SYSTEM
|
||||
INTERFACE
|
||||
${qt_loc}/mkspecs/win32-msvc
|
||||
)
|
||||
set(qt_libs
|
||||
${common_qt_libs}
|
||||
plugins/platforms/${qt_lib_prefix}qwindows
|
||||
)
|
||||
if (QT_VERSION GREATER 6)
|
||||
list(APPEND qt_libs
|
||||
plugins/tls/${qt_lib_prefix}qschannelbackend
|
||||
plugins/networkinformation/${qt_lib_prefix}qnetworklistmanager
|
||||
lib/${qt_lib_prefix}Qt${QT_VERSION_MAJOR}BundledFreetype
|
||||
lib/${qt_lib_prefix}Qt${QT_VERSION_MAJOR}EntryPoint
|
||||
)
|
||||
list(APPEND qt_libs_list
|
||||
$<TARGET_OBJECTS:Qt${QT_VERSION_MAJOR}::QWindowsIntegrationPlugin_init>
|
||||
$<TARGET_OBJECTS:Qt${QT_VERSION_MAJOR}::QSchannelBackendPlugin_init>
|
||||
$<TARGET_OBJECTS:Qt${QT_VERSION_MAJOR}::QNLMNIPlugin_init>
|
||||
$<TARGET_OBJECTS:Qt${QT_VERSION_MAJOR}::QWindowsIntegrationPlugin_resources_1>
|
||||
)
|
||||
else()
|
||||
list(APPEND qt_libs
|
||||
plugins/bearer/${qt_lib_prefix}qgenericbearer
|
||||
lib/${qt_lib_prefix}Qt${QT_VERSION_MAJOR}AccessibilitySupport
|
||||
lib/${qt_lib_prefix}Qt${QT_VERSION_MAJOR}FontDatabaseSupport
|
||||
lib/${qt_lib_prefix}Qt${QT_VERSION_MAJOR}EventDispatcherSupport
|
||||
lib/${qt_lib_prefix}Qt${QT_VERSION_MAJOR}ThemeSupport
|
||||
lib/${qt_lib_prefix}Qt${QT_VERSION_MAJOR}WindowsUIAutomationSupport
|
||||
lib/${qt_lib_prefix}qtmain
|
||||
lib/${qt_lib_prefix}qtfreetype
|
||||
)
|
||||
endif()
|
||||
foreach (lib ${qt_libs})
|
||||
list(APPEND qt_libs_list "${qt_loc}/${lib}${qt_lib_suffix}")
|
||||
endforeach()
|
||||
|
||||
if (QT_VERSION GREATER 6)
|
||||
target_link_libraries(external_qt
|
||||
INTERFACE
|
||||
Authz
|
||||
Dwrite
|
||||
DXGI
|
||||
dxguid
|
||||
D3D9
|
||||
D3D11
|
||||
D3D12
|
||||
SetupAPI
|
||||
Shcore
|
||||
Synchronization
|
||||
WindowsApp
|
||||
)
|
||||
else()
|
||||
target_link_libraries(external_qt
|
||||
INTERFACE
|
||||
desktop-app::external_angle
|
||||
)
|
||||
endif()
|
||||
elseif (APPLE)
|
||||
target_include_directories(external_qt SYSTEM
|
||||
INTERFACE
|
||||
${qt_loc}/mkspecs/macx-clang
|
||||
)
|
||||
set(qt_libs
|
||||
${common_qt_libs}
|
||||
lib/${qt_lib_prefix}Qt${QT_VERSION_MAJOR}BundledFreetype
|
||||
plugins/platforms/${qt_lib_prefix}qcocoa
|
||||
plugins/tls/${qt_lib_prefix}qsecuretransportbackend
|
||||
plugins/networkinformation/${qt_lib_prefix}qscnetworkreachability
|
||||
)
|
||||
list(APPEND qt_libs_list
|
||||
$<TARGET_OBJECTS:Qt${QT_VERSION_MAJOR}::QCocoaIntegrationPlugin_init>
|
||||
$<TARGET_OBJECTS:Qt${QT_VERSION_MAJOR}::QSecureTransportBackendPlugin_init>
|
||||
$<TARGET_OBJECTS:Qt${QT_VERSION_MAJOR}::QSCNetworkReachabilityNetworkInformationPlugin_init>
|
||||
$<TARGET_OBJECTS:Qt${QT_VERSION_MAJOR}::QCocoaIntegrationPlugin_resources_1>
|
||||
)
|
||||
foreach (lib ${qt_libs})
|
||||
list(APPEND qt_libs_list "${qt_loc}/${lib}${qt_lib_suffix}")
|
||||
endforeach()
|
||||
else()
|
||||
set(qt_libs
|
||||
plugins/platforms/${qt_lib_prefix}qwayland-generic
|
||||
plugins/platforms/${qt_lib_prefix}qwayland-egl
|
||||
plugins/wayland-graphics-integration-client/${qt_lib_prefix}qt-plugin-wayland-egl
|
||||
plugins/wayland-shell-integration/${qt_lib_prefix}xdg-shell
|
||||
plugins/wayland-decoration-client/${qt_lib_prefix}adwaita
|
||||
plugins/wayland-decoration-client/${qt_lib_prefix}bradient
|
||||
lib/${qt_lib_prefix}Qt${QT_VERSION_MAJOR}WaylandEglClientHwIntegration
|
||||
lib/${qt_lib_prefix}Qt${QT_VERSION_MAJOR}WaylandClient
|
||||
plugins/platforms/${qt_lib_prefix}qxcb
|
||||
plugins/xcbglintegrations/${qt_lib_prefix}qxcb-egl-integration
|
||||
plugins/xcbglintegrations/${qt_lib_prefix}qxcb-glx-integration
|
||||
plugins/platforminputcontexts/${qt_lib_prefix}composeplatforminputcontextplugin
|
||||
plugins/iconengines/${qt_lib_prefix}qsvgicon
|
||||
plugins/platformthemes/${qt_lib_prefix}qgtk3
|
||||
plugins/tls/${qt_lib_prefix}qopensslbackend
|
||||
plugins/networkinformation/${qt_lib_prefix}qglib
|
||||
lib/${qt_lib_prefix}Qt${QT_VERSION_MAJOR}XcbQpa
|
||||
${common_qt_libs}
|
||||
)
|
||||
list(APPEND qt_libs_list
|
||||
$<TARGET_OBJECTS:Qt${QT_VERSION_MAJOR}::QXcbIntegrationPlugin_init>
|
||||
$<TARGET_OBJECTS:Qt${QT_VERSION_MAJOR}::QXcbEglIntegrationPlugin_init>
|
||||
$<TARGET_OBJECTS:Qt${QT_VERSION_MAJOR}::QXcbGlxIntegrationPlugin_init>
|
||||
$<TARGET_OBJECTS:Qt${QT_VERSION_MAJOR}::QWaylandIntegrationPlugin_init>
|
||||
$<TARGET_OBJECTS:Qt${QT_VERSION_MAJOR}::QWaylandEglPlatformIntegrationPlugin_init>
|
||||
$<TARGET_OBJECTS:Qt${QT_VERSION_MAJOR}::QWaylandEglClientBufferPlugin_init>
|
||||
$<TARGET_OBJECTS:Qt${QT_VERSION_MAJOR}::QWaylandXdgShellIntegrationPlugin_init>
|
||||
$<TARGET_OBJECTS:Qt${QT_VERSION_MAJOR}::QWaylandAdwaitaDecorationPlugin_init>
|
||||
$<TARGET_OBJECTS:Qt${QT_VERSION_MAJOR}::QWaylandBradientDecorationPlugin_init>
|
||||
$<TARGET_OBJECTS:Qt${QT_VERSION_MAJOR}::QComposePlatformInputContextPlugin_init>
|
||||
$<TARGET_OBJECTS:Qt${QT_VERSION_MAJOR}::QSvgIconPlugin_init>
|
||||
$<TARGET_OBJECTS:Qt${QT_VERSION_MAJOR}::QGtk3ThemePlugin_init>
|
||||
$<TARGET_OBJECTS:Qt${QT_VERSION_MAJOR}::QTlsBackendOpenSSLPlugin_init>
|
||||
$<TARGET_OBJECTS:Qt${QT_VERSION_MAJOR}::QGlibNetworkInformationPlugin_init>
|
||||
)
|
||||
if (TARGET Qt::DBus)
|
||||
list(PREPEND qt_libs
|
||||
plugins/platforminputcontexts/${qt_lib_prefix}ibusplatforminputcontextplugin
|
||||
plugins/platformthemes/${qt_lib_prefix}qxdgdesktopportal
|
||||
)
|
||||
list(APPEND qt_libs
|
||||
lib/${qt_lib_prefix}Qt${QT_VERSION_MAJOR}DBus
|
||||
lib/${qt_lib_prefix}Qt${QT_VERSION_MAJOR}Core
|
||||
)
|
||||
list(APPEND qt_libs_list
|
||||
$<TARGET_OBJECTS:Qt${QT_VERSION_MAJOR}::QIbusPlatformInputContextPlugin_init>
|
||||
$<TARGET_OBJECTS:Qt${QT_VERSION_MAJOR}::QXdgDesktopPortalThemePlugin_init>
|
||||
)
|
||||
endif()
|
||||
if (TARGET Qt::WaylandCompositor)
|
||||
list(PREPEND qt_libs
|
||||
plugins/wayland-graphics-integration-server/${qt_lib_prefix}qt-wayland-compositor-wayland-egl
|
||||
lib/${qt_lib_prefix}Qt${QT_VERSION_MAJOR}WaylandEglCompositorHwIntegration
|
||||
lib/${qt_lib_prefix}Qt${QT_VERSION_MAJOR}WaylandCompositor
|
||||
)
|
||||
list(APPEND qt_libs_list
|
||||
$<TARGET_OBJECTS:Qt${QT_VERSION_MAJOR}::QWaylandEglClientBufferIntegrationPlugin_init>
|
||||
$<TARGET_OBJECTS:Qt${QT_VERSION_MAJOR}::WaylandCompositor_resources_1>
|
||||
)
|
||||
endif()
|
||||
foreach (lib ${qt_libs})
|
||||
list(APPEND qt_libs_list "${qt_loc}/${lib}${qt_lib_suffix}")
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
if (QT_VERSION_MAJOR GREATER_EQUAL 6)
|
||||
list(APPEND qt_libs_list
|
||||
$<TARGET_OBJECTS:Qt${QT_VERSION_MAJOR}::Gui_resources_1>
|
||||
$<$<TARGET_EXISTS:Qt${QT_VERSION_MAJOR}::Gui_resources_2>:$<TARGET_OBJECTS:Qt${QT_VERSION_MAJOR}::Gui_resources_2>>
|
||||
$<TARGET_OBJECTS:Qt${QT_VERSION_MAJOR}::Widgets_resources_1>
|
||||
$<TARGET_OBJECTS:Qt${QT_VERSION_MAJOR}::Widgets_resources_2>
|
||||
$<TARGET_OBJECTS:Qt${QT_VERSION_MAJOR}::Widgets_resources_3>
|
||||
)
|
||||
|
||||
if (TARGET Qt::Quick)
|
||||
list(APPEND qt_libs_list
|
||||
$<TARGET_OBJECTS:Qt${QT_VERSION_MAJOR}::Quick_resources_2>
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
target_link_libraries(external_qt
|
||||
INTERFACE
|
||||
${qt_libs_list}
|
||||
$<LINK_ONLY:desktop-app::external_openssl>
|
||||
$<TARGET_FILE:desktop-app::external_openssl_ssl_bundled>
|
||||
$<TARGET_FILE:desktop-app::external_openssl_crypto_bundled>
|
||||
$<LINK_ONLY:desktop-app::external_jpeg>
|
||||
$<TARGET_FILE:desktop-app::external_jpeg>
|
||||
$<LINK_ONLY:desktop-app::external_zlib>
|
||||
$<TARGET_FILE:desktop-app::external_zlib>
|
||||
)
|
||||
|
||||
if (WIN32)
|
||||
if (build_winarm)
|
||||
set(libwebp_release_folder ARM64)
|
||||
elseif (build_win64)
|
||||
set(libwebp_release_folder x64)
|
||||
else()
|
||||
set(libwebp_release_folder x86)
|
||||
endif()
|
||||
|
||||
set(webp_lib_loc ${libs_loc}/libwebp/out/$<IF:$<CONFIG:Debug>,debug,release>-static/${libwebp_release_folder}/lib)
|
||||
|
||||
target_link_libraries(external_qt
|
||||
INTERFACE
|
||||
${webp_lib_loc}/libwebp$<$<CONFIG:Debug>:_debug>.lib
|
||||
${webp_lib_loc}/libwebpdemux$<$<CONFIG:Debug>:_debug>.lib
|
||||
${webp_lib_loc}/libwebpmux$<$<CONFIG:Debug>:_debug>.lib
|
||||
)
|
||||
|
||||
if (QT_VERSION GREATER 6)
|
||||
set(lcms2_lib_loc ${libs_loc}/liblcms2/out/$<IF:$<CONFIG:Debug>,Debug,Release>/src)
|
||||
target_link_libraries(external_qt INTERFACE ${lcms2_lib_loc}/liblcms2.a)
|
||||
endif()
|
||||
elseif (APPLE)
|
||||
target_link_libraries(external_qt
|
||||
INTERFACE
|
||||
${libs_loc}/local/lib/liblcms2.a
|
||||
${libs_loc}/local/lib/libwebp.a
|
||||
${libs_loc}/local/lib/libwebpdemux.a
|
||||
${libs_loc}/local/lib/libwebpmux.a
|
||||
${libs_loc}/local/lib/libsharpyuv.a
|
||||
)
|
||||
elseif (LINUX)
|
||||
target_include_directories(external_qt SYSTEM
|
||||
INTERFACE
|
||||
${qt_loc}/mkspecs/linux-g++
|
||||
)
|
||||
target_link_libraries(external_qt
|
||||
INTERFACE
|
||||
gtk-3
|
||||
gdk-3
|
||||
gdk_pixbuf-2.0
|
||||
pango-1.0
|
||||
lcms2
|
||||
fontconfig
|
||||
freetype
|
||||
EGL
|
||||
GL
|
||||
wayland-egl
|
||||
wayland-cursor
|
||||
wayland-client
|
||||
X11-xcb
|
||||
X11
|
||||
xkbcommon
|
||||
xkbcommon-x11
|
||||
xcb-cursor
|
||||
xcb-glx
|
||||
xcb-xkb
|
||||
xcb-randr
|
||||
xcb-icccm
|
||||
xcb-shm
|
||||
xcb-render
|
||||
xcb-image
|
||||
xcb-xfixes
|
||||
xcb-shape
|
||||
xcb-sync
|
||||
xcb-util
|
||||
xcb-render-util
|
||||
xcb-keysyms
|
||||
xcb
|
||||
gio-2.0
|
||||
gobject-2.0
|
||||
glib-2.0
|
||||
rt
|
||||
webpmux
|
||||
webpdemux
|
||||
webp
|
||||
sharpyuv
|
||||
)
|
||||
if (TARGET Qt::WaylandCompositor)
|
||||
target_link_libraries(external_qt
|
||||
INTERFACE
|
||||
wayland-server
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
85
cmake/external/qt/package.cmake
vendored
Normal file
85
cmake/external/qt/package.cmake
vendored
Normal file
@@ -0,0 +1,85 @@
|
||||
# This file is part of Desktop App Toolkit,
|
||||
# a set of libraries for developing nice desktop applications.
|
||||
#
|
||||
# For license and copyright information please follow this link:
|
||||
# https://github.com/desktop-app/legal/blob/master/LEGAL
|
||||
|
||||
if (NOT DESKTOP_APP_USE_PACKAGED)
|
||||
if (DEFINED ENV{QT})
|
||||
set(qt_requested $ENV{QT} CACHE STRING "Qt version" FORCE)
|
||||
endif()
|
||||
|
||||
if (NOT LINUX AND NOT DEFINED qt_requested)
|
||||
message(FATAL_ERROR "Qt version is unknown, set `QT' environment variable")
|
||||
endif()
|
||||
|
||||
if (WIN32)
|
||||
set(qt_loc ${libs_loc}/Qt-${qt_requested})
|
||||
|
||||
if (qt_requested GREATER 6)
|
||||
set(OPENSSL_FOUND 1)
|
||||
set(OPENSSL_INCLUDE_DIR ${libs_loc}/openssl3/include)
|
||||
set(LIB_EAY_DEBUG ${libs_loc}/openssl3/out.dbg/libcrypto.lib)
|
||||
set(SSL_EAY_DEBUG ${libs_loc}/openssl3/out.dbg/libssl.lib)
|
||||
set(LIB_EAY_RELEASE ${libs_loc}/openssl3/out/libcrypto.lib)
|
||||
set(SSL_EAY_RELEASE ${libs_loc}/openssl3/out/libssl.lib)
|
||||
set(JPEG_FOUND 1)
|
||||
set(JPEG_INCLUDE_DIR ${libs_loc}/mozjpeg)
|
||||
set(JPEG_LIBRARY_DEBUG ${libs_loc}/mozjpeg/Debug/jpeg-static.lib)
|
||||
set(JPEG_LIBRARY_RELEASE ${libs_loc}/mozjpeg/Release/jpeg-static.lib)
|
||||
set(ZLIB_FOUND 1)
|
||||
set(ZLIB_INCLUDE_DIR ${libs_loc}/zlib)
|
||||
set(ZLIB_LIBRARY_DEBUG ${libs_loc}/zlib/Debug/zlibstaticd.lib)
|
||||
set(ZLIB_LIBRARY_RELEASE ${libs_loc}/zlib/Release/zlibstatic.lib)
|
||||
set(WebP_INCLUDE_DIR ${libs_loc}/libwebp/src)
|
||||
set(WebP_demux_INCLUDE_DIR ${libs_loc}/libwebp/src)
|
||||
set(WebP_mux_INCLUDE_DIR ${libs_loc}/libwebp/src)
|
||||
set(WebP_LIBRARY ${libs_loc}/libwebp/out/release-static/x86/lib/webp.lib)
|
||||
set(WebP_demux_LIBRARY ${libs_loc}/libwebp/out/release-static/x86/lib/webpdemux.lib)
|
||||
set(WebP_mux_LIBRARY ${libs_loc}/libwebp/out/release-static/x86/lib/webpmux.lib)
|
||||
set(LCMS2_FOUND 1)
|
||||
set(LCMS2_INCLUDE_DIR ${libs_loc}/liblcms2/include)
|
||||
set(LCMS2_LIBRARIES ${libs_loc}/liblcms2/out/Release/src/liblcms2.a)
|
||||
endif()
|
||||
elseif (APPLE)
|
||||
set(qt_loc ${libs_loc}/local/Qt-${qt_requested})
|
||||
else()
|
||||
set(qt_loc /usr/local)
|
||||
endif()
|
||||
|
||||
list(APPEND CMAKE_PREFIX_PATH ${qt_loc} ${libs_loc}/local)
|
||||
endif()
|
||||
|
||||
if (DEFINED QT_VERSION_MAJOR)
|
||||
find_package(QT NAMES Qt${QT_VERSION_MAJOR} COMPONENTS Core REQUIRED)
|
||||
else()
|
||||
find_package(QT NAMES Qt6 COMPONENTS Core QUIET)
|
||||
if (NOT QT_FOUND)
|
||||
find_package(QT NAMES Qt5 COMPONENTS Core QUIET)
|
||||
endif()
|
||||
if (NOT QT_FOUND)
|
||||
message(FATAL_ERROR "Neither Qt6 nor Qt5 is found")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (NOT LINUX AND NOT DESKTOP_APP_USE_PACKAGED AND NOT qt_requested EQUAL QT_VERSION)
|
||||
message(FATAL_ERROR "Configured Qt version ${QT_VERSION} does not match requested version ${qt_requested}. Please reconfigure.")
|
||||
endif()
|
||||
|
||||
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core Gui Widgets Network Svg REQUIRED)
|
||||
find_package(Qt${QT_VERSION_MAJOR} OPTIONAL_COMPONENTS Quick QuickWidgets QUIET)
|
||||
|
||||
if (QT_VERSION_MAJOR GREATER_EQUAL 6)
|
||||
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS OpenGL OpenGLWidgets REQUIRED)
|
||||
endif()
|
||||
|
||||
if (QT_VERSION VERSION_GREATER_EQUAL 6.10)
|
||||
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS GuiPrivate WidgetsPrivate REQUIRED)
|
||||
endif()
|
||||
|
||||
if (LINUX)
|
||||
find_package(Qt${QT_VERSION_MAJOR} OPTIONAL_COMPONENTS DBus WaylandCompositor QUIET)
|
||||
endif()
|
||||
|
||||
set_property(GLOBAL PROPERTY AUTOGEN_SOURCE_GROUP "(gen)")
|
||||
set_property(GLOBAL PROPERTY AUTOGEN_TARGETS_FOLDER "(gen)")
|
||||
60
cmake/external/qt/qt_static_plugins/CMakeLists.txt
vendored
Normal file
60
cmake/external/qt/qt_static_plugins/CMakeLists.txt
vendored
Normal file
@@ -0,0 +1,60 @@
|
||||
# This file is part of Desktop App Toolkit,
|
||||
# a set of libraries for developing nice desktop applications.
|
||||
#
|
||||
# For license and copyright information please follow this link:
|
||||
# https://github.com/desktop-app/legal/blob/master/LEGAL
|
||||
|
||||
add_library(external_qt_static_plugins OBJECT)
|
||||
add_library(desktop-app::external_qt_static_plugins ALIAS external_qt_static_plugins)
|
||||
init_target(external_qt_static_plugins "(external)")
|
||||
|
||||
nice_target_sources(external_qt_static_plugins ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
PRIVATE
|
||||
qt_static_plugins.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(external_qt_static_plugins
|
||||
PUBLIC
|
||||
desktop-app::external_qt
|
||||
)
|
||||
|
||||
if (DESKTOP_APP_USE_PACKAGED)
|
||||
target_compile_definitions(external_qt_static_plugins
|
||||
PRIVATE
|
||||
QT_STATIC_PLUGINS_USE_PACKAGED
|
||||
)
|
||||
endif()
|
||||
|
||||
if (DESKTOP_APP_DISABLE_QT_PLUGINS)
|
||||
return()
|
||||
endif()
|
||||
|
||||
add_checked_subdirectory(kimageformats)
|
||||
target_link_libraries(external_qt_static_plugins
|
||||
PUBLIC
|
||||
desktop-app::external_qt_static_plugins_kimageformats
|
||||
)
|
||||
|
||||
if (LINUX)
|
||||
add_checked_subdirectory(nimf)
|
||||
target_link_libraries(external_qt_static_plugins
|
||||
PUBLIC
|
||||
desktop-app::external_qt_static_plugins_nimf
|
||||
)
|
||||
|
||||
if (TARGET Qt::DBus)
|
||||
add_checked_subdirectory(fcitx5)
|
||||
target_link_libraries(external_qt_static_plugins
|
||||
PUBLIC
|
||||
desktop-app::external_qt_static_plugins_fcitx5
|
||||
)
|
||||
endif()
|
||||
|
||||
if (NOT DESKTOP_APP_DISABLE_X11_INTEGRATION)
|
||||
add_checked_subdirectory(hime)
|
||||
target_link_libraries(external_qt_static_plugins
|
||||
PUBLIC
|
||||
desktop-app::external_qt_static_plugins_hime
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
87
cmake/external/qt/qt_static_plugins/fcitx5/CMakeLists.txt
vendored
Normal file
87
cmake/external/qt/qt_static_plugins/fcitx5/CMakeLists.txt
vendored
Normal file
@@ -0,0 +1,87 @@
|
||||
# This file is part of Desktop App Toolkit,
|
||||
# a set of libraries for developing nice desktop applications.
|
||||
#
|
||||
# For license and copyright information please follow this link:
|
||||
# https://github.com/desktop-app/legal/blob/master/LEGAL
|
||||
|
||||
add_library(external_qt_static_plugins_fcitx5 STATIC)
|
||||
add_library(desktop-app::external_qt_static_plugins_fcitx5 ALIAS external_qt_static_plugins_fcitx5)
|
||||
init_target(external_qt_static_plugins_fcitx5 "(external)")
|
||||
|
||||
set(fcitx5_qt_loc ${third_party_loc}/fcitx5-qt)
|
||||
set(fcitx5_qt_src ${fcitx5_qt_loc}/qt${QT_VERSION_MAJOR}/platforminputcontext)
|
||||
|
||||
set_target_properties(external_qt_static_plugins_fcitx5 PROPERTIES AUTOMOC ON)
|
||||
set(FCITX5_QT_EXTRA_PLUGIN_NAME "\"fcitx\",")
|
||||
|
||||
configure_file("${fcitx5_qt_src}/fcitx5.json.in" "${CMAKE_CURRENT_BINARY_DIR}/fcitx5.json")
|
||||
|
||||
nice_target_sources(external_qt_static_plugins_fcitx5 ${fcitx5_qt_src}
|
||||
PRIVATE
|
||||
fcitx4watcher.cpp
|
||||
fcitx4inputcontextproxy.cpp
|
||||
fcitx4inputcontextproxyimpl.cpp
|
||||
fcitx4inputmethodproxy.cpp
|
||||
hybridinputcontext.cpp
|
||||
qfcitxplatforminputcontext.cpp
|
||||
fcitxcandidatewindow.cpp
|
||||
fcitxtheme.cpp
|
||||
font.cpp
|
||||
qtkey.cpp
|
||||
main.cpp
|
||||
)
|
||||
|
||||
target_include_directories(external_qt_static_plugins_fcitx5
|
||||
PRIVATE
|
||||
${fcitx5_qt_src}
|
||||
${fcitx5_qt_loc}/common
|
||||
)
|
||||
|
||||
target_compile_definitions(external_qt_static_plugins_fcitx5
|
||||
PRIVATE
|
||||
QT_STATICPLUGIN
|
||||
FCITX_PLUGIN_DATA_FILE_PATH="${CMAKE_CURRENT_BINARY_DIR}/fcitx5.json"
|
||||
)
|
||||
|
||||
find_package(PkgConfig REQUIRED)
|
||||
pkg_check_modules(DESKTOP_APP_XKBCOMMON REQUIRED IMPORTED_TARGET xkbcommon)
|
||||
|
||||
add_subdirectory(fcitx5_qt_dbusaddons)
|
||||
target_link_libraries(external_qt_static_plugins_fcitx5
|
||||
PRIVATE
|
||||
desktop-app::external_qt_static_plugins_fcitx5_dbusaddons
|
||||
desktop-app::external_qt
|
||||
PkgConfig::DESKTOP_APP_XKBCOMMON
|
||||
)
|
||||
|
||||
if (NOT DESKTOP_APP_DISABLE_X11_INTEGRATION)
|
||||
target_compile_definitions(external_qt_static_plugins_fcitx5
|
||||
PRIVATE
|
||||
ENABLE_X11
|
||||
)
|
||||
|
||||
target_link_libraries(external_qt_static_plugins_fcitx5
|
||||
PRIVATE
|
||||
desktop-app::external_xcb
|
||||
)
|
||||
endif()
|
||||
|
||||
add_library(external_qt_static_plugins_fcitx5_init OBJECT)
|
||||
add_library(desktop-app::external_qt_static_plugins_fcitx5_init ALIAS external_qt_static_plugins_fcitx5_init)
|
||||
init_target(external_qt_static_plugins_fcitx5_init "(external)")
|
||||
|
||||
nice_target_sources(external_qt_static_plugins_fcitx5_init ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
PRIVATE
|
||||
init.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(external_qt_static_plugins_fcitx5_init
|
||||
PRIVATE
|
||||
desktop-app::external_qt
|
||||
)
|
||||
|
||||
target_link_libraries(external_qt_static_plugins_fcitx5
|
||||
INTERFACE
|
||||
external_qt_static_plugins_fcitx5_init
|
||||
$<TARGET_OBJECTS:external_qt_static_plugins_fcitx5_init>
|
||||
)
|
||||
50
cmake/external/qt/qt_static_plugins/fcitx5/fcitx5_qt_dbusaddons/CMakeLists.txt
vendored
Normal file
50
cmake/external/qt/qt_static_plugins/fcitx5/fcitx5_qt_dbusaddons/CMakeLists.txt
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
# This file is part of Desktop App Toolkit,
|
||||
# a set of libraries for developing nice desktop applications.
|
||||
#
|
||||
# For license and copyright information please follow this link:
|
||||
# https://github.com/desktop-app/legal/blob/master/LEGAL
|
||||
|
||||
add_library(external_qt_static_plugins_fcitx5_dbusaddons STATIC)
|
||||
add_library(desktop-app::external_qt_static_plugins_fcitx5_dbusaddons ALIAS external_qt_static_plugins_fcitx5_dbusaddons)
|
||||
init_target(external_qt_static_plugins_fcitx5_dbusaddons "(external)")
|
||||
|
||||
set(fcitx5_qt_loc ${third_party_loc}/fcitx5-qt)
|
||||
set(fcitx5_qt_dbusaddons_src ${fcitx5_qt_loc}/qt${QT_VERSION_MAJOR}/dbusaddons)
|
||||
|
||||
set_target_properties(external_qt_static_plugins_fcitx5_dbusaddons PROPERTIES AUTOMOC ON)
|
||||
|
||||
nice_target_sources(external_qt_static_plugins_fcitx5_dbusaddons ${fcitx5_qt_dbusaddons_src}
|
||||
PRIVATE
|
||||
fcitxqtwatcher.cpp
|
||||
fcitxqtwatcher.h
|
||||
fcitxqtdbustypes.cpp
|
||||
fcitxqtdbustypes.h
|
||||
fcitxqtinputcontextproxy.cpp
|
||||
fcitxqtinputcontextproxy.h
|
||||
fcitxqtinputcontextproxyimpl.cpp
|
||||
fcitxqtinputmethodproxy.cpp
|
||||
fcitxqtinputmethodproxy.h
|
||||
fcitxqtcontrollerproxy.cpp
|
||||
fcitxqtcontrollerproxy.h
|
||||
)
|
||||
|
||||
include(GenerateExportHeader)
|
||||
generate_export_header(external_qt_static_plugins_fcitx5_dbusaddons BASE_NAME Fcitx5Qt${QT_VERSION_MAJOR}DBusAddons)
|
||||
|
||||
target_include_directories(external_qt_static_plugins_fcitx5_dbusaddons
|
||||
PUBLIC
|
||||
${fcitx5_qt_dbusaddons_src}
|
||||
"${CMAKE_CURRENT_BINARY_DIR}"
|
||||
)
|
||||
|
||||
if (QT_VERSION_MAJOR EQUAL 5)
|
||||
target_compile_definitions(external_qt_static_plugins_fcitx5_dbusaddons
|
||||
PRIVATE
|
||||
FCITX5QT5DBUSADDONS_STATIC_DEFINE
|
||||
)
|
||||
endif()
|
||||
|
||||
target_link_libraries(external_qt_static_plugins_fcitx5_dbusaddons
|
||||
PRIVATE
|
||||
desktop-app::external_qt
|
||||
)
|
||||
10
cmake/external/qt/qt_static_plugins/fcitx5/init.cpp
vendored
Normal file
10
cmake/external/qt/qt_static_plugins/fcitx5/init.cpp
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
/*
|
||||
This file is part of Desktop App Toolkit,
|
||||
a set of libraries for developing nice desktop applications.
|
||||
|
||||
For license and copyright information please follow this link:
|
||||
https://github.com/desktop-app/legal/blob/master/LEGAL
|
||||
*/
|
||||
#include <QtCore/QtPlugin>
|
||||
|
||||
Q_IMPORT_PLUGIN(QFcitx5PlatformInputContextPlugin)
|
||||
59
cmake/external/qt/qt_static_plugins/hime/CMakeLists.txt
vendored
Normal file
59
cmake/external/qt/qt_static_plugins/hime/CMakeLists.txt
vendored
Normal file
@@ -0,0 +1,59 @@
|
||||
# This file is part of Desktop App Toolkit,
|
||||
# a set of libraries for developing nice desktop applications.
|
||||
#
|
||||
# For license and copyright information please follow this link:
|
||||
# https://github.com/desktop-app/legal/blob/master/LEGAL
|
||||
|
||||
add_library(external_qt_static_plugins_hime STATIC)
|
||||
add_library(desktop-app::external_qt_static_plugins_hime ALIAS external_qt_static_plugins_hime)
|
||||
init_target(external_qt_static_plugins_hime "(external)")
|
||||
|
||||
set(hime_loc ${third_party_loc}/hime)
|
||||
set(hime_qt_src ${hime_loc}/src/qt5-im)
|
||||
|
||||
set_target_properties(external_qt_static_plugins_hime PROPERTIES AUTOMOC ON)
|
||||
|
||||
nice_target_sources(external_qt_static_plugins_hime ${hime_qt_src}
|
||||
PRIVATE
|
||||
hime-imcontext-qt.cpp
|
||||
hime-imcontext-qt.h
|
||||
hime-qt.cpp
|
||||
hime-qt.h
|
||||
)
|
||||
|
||||
target_include_directories(external_qt_static_plugins_hime
|
||||
PRIVATE
|
||||
${hime_qt_src}
|
||||
)
|
||||
|
||||
target_compile_definitions(external_qt_static_plugins_hime
|
||||
PRIVATE
|
||||
QT_STATICPLUGIN
|
||||
)
|
||||
|
||||
add_subdirectory(hime_im_client)
|
||||
target_link_libraries(external_qt_static_plugins_hime
|
||||
PRIVATE
|
||||
desktop-app::external_qt_static_plugins_hime_im_client
|
||||
desktop-app::external_qt
|
||||
)
|
||||
|
||||
add_library(external_qt_static_plugins_hime_init OBJECT)
|
||||
add_library(desktop-app::external_qt_static_plugins_hime_init ALIAS external_qt_static_plugins_hime_init)
|
||||
init_target(external_qt_static_plugins_hime_init "(external)")
|
||||
|
||||
nice_target_sources(external_qt_static_plugins_hime_init ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
PRIVATE
|
||||
init.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(external_qt_static_plugins_hime_init
|
||||
PRIVATE
|
||||
desktop-app::external_qt
|
||||
)
|
||||
|
||||
target_link_libraries(external_qt_static_plugins_hime
|
||||
INTERFACE
|
||||
external_qt_static_plugins_hime_init
|
||||
$<TARGET_OBJECTS:external_qt_static_plugins_hime_init>
|
||||
)
|
||||
35
cmake/external/qt/qt_static_plugins/hime/hime_im_client/CMakeLists.txt
vendored
Normal file
35
cmake/external/qt/qt_static_plugins/hime/hime_im_client/CMakeLists.txt
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
# This file is part of Desktop App Toolkit,
|
||||
# a set of libraries for developing nice desktop applications.
|
||||
#
|
||||
# For license and copyright information please follow this link:
|
||||
# https://github.com/desktop-app/legal/blob/master/LEGAL
|
||||
|
||||
add_library(external_qt_static_plugins_hime_im_client STATIC)
|
||||
add_library(desktop-app::external_qt_static_plugins_hime_im_client ALIAS external_qt_static_plugins_hime_im_client)
|
||||
init_target(external_qt_static_plugins_hime_im_client "(external)")
|
||||
|
||||
set(hime_loc ${third_party_loc}/hime)
|
||||
set(hime_im_client_src ${hime_loc}/src/im-client)
|
||||
|
||||
nice_target_sources(external_qt_static_plugins_hime_im_client ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
PRIVATE
|
||||
hime_im_client_helper.cpp
|
||||
)
|
||||
|
||||
target_include_directories(external_qt_static_plugins_hime_im_client
|
||||
PUBLIC
|
||||
${hime_im_client_src}
|
||||
)
|
||||
|
||||
target_link_libraries(external_qt_static_plugins_hime_im_client
|
||||
PRIVATE
|
||||
desktop-app::lib_base
|
||||
)
|
||||
|
||||
find_package(PkgConfig REQUIRED)
|
||||
pkg_check_modules(DESKTOP_APP_X11 REQUIRED x11)
|
||||
|
||||
target_include_directories(external_qt_static_plugins_hime_im_client SYSTEM
|
||||
PRIVATE
|
||||
${DESKTOP_APP_X11_INCLUDE_DIRS}
|
||||
)
|
||||
179
cmake/external/qt/qt_static_plugins/hime/hime_im_client/hime_im_client_helper.cpp
vendored
Normal file
179
cmake/external/qt/qt_static_plugins/hime/hime_im_client/hime_im_client_helper.cpp
vendored
Normal file
@@ -0,0 +1,179 @@
|
||||
// This file is part of Desktop App Toolkit,
|
||||
// a set of libraries for developing nice desktop applications.
|
||||
//
|
||||
// For license and copyright information please follow this link:
|
||||
// https://github.com/desktop-app/legal/blob/master/LEGAL
|
||||
//
|
||||
#include "base/platform/linux/base_linux_library.h"
|
||||
|
||||
#include <X11/Xlib.h>
|
||||
#include <hime-im-client.h>
|
||||
|
||||
namespace HimeHelper {
|
||||
namespace {
|
||||
|
||||
void (*hime_im_client_close)(HIME_client_handle *handle);
|
||||
void (*hime_im_client_focus_in)(HIME_client_handle *handle);
|
||||
void (*hime_im_client_focus_out)(HIME_client_handle *handle);
|
||||
void (*hime_im_client_focus_out2)(HIME_client_handle *handle, char **rstr);
|
||||
int (*hime_im_client_forward_key_press)(
|
||||
HIME_client_handle *handle,
|
||||
const KeySym key,
|
||||
const uint32_t state,
|
||||
char **rstr);
|
||||
int (*hime_im_client_forward_key_release)(
|
||||
HIME_client_handle *handle,
|
||||
const KeySym key,
|
||||
const uint32_t state,
|
||||
char **rstr);
|
||||
int (*hime_im_client_get_preedit)(
|
||||
HIME_client_handle *handle,
|
||||
char **str,
|
||||
HIME_PREEDIT_ATTR att[],
|
||||
int *cursor,
|
||||
int *sub_comp_len);
|
||||
HIME_client_handle *(*hime_im_client_open)(Display *display);
|
||||
void (*hime_im_client_reset)(HIME_client_handle *handle);
|
||||
void (*hime_im_client_set_cursor_location)(
|
||||
HIME_client_handle *handle,
|
||||
const int x,
|
||||
const int y);
|
||||
void (*hime_im_client_set_flags)(
|
||||
HIME_client_handle *handle,
|
||||
const int flags,
|
||||
int *ret_flags);
|
||||
void (*hime_im_client_set_client_window)(
|
||||
HIME_client_handle *handle,
|
||||
const Window win);
|
||||
void (*hime_im_client_set_window)(HIME_client_handle *handle, Window win);
|
||||
|
||||
bool Resolve() {
|
||||
static const auto loaded = [&] {
|
||||
const auto lib = base::Platform::LoadLibrary(
|
||||
"libhime-im-client.so.1",
|
||||
RTLD_NODELETE);
|
||||
return lib
|
||||
&& LOAD_LIBRARY_SYMBOL(lib, hime_im_client_close)
|
||||
&& LOAD_LIBRARY_SYMBOL(lib, hime_im_client_focus_in)
|
||||
&& LOAD_LIBRARY_SYMBOL(lib, hime_im_client_focus_out)
|
||||
&& LOAD_LIBRARY_SYMBOL(lib, hime_im_client_focus_out2)
|
||||
&& LOAD_LIBRARY_SYMBOL(lib, hime_im_client_forward_key_press)
|
||||
&& LOAD_LIBRARY_SYMBOL(lib, hime_im_client_forward_key_release)
|
||||
&& LOAD_LIBRARY_SYMBOL(lib, hime_im_client_get_preedit)
|
||||
&& LOAD_LIBRARY_SYMBOL(lib, hime_im_client_open)
|
||||
&& LOAD_LIBRARY_SYMBOL(lib, hime_im_client_reset)
|
||||
&& LOAD_LIBRARY_SYMBOL(lib, hime_im_client_set_cursor_location)
|
||||
&& LOAD_LIBRARY_SYMBOL(lib, hime_im_client_set_flags)
|
||||
&& (LOAD_LIBRARY_SYMBOL(lib, hime_im_client_set_client_window)
|
||||
|| LOAD_LIBRARY_SYMBOL(lib, hime_im_client_set_window));
|
||||
}();
|
||||
return loaded;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
} // namespace HimeHelper
|
||||
|
||||
void hime_im_client_close(HIME_client_handle *handle) {
|
||||
HimeHelper::Resolve();
|
||||
HimeHelper::hime_im_client_close(handle);
|
||||
}
|
||||
|
||||
void hime_im_client_focus_in(HIME_client_handle *handle) {
|
||||
HimeHelper::Resolve();
|
||||
HimeHelper::hime_im_client_focus_in(handle);
|
||||
}
|
||||
|
||||
void hime_im_client_focus_out(HIME_client_handle *handle) {
|
||||
HimeHelper::Resolve();
|
||||
HimeHelper::hime_im_client_focus_out(handle);
|
||||
}
|
||||
|
||||
void hime_im_client_focus_out2(HIME_client_handle *handle, char **rstr) {
|
||||
HimeHelper::Resolve();
|
||||
HimeHelper::hime_im_client_focus_out2(handle, rstr);
|
||||
}
|
||||
|
||||
int hime_im_client_forward_key_press(
|
||||
HIME_client_handle *handle,
|
||||
const KeySym key,
|
||||
const uint32_t state,
|
||||
char **rstr) {
|
||||
HimeHelper::Resolve();
|
||||
return HimeHelper::hime_im_client_forward_key_press(
|
||||
handle,
|
||||
key,
|
||||
state,
|
||||
rstr);
|
||||
}
|
||||
|
||||
int hime_im_client_forward_key_release(
|
||||
HIME_client_handle *handle,
|
||||
const KeySym key,
|
||||
const uint32_t state,
|
||||
char **rstr) {
|
||||
HimeHelper::Resolve();
|
||||
return HimeHelper::hime_im_client_forward_key_release(
|
||||
handle,
|
||||
key,
|
||||
state,
|
||||
rstr);
|
||||
}
|
||||
|
||||
int hime_im_client_get_preedit(
|
||||
HIME_client_handle *handle,
|
||||
char **str,
|
||||
HIME_PREEDIT_ATTR att[],
|
||||
int *cursor,
|
||||
int *sub_comp_len) {
|
||||
HimeHelper::Resolve();
|
||||
return HimeHelper::hime_im_client_get_preedit(
|
||||
handle,
|
||||
str,
|
||||
att,
|
||||
cursor,
|
||||
sub_comp_len);
|
||||
}
|
||||
|
||||
HIME_client_handle *hime_im_client_open(Display *display) {
|
||||
HimeHelper::Resolve();
|
||||
return HimeHelper::hime_im_client_open(display);
|
||||
}
|
||||
|
||||
void hime_im_client_reset(HIME_client_handle *handle) {
|
||||
HimeHelper::Resolve();
|
||||
HimeHelper::hime_im_client_reset(handle);
|
||||
}
|
||||
|
||||
void hime_im_client_set_cursor_location(
|
||||
HIME_client_handle *handle,
|
||||
const int x,
|
||||
const int y) {
|
||||
HimeHelper::Resolve();
|
||||
HimeHelper::hime_im_client_set_cursor_location(
|
||||
handle,
|
||||
x,
|
||||
y);
|
||||
}
|
||||
|
||||
void hime_im_client_set_flags(
|
||||
HIME_client_handle *handle,
|
||||
const int flags,
|
||||
int *ret_flags) {
|
||||
HimeHelper::Resolve();
|
||||
HimeHelper::hime_im_client_set_flags(
|
||||
handle,
|
||||
flags,
|
||||
ret_flags);
|
||||
}
|
||||
|
||||
void hime_im_client_set_client_window(
|
||||
HIME_client_handle *handle,
|
||||
const Window win) {
|
||||
HimeHelper::Resolve();
|
||||
HimeHelper::hime_im_client_set_client_window(handle, win);
|
||||
}
|
||||
|
||||
void hime_im_client_set_window(HIME_client_handle *handle, Window win) {
|
||||
HimeHelper::Resolve();
|
||||
HimeHelper::hime_im_client_set_window(handle, win);
|
||||
}
|
||||
10
cmake/external/qt/qt_static_plugins/hime/init.cpp
vendored
Normal file
10
cmake/external/qt/qt_static_plugins/hime/init.cpp
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
/*
|
||||
This file is part of Desktop App Toolkit,
|
||||
a set of libraries for developing nice desktop applications.
|
||||
|
||||
For license and copyright information please follow this link:
|
||||
https://github.com/desktop-app/legal/blob/master/LEGAL
|
||||
*/
|
||||
#include <QtCore/QtPlugin>
|
||||
|
||||
Q_IMPORT_PLUGIN(QHimePlatformInputContextPlugin)
|
||||
155
cmake/external/qt/qt_static_plugins/kimageformats/CMakeLists.txt
vendored
Normal file
155
cmake/external/qt/qt_static_plugins/kimageformats/CMakeLists.txt
vendored
Normal file
@@ -0,0 +1,155 @@
|
||||
# This file is part of Desktop App Toolkit,
|
||||
# a set of libraries for developing nice desktop applications.
|
||||
#
|
||||
# For license and copyright information please follow this link:
|
||||
# https://github.com/desktop-app/legal/blob/master/LEGAL
|
||||
|
||||
add_library(external_qt_static_plugins_kimageformats STATIC)
|
||||
add_library(desktop-app::external_qt_static_plugins_kimageformats ALIAS external_qt_static_plugins_kimageformats)
|
||||
init_target(external_qt_static_plugins_kimageformats "(external)")
|
||||
|
||||
set(kimageformats_loc ${third_party_loc}/kimageformats)
|
||||
set(kimageformats_src ${kimageformats_loc}/src/imageformats)
|
||||
|
||||
set_target_properties(external_qt_static_plugins_kimageformats PROPERTIES AUTOMOC ON)
|
||||
|
||||
nice_target_sources(external_qt_static_plugins_kimageformats ${kimageformats_src}
|
||||
PRIVATE
|
||||
avif.cpp
|
||||
heif.cpp
|
||||
jxl.cpp
|
||||
qoi.cpp
|
||||
scanlineconverter.cpp
|
||||
)
|
||||
|
||||
target_compile_definitions(external_qt_static_plugins_kimageformats
|
||||
PRIVATE
|
||||
QT_STATICPLUGIN
|
||||
)
|
||||
|
||||
target_link_libraries(external_qt_static_plugins_kimageformats
|
||||
PRIVATE
|
||||
desktop-app::external_qt
|
||||
)
|
||||
|
||||
if (DESKTOP_APP_USE_PACKAGED OR LINUX)
|
||||
find_package(libavif QUIET)
|
||||
find_package(libheif QUIET)
|
||||
find_package(PkgConfig)
|
||||
if (PkgConfig_FOUND)
|
||||
if (NOT libavif_FOUND)
|
||||
pkg_check_modules(DESKTOP_APP_AVIF IMPORTED_TARGET libavif)
|
||||
endif()
|
||||
pkg_check_modules(DESKTOP_APP_JXL IMPORTED_TARGET libjxl libjxl_threads)
|
||||
endif()
|
||||
|
||||
if (NOT libavif_FOUND AND NOT DESKTOP_APP_AVIF_FOUND)
|
||||
remove_target_sources(external_qt_static_plugins_kimageformats ${kimageformats_src} avif.cpp)
|
||||
endif()
|
||||
|
||||
if (NOT libheif_FOUND)
|
||||
remove_target_sources(external_qt_static_plugins_kimageformats ${kimageformats_src} heif.cpp)
|
||||
endif()
|
||||
|
||||
if (NOT DESKTOP_APP_JXL_FOUND)
|
||||
remove_target_sources(external_qt_static_plugins_kimageformats ${kimageformats_src} jxl.cpp)
|
||||
endif()
|
||||
|
||||
target_link_libraries(external_qt_static_plugins_kimageformats
|
||||
PRIVATE
|
||||
$<TARGET_NAME_IF_EXISTS:avif>
|
||||
$<TARGET_NAME_IF_EXISTS:PkgConfig::DESKTOP_APP_AVIF>
|
||||
$<TARGET_NAME_IF_EXISTS:heif>
|
||||
$<TARGET_NAME_IF_EXISTS:PkgConfig::DESKTOP_APP_JXL>
|
||||
)
|
||||
elseif (WIN32)
|
||||
target_compile_definitions(external_qt_static_plugins_kimageformats
|
||||
PRIVATE
|
||||
JXL_STATIC_DEFINE
|
||||
JXL_THREADS_STATIC_DEFINE
|
||||
JXL_CMS_STATIC_DEFINE
|
||||
LIBHEIF_STATIC_BUILD
|
||||
)
|
||||
|
||||
target_include_directories(external_qt_static_plugins_kimageformats SYSTEM
|
||||
PRIVATE
|
||||
${libs_loc}/local/include
|
||||
)
|
||||
|
||||
target_link_libraries(external_qt_static_plugins_kimageformats
|
||||
PRIVATE
|
||||
${libs_loc}/libavif/$<IF:$<CONFIG:Debug>,Debug,Release>/avif.lib
|
||||
${libs_loc}/libheif/libheif/$<IF:$<CONFIG:Debug>,Debug,Release>/heif.lib
|
||||
${libs_loc}/libde265/libde265/$<IF:$<CONFIG:Debug>,Debug,Release>/libde265.lib
|
||||
${libs_loc}/dav1d/builddir-$<IF:$<CONFIG:Debug>,debug,release>/src/libdav1d.a
|
||||
${libs_loc}/libjxl/lib/$<IF:$<CONFIG:Debug>,Debug,Release>/jxl.lib
|
||||
${libs_loc}/libjxl/lib/$<IF:$<CONFIG:Debug>,Debug,Release>/jxl_cms.lib
|
||||
${libs_loc}/libjxl/lib/$<IF:$<CONFIG:Debug>,Debug,Release>/jxl_threads.lib
|
||||
${libs_loc}/libjxl/third_party/highway/$<IF:$<CONFIG:Debug>,Debug,Release>/hwy.lib
|
||||
${libs_loc}/libjxl/third_party/brotli/$<IF:$<CONFIG:Debug>,Debug,Release>/brotlidec.lib
|
||||
${libs_loc}/libjxl/third_party/brotli/$<IF:$<CONFIG:Debug>,Debug,Release>/brotlienc.lib
|
||||
${libs_loc}/libjxl/third_party/brotli/$<IF:$<CONFIG:Debug>,Debug,Release>/brotlicommon.lib
|
||||
)
|
||||
elseif (APPLE)
|
||||
target_compile_definitions(external_qt_static_plugins_kimageformats
|
||||
PRIVATE
|
||||
JXL_STATIC_DEFINE
|
||||
JXL_THREADS_STATIC_DEFINE
|
||||
JXL_CMS_STATIC_DEFINE
|
||||
LIBHEIF_STATIC_BUILD
|
||||
)
|
||||
|
||||
target_include_directories(external_qt_static_plugins_kimageformats SYSTEM
|
||||
PRIVATE
|
||||
${libs_loc}/local/include
|
||||
)
|
||||
target_link_libraries(external_qt_static_plugins_kimageformats
|
||||
PRIVATE
|
||||
${libs_loc}/local/lib/libavif.a
|
||||
${libs_loc}/local/lib/libheif.a
|
||||
${libs_loc}/local/lib/libde265.a
|
||||
${libs_loc}/local/lib/libdav1d.a
|
||||
${libs_loc}/local/lib/libjxl.a
|
||||
${libs_loc}/local/lib/libjxl_cms.a
|
||||
${libs_loc}/local/lib/libjxl_threads.a
|
||||
${libs_loc}/local/lib/libhwy.a
|
||||
${libs_loc}/local/lib/libbrotlidec.a
|
||||
${libs_loc}/local/lib/libbrotlienc.a
|
||||
${libs_loc}/local/lib/libbrotlicommon.a
|
||||
${libs_loc}/local/lib/liblcms2.a
|
||||
)
|
||||
endif()
|
||||
|
||||
add_library(external_qt_static_plugins_kimageformats_init OBJECT)
|
||||
add_library(desktop-app::external_qt_static_plugins_kimageformats_init ALIAS external_qt_static_plugins_kimageformats_init)
|
||||
init_target(external_qt_static_plugins_kimageformats_init "(external)")
|
||||
|
||||
nice_target_sources(external_qt_static_plugins_kimageformats_init ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
PRIVATE
|
||||
init.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(external_qt_static_plugins_kimageformats_init
|
||||
PRIVATE
|
||||
desktop-app::external_qt
|
||||
)
|
||||
|
||||
if (DESKTOP_APP_USE_PACKAGED OR LINUX)
|
||||
if (NOT libavif_FOUND AND NOT DESKTOP_APP_AVIF_FOUND)
|
||||
target_compile_definitions(external_qt_static_plugins_kimageformats_init PRIVATE QT_STATIC_PLUGINS_DISABLE_AVIF)
|
||||
endif()
|
||||
|
||||
if (NOT libheif_FOUND)
|
||||
target_compile_definitions(external_qt_static_plugins_kimageformats_init PRIVATE QT_STATIC_PLUGINS_DISABLE_HEIF)
|
||||
endif()
|
||||
|
||||
if (NOT DESKTOP_APP_JXL_FOUND)
|
||||
target_compile_definitions(external_qt_static_plugins_kimageformats_init PRIVATE QT_STATIC_PLUGINS_DISABLE_JXL)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
target_link_libraries(external_qt_static_plugins_kimageformats
|
||||
INTERFACE
|
||||
external_qt_static_plugins_kimageformats_init
|
||||
$<TARGET_OBJECTS:external_qt_static_plugins_kimageformats_init>
|
||||
)
|
||||
19
cmake/external/qt/qt_static_plugins/kimageformats/init.cpp
vendored
Normal file
19
cmake/external/qt/qt_static_plugins/kimageformats/init.cpp
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
/*
|
||||
This file is part of Desktop App Toolkit,
|
||||
a set of libraries for developing nice desktop applications.
|
||||
|
||||
For license and copyright information please follow this link:
|
||||
https://github.com/desktop-app/legal/blob/master/LEGAL
|
||||
*/
|
||||
#include <QtCore/QtPlugin>
|
||||
|
||||
#ifndef QT_STATIC_PLUGINS_DISABLE_AVIF
|
||||
Q_IMPORT_PLUGIN(QAVIFPlugin)
|
||||
#endif // !QT_STATIC_PLUGINS_DISABLE_AVIF
|
||||
#ifndef QT_STATIC_PLUGINS_DISABLE_HEIF
|
||||
Q_IMPORT_PLUGIN(HEIFPlugin)
|
||||
#endif // !QT_STATIC_PLUGINS_DISABLE_HEIF
|
||||
#ifndef QT_STATIC_PLUGINS_DISABLE_JXL
|
||||
Q_IMPORT_PLUGIN(QJpegXLPlugin)
|
||||
#endif // !QT_STATIC_PLUGINS_DISABLE_JXL
|
||||
Q_IMPORT_PLUGIN(QOIPlugin)
|
||||
64
cmake/external/qt/qt_static_plugins/nimf/CMakeLists.txt
vendored
Normal file
64
cmake/external/qt/qt_static_plugins/nimf/CMakeLists.txt
vendored
Normal file
@@ -0,0 +1,64 @@
|
||||
# This file is part of Desktop App Toolkit,
|
||||
# a set of libraries for developing nice desktop applications.
|
||||
#
|
||||
# For license and copyright information please follow this link:
|
||||
# https://github.com/desktop-app/legal/blob/master/LEGAL
|
||||
|
||||
add_library(external_qt_static_plugins_nimf STATIC)
|
||||
add_library(desktop-app::external_qt_static_plugins_nimf ALIAS external_qt_static_plugins_nimf)
|
||||
init_target(external_qt_static_plugins_nimf "(external)")
|
||||
|
||||
set(nimf_loc ${third_party_loc}/nimf)
|
||||
set(libnimf_src ${nimf_loc}/libnimf)
|
||||
set(nimf_qt5_src ${nimf_loc}/modules/clients/qt5)
|
||||
|
||||
set_target_properties(external_qt_static_plugins_nimf PROPERTIES AUTOMOC ON)
|
||||
|
||||
nice_target_sources(external_qt_static_plugins_nimf ${nimf_qt5_src}
|
||||
PRIVATE
|
||||
im-nimf-qt5.cpp
|
||||
)
|
||||
|
||||
find_package(PkgConfig REQUIRED)
|
||||
pkg_check_modules(DESKTOP_APP_GIO REQUIRED gio-2.0)
|
||||
|
||||
target_include_directories(external_qt_static_plugins_nimf
|
||||
PRIVATE
|
||||
${nimf_qt5_src}
|
||||
${libnimf_src}
|
||||
${DESKTOP_APP_GIO_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
target_compile_definitions(external_qt_static_plugins_nimf
|
||||
PRIVATE
|
||||
QT_STATICPLUGIN
|
||||
QT_NO_KEYWORDS
|
||||
G_LOG_DOMAIN="nimf"
|
||||
NIMF_COMPILATION
|
||||
USE_DLFCN
|
||||
)
|
||||
|
||||
target_link_libraries(external_qt_static_plugins_nimf
|
||||
PRIVATE
|
||||
desktop-app::external_qt
|
||||
)
|
||||
|
||||
add_library(external_qt_static_plugins_nimf_init OBJECT)
|
||||
add_library(desktop-app::external_qt_static_plugins_nimf_init ALIAS external_qt_static_plugins_nimf_init)
|
||||
init_target(external_qt_static_plugins_nimf_init "(external)")
|
||||
|
||||
nice_target_sources(external_qt_static_plugins_nimf_init ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
PRIVATE
|
||||
init.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(external_qt_static_plugins_nimf_init
|
||||
PRIVATE
|
||||
desktop-app::external_qt
|
||||
)
|
||||
|
||||
target_link_libraries(external_qt_static_plugins_nimf
|
||||
INTERFACE
|
||||
external_qt_static_plugins_nimf_init
|
||||
$<TARGET_OBJECTS:external_qt_static_plugins_nimf_init>
|
||||
)
|
||||
10
cmake/external/qt/qt_static_plugins/nimf/init.cpp
vendored
Normal file
10
cmake/external/qt/qt_static_plugins/nimf/init.cpp
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
/*
|
||||
This file is part of Desktop App Toolkit,
|
||||
a set of libraries for developing nice desktop applications.
|
||||
|
||||
For license and copyright information please follow this link:
|
||||
https://github.com/desktop-app/legal/blob/master/LEGAL
|
||||
*/
|
||||
#include <QtCore/QtPlugin>
|
||||
|
||||
Q_IMPORT_PLUGIN(NimfInputContextPlugin)
|
||||
16
cmake/external/qt/qt_static_plugins/qt_static_plugins.cpp
vendored
Normal file
16
cmake/external/qt/qt_static_plugins/qt_static_plugins.cpp
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
/*
|
||||
This file is part of Desktop App Toolkit,
|
||||
a set of libraries for developing nice desktop applications.
|
||||
|
||||
For license and copyright information please follow this link:
|
||||
https://github.com/desktop-app/legal/blob/master/LEGAL
|
||||
*/
|
||||
#include <QtCore/QtPlugin>
|
||||
|
||||
#if !defined QT_STATIC_PLUGINS_USE_PACKAGED && QT_VERSION < QT_VERSION_CHECK(6, 0, 0) && defined Q_OS_WIN
|
||||
Q_IMPORT_PLUGIN(QGenericEnginePlugin)
|
||||
Q_IMPORT_PLUGIN(QWebpPlugin)
|
||||
Q_IMPORT_PLUGIN(QJpegPlugin)
|
||||
Q_IMPORT_PLUGIN(QGifPlugin)
|
||||
Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin)
|
||||
#endif // !QT_STATIC_PLUGINS_USE_PACKAGED && Qt < 6.0.0 && Q_OS_WIN
|
||||
Reference in New Issue
Block a user