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

noreply at xfce.org noreply at xfce.org
Mon Feb 16 23:53:03 CET 2015


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

gottcode pushed a commit to branch master
in repository panel-plugins/xfce4-whiskermenu-plugin.

commit 5d33c1a639d8b7db62a02fd0ad2ac1649a951fe6
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 d4d6a98..d41841d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -12,3 +12,11 @@ add_subdirectory(icons)
 configure_file(${PROJECT_SOURCE_DIR}/xfce4-popup-whiskermenu.in
     ${PROJECT_BINARY_DIR}/xfce4-popup-whiskermenu ESCAPE_QUOTES @ONLY)
 install(PROGRAMS ${PROJECT_BINARY_DIR}/xfce4-popup-whiskermenu DESTINATION ${CMAKE_INSTALL_BINDIR})
+
+# 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