Skip to content

Commit

Permalink
sync: from linuxdeepin/qt5integration
Browse files Browse the repository at this point in the history
Synchronize source files from linuxdeepin/qt5integration.

Source-pull-request: linuxdeepin/qt5integration#224
  • Loading branch information
deepin-ci-robot committed Jun 18, 2024
1 parent 4eeb8f4 commit 63140d2
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
21 changes: 16 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,23 @@ function(dtk_add_plugin)
endfunction()

find_package(Dtk${VERSION_SUFFIX} REQUIRED COMPONENTS Widget)
cmake_dependent_option(ENABLE_QT_XDG_ICON_LOADER "Enable QtXdgIconLoader" ON "QT_VERSION_MAJOR EQUAL 5" OFF)

option(ENABLE_QT_XDG_ICON_LOADER "Enable QtXdgIconLoader" ON)
find_package(Qt${QT_VERSION_MAJOR}XdgIconLoader)
find_package(Qt${QT_VERSION_MAJOR}Xdg REQUIRED)
if (NOT Qt${QT_VERSION_MAJOR}XdgIconLoader_FOUND)
message(WARNING " Qt${QT_VERSION_MAJOR}XdgIconLoader Not Found, DISABLE QtXdgIconLoader !")
set (ENABLE_QT_XDG_ICON_LOADER OFF)
endif()

if(ENABLE_QT_XDG_ICON_LOADER)
find_package(Qt5XdgIconLoader REQUIRED)
find_package(Qt5Xdg REQUIRED)
set(QT_XDG_ICON_DEPS Qt5XdgIconLoader Qt5Xdg)
set(XDG_ICON_VERSION_MAJOR ${Qt5XdgIconLoader_VERSION_MAJOR})
set(QT_XDG_ICON_DEPS Qt${QT_VERSION_MAJOR}XdgIconLoader Qt${QT_VERSION_MAJOR}Xdg)

if("${QT_VERSION_MAJOR}" STREQUAL "5")
set(XDG_ICON_VERSION_MAJOR ${Qt5XdgIconLoader_VERSION_MAJOR})
elseif("${QT_VERSION_MAJOR}" STREQUAL "6")
set(XDG_ICON_VERSION_MAJOR ${Qt6XdgIconLoader_VERSION_MAJOR})
endif()
endif()

set(PLUGIN_OUTPUT_BASE_DIR ${CMAKE_BINARY_DIR}/plugins CACHE STRING "Plugin output base path")
Expand Down
4 changes: 3 additions & 1 deletion platformthemeplugin/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS DBus Widgets)
set(QT_LIBS Qt${QT_VERSION_MAJOR}::DBus Qt${QT_VERSION_MAJOR}::Widgets)
if(QT_VERSION_MAJOR EQUAL 5)
find_package(Qt5X11Extras REQUIRED)
list(APPEND QT_LIBS Qt5::X11Extras ${QT_XDG_ICON_DEPS})
list(APPEND QT_LIBS Qt5::X11Extras)
if(QT_VERSION_MINOR GREATER_EQUAL 8) # Qt5.8
find_package(Qt5ThemeSupport REQUIRED)
list(APPEND QT_LIBS Qt5::ThemeSupportPrivate)
Expand All @@ -26,10 +26,12 @@ if(QT_VERSION_MAJOR EQUAL 5)
else()
list(APPEND QT_LIBS Qt6::GuiPrivate)
endif()

find_package(PkgConfig REQUIRED)
pkg_check_modules(Deps REQUIRED IMPORTED_TARGET mtdev x11)
if(ENABLE_QT_XDG_ICON_LOADER)
set(DEFS -DXDG_ICON_VERSION_MAR=${XDG_ICON_VERSION_MAJOR})
list(APPEND QT_LIBS ${QT_XDG_ICON_DEPS})
endif()
if(QT_VERSION_MAJOR EQUAL 5)
qt5_add_dbus_interface(DBUS_INTERFACES ${CMAKE_CURRENT_LIST_DIR}/xmls/com.deepin.filemanager.filedialog.xml filedialog_interface)
Expand Down

0 comments on commit 63140d2

Please sign in to comment.