[X2Go-Commits] [x2goplasmabindings] 04/04: CMakeLists.txt: create metadata.desktop via a custom target with the ALL option enabled and BYPRODUCTS set correctly, so that the clean target automatically removes it as well.

git-admin at x2go.org git-admin at x2go.org
Fri Aug 11 23:24:15 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 e638a43e06dc3ddb6c8117fbe8fa9d62733ea5b6
Author: Mihai Moldovan <ionic at ionic.de>
Date:   Fri Aug 11 23:22:55 2023 +0200

    CMakeLists.txt: create metadata.desktop via a custom target with the ALL option enabled and BYPRODUCTS set correctly, so that the clean target automatically removes it as well.
    
    Only do that if actually requested, though.
---
 CMakeLists.txt   | 27 ++++++++++-----------------
 debian/changelog |  4 ++++
 2 files changed, 14 insertions(+), 17 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index f66e72a..74e3e03 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -207,24 +207,17 @@ if (USE_PLASMA5)
 		endif (NOT BUILD_SHARED_LIBS)
 	endif (HAVE_ECMQMLMODULE)
 
-	add_custom_target (CopyDesktopFile)
-	add_custom_command (
-		TARGET CopyDesktopFile
-		POST_BUILD
-		COMMAND ${CMAKE_COMMAND} -E copy
-		"${CMAKE_SOURCE_DIR}/plasma-applet-org.x2go.plasmoid.desktop"
-		"${CMAKE_SOURCE_DIR}/package/metadata.desktop"
-	)
-	add_custom_target (CleanDesktopFile)
-	add_custom_command (
-		TARGET CleanDesktopFile
-		PRE_BUILD
-		COMMAND ${CMAKE_COMMAND} -E remove
-		"${CMAKE_SOURCE_DIR}/package/metadata.desktop"
-	)
 	if (USE_DESKTOP_FILE)
-		add_dependencies (ALL CopyDesktopFile)
-		add_dependencies (CLEAN CleanDesktopFile)
+		add_custom_target (
+			CopyDesktopFile
+			ALL
+			BYPRODUCTS "${CMAKE_SOURCE_DIR}/package/metadata.desktop"
+			COMMENT "Copying plasma-applet-org.x2go.plasmoid.desktop to package/metadata.desktop."
+			COMMAND ${CMAKE_COMMAND} -E copy
+			"${CMAKE_SOURCE_DIR}/plasma-applet-org.x2go.plasmoid.desktop"
+			"${CMAKE_SOURCE_DIR}/package/metadata.desktop"
+			VERBATIM
+		)
 	endif (USE_DESKTOP_FILE)
 else (USE_PLASMA5)
 	kde4_add_plugin(
diff --git a/debian/changelog b/debian/changelog
index 2ae2bf5..65a45c9 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -43,6 +43,10 @@ x2goplasmabindings (3.0.2.3-0x2go1) UNRELEASED; urgency=medium
       Qt-6-compatibility.
     - x2goplasmoidkf5.cpp: try to fix code to work with Qt 5.11 and C++11
       lambdas for qmlRegisterSingletonType ().
+    - CMakeLists.txt: create metadata.desktop via a custom target with the ALL
+      option enabled and BYPRODUCTS set correctly, so that the clean target
+      automatically removes it as well. Only do that if actually requested,
+      though.
   * x2goplasmabindings.spec:
     + Prepare for Plasma 5 support.
     + Stop duplicating Group tag.

--
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