[X2Go-Commits] [x2goplasmabindings] 03/07: CMakeLists.txt: add support for Plasma 5, rename plasmoid to org.x2go.plasmoid where applicable.

git-admin at x2go.org git-admin at x2go.org
Thu Apr 27 22:55:25 CEST 2023


This is an automated email from the git hooks/post-receive script.

x2go pushed a commit to branch master
in repository x2goplasmabindings.

commit 63dc288b3e61a799559b1e675f73e1fa3336e498
Author: Mihai Moldovan <ionic at ionic.de>
Date:   Thu Apr 27 21:30:00 2023 +0200

    CMakeLists.txt: add support for Plasma 5, rename plasmoid to org.x2go.plasmoid where applicable.
---
 CMakeLists.txt   | 89 +++++++++++++++++++++++++++++++++++++++++++++++---------
 debian/changelog |  2 ++
 2 files changed, 78 insertions(+), 13 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 87acf0a..c7538ba 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,24 +1,58 @@
 # Project Needs a name ofcourse
-project(plasma-applet-x2goplasmoid)
-
+project(plasma-applet-org.x2go.plasmoid)
 
+option(USE_PLASMA5 "Build against KDE Plasma 5" OFF)
 
 # Find the required Libaries
-find_package(
-	KDE4 REQUIRED
+if (USE_PLASMA5)
+	find_package (
+		ECM REQUIRED NO_MODULE
+	)
+	set (CMAKE_MODULE_PATH "${ECM_MODULE_PATH}")
+
+	include (KDEInstallDirs)
+	include (KDECMakeSettings)
+	include (KDECompilerSettings NO_POLICY_SCOPE)
+	include (FeatureSummary)
+
+	find_package (
+		KF5 REQUIRED COMPONENTS
+			Plasma
+			I18n
+	)
+
+	find_package (
+		QT5 CONFIG REQUIRED COMPONENTS
+			Quick
+			Core
+	)
+
+	feature_summary (WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
+else (USE_PLASMA5)
+	find_package(
+		KDE4 REQUIRED
+	)
+	include(KDE4Defaults)
+endif (USE_PLASMA5)
+
+add_definitions (
+	-DTRANSLATION_DOMAIN=\"plasma_applet_org.x2go.plasmoid\"
 )
-include(KDE4Defaults)
 
+include_directories(
+	${CMAKE_SOURCE_DIR}
+	${CMAKE_BINARY_DIR}
+)
 
+if (NOT USE_PLASMA5)
 add_definitions (
 	${QT_DEFINITIONS}
 	${KDE4_DEFINITIONS}
 )
 include_directories(
-	${CMAKE_SOURCE_DIR}
-	${CMAKE_BINARY_DIR}
 	${KDE4_INCLUDES}
 )
+endif (NOT USE_PLASMA5)
 
 find_file(HAVE_PLASMA_SEPARATOR separator.h ${KDE4_INCLUDES}/plasma/widgets)
 
@@ -34,32 +68,61 @@ set(
 )
  
 # Now make sure all files get to the right place
+if (USE_PLASMA5)
+	add_library (
+		org.x2go.plasmoid MODULE
+		${x2goplasmoid_SRCS}
+	)
+	set_target_properties (
+		org.x2go.plasmoid
+		PROPERTIES PREFIX ""
+	)
+	target_link_libraries (
+		org.x2go.plasmoid
+		Qt5::Gui
+		KF5::Plasma
+		KF5::I18n
+	)
+else (USE_PLASMA5)
 kde4_add_plugin(
-	plasma_applet_x2goplasmoid 
+	org.x2go.plasmoid
 	${x2goplasmoid_SRCS}
 )
 target_link_libraries(
-	plasma_applet_x2goplasmoid
+	org.x2go.plasmoid
 	${KDE4_PLASMA_LIBS}
 	${KDE4_KDEUI_LIBS}
 )
-
+endif (USE_PLASMA5)
 
 
 add_subdirectory(
 	po
 )
 
+if (USE_PLASMA5)
+ecm_install_icons (
+	${ICON_INSTALL_DIR}
+)
+
+plasma_install_package (
+	"package"
+	"org.x2go.plasmoid"
+	"plasmoids"
+	"applet"
+)
+else (USE_PLASMA5)
 kde4_install_icons(
 	${ICON_INSTALL_DIR}
 )
- 
+
 install(
-	TARGETS plasma_applet_x2goplasmoid
+	TARGETS org.x2go.plasmoid
 	DESTINATION ${PLUGIN_INSTALL_DIR}
 )
  
 install(
-	FILES plasma-applet-x2goplasmoid.desktop
+	FILES org.x2go.plasmoid.desktop
 	DESTINATION ${SERVICES_INSTALL_DIR}
 )
+endif (USE_PLASMA5)
diff --git a/debian/changelog b/debian/changelog
index 6275f38..67ab1b3 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -4,6 +4,8 @@ x2goplasmabindings (3.0.2.3-0x2go1) UNRELEASED; urgency=medium
   * New upstream version (3.0.2.3):
     - x2goplasmabindings.spec: prepare for Plasma 5 support.
     - po/CMakeLists.txt: add reverse domain name notation to catalog name.
+    - CMakeLists.txt: add support for Plasma 5, rename plasmoid to
+      org.x2go.plasmoid where applicable.
 
  -- X2Go Release Manager <git-admin at x2go.org>  Thu, 22 Nov 2018 00:21:33 +0100
 

--
Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/x2goplasmabindings.git


More information about the x2go-commits mailing list