Permalink
Browse files

Added uninstall target

  • Loading branch information...
1 parent c71c6e4 commit 67e8fce171c22e62831a2bf5b42e4a76328cd548 @sahib committed Aug 29, 2011
Showing with 23 additions and 0 deletions.
  1. +23 −0 cmake_uninstall.cmake
View
@@ -0,0 +1,23 @@
+cmake_policy(SET CMP0007 OLD)
+if (NOT EXISTS "/home/chris/glyr_doc/glyr/install_manifest.txt")
+ message(FATAL_ERROR "Cannot find install manifest: \"/home/chris/glyr_doc/glyr/install_manifest.txt\"")
+endif(NOT EXISTS "/home/chris/glyr_doc/glyr/install_manifest.txt")
+
+file(READ "/home/chris/glyr_doc/glyr/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 /usr/bin/cmake -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 (EXISTS "$ENV{DESTDIR}${file}")
+endforeach(file)

0 comments on commit 67e8fce

Please sign in to comment.