Skip to content

Commit 0b05cca

Browse files
committed
Port to CMake
1 parent e2c7ce1 commit 0b05cca

26 files changed

+149
-99
lines changed

CMakeLists.txt

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
project(QGnomePlatform)
2+
3+
cmake_minimum_required(VERSION 3.0)
4+
5+
set(QGNOMEPLATFORM_VERSION "0.7.50")
6+
7+
set(QT_MIN_VERSION "5.12.0")
8+
set(CMAKE_AUTOMOC ON)
9+
10+
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules" ${CMAKE_MODULE_PATH})
11+
12+
include(GNUInstallDirs)
13+
include(FeatureSummary)
14+
15+
add_definitions(-std=c++11)
16+
17+
find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED Core DBus Gui Widgets)
18+
find_package(Qt5Gui ${QT_MIN_VERSION} CONFIG REQUIRED Private)
19+
20+
find_package(Qt5ThemeSupport REQUIRED)
21+
22+
find_package(GSettingSchemas REQUIRED)
23+
find_package(AdwaitaQt "1.2.50" REQUIRED)
24+
25+
find_package(PkgConfig REQUIRED)
26+
pkg_check_modules(GTK+3 REQUIRED IMPORTED_TARGET gtk+-3.0)
27+
28+
# NOTE: there is no reason to disable any of the following options, but
29+
# it is useful when building Flatpak extensions
30+
if (DISABLE_DECORATION_SUPPORT)
31+
message(STATUS "Disabling Qt Wayland decoration support")
32+
else()
33+
find_package(Qt5WaylandClient ${QT_MIN_VERSION} CONFIG REQUIRED)
34+
set_package_properties(Qt5WaylandClient PROPERTIES
35+
DESCRIPTION "Qt Wayland decoration support"
36+
PURPOSE "Required for QGnomePlatform decoration plugin"
37+
TYPE REQUIRED
38+
)
39+
# NOTE: I don't know how to do this only in case of qt_config(xkbcommon).
40+
# We would miss an include in QWaylandDisplay header file.
41+
find_package(Qt5XkbCommonSupport ${QT_MIN_VERSION})
42+
endif()
43+
44+
if (DISABLE_THEME_SUPPORT)
45+
message(STATUS "Disabling platform theme support")
46+
endif()
47+
48+
49+
add_subdirectory(src)
50+
51+
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)
52+
+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
find_package(PkgConfig)
2+
3+
pkg_check_modules(PC_GLIB2 REQUIRED glib-2.0)
4+
5+
find_path(GLIB_SCHEMAS_DIR org.gnome.desktop.interface.gschema.xml
6+
HINTS ${PC_GLIB2_PREFIX}/share
7+
PATH_SUFFIXES glib-2.0/schemas)
8+
9+
if (GLIB_SCHEMAS_DIR)
10+
set(GSettingSchemas_FOUND true)
11+
else()
12+
set(GSettingSchemas_FOUND false)
13+
endif()
14+
15+
include(FindPackageHandleStandardArgs)
16+
find_package_handle_standard_args(GSettingSchemas
17+
FOUND_VAR
18+
GSettingSchemas_FOUND
19+
REQUIRED_VARS
20+
GSettingSchemas_FOUND
21+
)
22+
23+
mark_as_advanced(GSettingSchemas_FOUND)

common/common.pro

-24
This file was deleted.

decoration/decoration.pro

-32
This file was deleted.

qgnomeplatform.pro

-11
This file was deleted.

src/CMakeLists.txt

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
add_subdirectory(common)
2+
3+
if (NOT DISABLE_DECORATION_SUPPORT)
4+
add_subdirectory(decoration)
5+
endif()
6+
7+
if (NOT DISABLE_THEME_SUPPORT)
8+
add_subdirectory(theme)
9+
endif()

src/common/CMakeLists.txt

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
2+
set(common_SRCS
3+
gnomehintssettings.cpp
4+
qgtk3dialoghelpers.cpp
5+
qxdgdesktopportalfiledialog.cpp
6+
)
7+
8+
add_library(qgnomeplatform-common STATIC ${common_SRCS})
9+
target_link_libraries(qgnomeplatform-common
10+
Qt::DBus
11+
Qt::Core
12+
Qt::GuiPrivate
13+
Qt::Widgets
14+
${ADWAITAQT_LIBRARIES}
15+
PkgConfig::GTK+3
16+
)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

src/decoration/CMakeLists.txt

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
2+
include_directories(
3+
${CMAKE_SOURCE_DIR}/src/common
4+
)
5+
6+
set(decoration_SRCS
7+
decorationplugin.cpp
8+
qgnomeplatformdecoration.cpp
9+
)
10+
11+
add_library(qgnomeplatformdecoration MODULE ${decoration_SRCS})
12+
target_link_libraries(qgnomeplatformdecoration
13+
qgnomeplatform-common
14+
Qt::Gui
15+
Qt::GuiPrivate
16+
Qt::WaylandClientPrivate
17+
${ADWAITAQT_LIBRARIES}
18+
PkgConfig::GTK+3
19+
)
20+
21+
if (${Qt5XkbCommonSupport_FOUND})
22+
target_link_libraries(qgnomeplatformdecoration
23+
Qt::XkbCommonSupportPrivate
24+
)
25+
endif()
26+
27+
install(TARGETS qgnomeplatformdecoration DESTINATION ${KDE_INSTALL_QTPLUGINDIR}/wayland-decoration-client)
28+
File renamed without changes.
File renamed without changes.

src/theme/CMakeLists.txt

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
2+
include_directories(
3+
${CMAKE_SOURCE_DIR}/src/common
4+
)
5+
6+
set(theme_SRCS
7+
platformplugin.cpp
8+
qgnomeplatformtheme.cpp
9+
)
10+
11+
add_library(qgnomeplatform MODULE ${theme_SRCS})
12+
target_link_libraries(qgnomeplatform
13+
qgnomeplatform-common
14+
Qt::Gui
15+
Qt::ThemeSupportPrivate
16+
${ADWAITAQT_LIBRARIES}
17+
)
18+
19+
install(TARGETS qgnomeplatform DESTINATION ${KDE_INSTALL_QTPLUGINDIR}/platformthemes)
20+
21+
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

theme/theme.pro

-32
This file was deleted.

0 commit comments

Comments
 (0)