[Xfce4-commits] [panel-plugins/xfce4-whiskermenu-plugin] 09/28: Add uninstall target.

noreply at xfce.org noreply at xfce.org
Sat Aug 20 18:33:05 CEST 2016


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

gottcode pushed a commit to annotated tag v1.0.1
in repository panel-plugins/xfce4-whiskermenu-plugin.

commit b52b303c2763ccdab756115d057bf229289278a0
Author: Graeme Gott <graeme at gottcode.org>
Date:   Sun Jun 23 17:32:13 2013 -0400

    Add uninstall target.
---
 CMakeLists.txt           |  8 ++++++++
 cmake/uninstall.cmake.in | 24 ++++++++++++++++++++++++
 2 files changed, 32 insertions(+)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 98b43ca..64e69a7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -34,3 +34,11 @@ endif()
 add_subdirectory(src)
 add_subdirectory(po)
 add_subdirectory(icons)
+
+# uninstall target
+configure_file(
+    ${CMAKE_CURRENT_SOURCE_DIR}/cmake/uninstall.cmake.in
+    ${CMAKE_CURRENT_BINARY_DIR}/cmake/uninstall.cmake
+    IMMEDIATE @ONLY)
+add_custom_target(uninstall
+    ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake/uninstall.cmake)
diff --git a/cmake/uninstall.cmake.in b/cmake/uninstall.cmake.in
new file mode 100644
index 0000000..d82e592
--- /dev/null
+++ b/cmake/uninstall.cmake.in
@@ -0,0 +1,24 @@
+message("Uninstall the project...")
+
+if(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
+    message(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt\"")
+endif()
+
+file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files)
+string(REGEX REPLACE "\n" ";" files "${files}")
+list(REVERSE files)
+foreach (file ${files})
+    message(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"")
+    if(EXISTS "$ENV{DESTDIR}${file}")
+        execute_process(
+            COMMAND @CMAKE_COMMAND@ -E remove "$ENV{DESTDIR}${file}"
+            OUTPUT_VARIABLE rm_out
+            RESULT_VARIABLE rm_retval
+        )
+        if(NOT ${rm_retval} EQUAL 0)
+            message(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"")
+        endif (NOT ${rm_retval} EQUAL 0)
+    else(EXISTS "$ENV{DESTDIR}${file}")
+        message(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.")
+    endif()
+endforeach(file)

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list