summaryrefslogtreecommitdiff
path: root/CMake/cmake_uninstall.cmake.in
diff options
context:
space:
mode:
authorIain R. Learmonth <irl@debian.org>2015-10-18 18:51:00 +0100
committerIain R. Learmonth <irl@debian.org>2015-10-18 18:51:00 +0100
commitd63dd8d081a6fcd0715cd13f26df59fb831769d2 (patch)
treeb9c1f6245147a310aac3762630bad389bbb57335 /CMake/cmake_uninstall.cmake.in
parentc720a3d55c5ec832c29cb7ce50b6fb4b70c55b11 (diff)
Imported Upstream version 1.5.0upstream/1.5.0
Diffstat (limited to 'CMake/cmake_uninstall.cmake.in')
-rw-r--r--CMake/cmake_uninstall.cmake.in22
1 files changed, 22 insertions, 0 deletions
diff --git a/CMake/cmake_uninstall.cmake.in b/CMake/cmake_uninstall.cmake.in
new file mode 100644
index 00000000..23b3064a
--- /dev/null
+++ b/CMake/cmake_uninstall.cmake.in
@@ -0,0 +1,22 @@
+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}")
+foreach (file ${files})
+ message (STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"")
+ if (EXISTS "$ENV{DESTDIR}${file}")
+ exec_program (
+ "@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\""
+ OUTPUT_VARIABLE rm_out
+ RETURN_VALUE rm_retval
+ )
+ if ("${rm_retval}" STREQUAL 0)
+ else ()
+ message (FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"")
+ endif ()
+ else ()
+ message (STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.")
+ endif ()
+endforeach ()