summaryrefslogtreecommitdiffstatsci
path: root/CMakeScripts
diff options
context:
space:
mode:
authorBryce Harrington <b.harrington@samsung.com>2013-11-20 10:31:07 -0800
committerBryce Harrington <b.harrington@samsung.com>2013-11-20 18:33:33 -0800
commit65f82c82751bbc7871229a4d6654a060874f4e46 (patch)
tree8f910446a637c16763baa5b0ed6e30925621c41f /CMakeScripts
parentb9db24e6f43a6746a66811f476e420191b85d56f (diff)
Add make uninstall
(Note that make install hasn't been implemented yet, and so this is untested.)
Diffstat (limited to 'CMakeScripts')
-rw-r--r--CMakeScripts/cmake_uninstall.cmake.in21
1 files changed, 21 insertions, 0 deletions
diff --git a/CMakeScripts/cmake_uninstall.cmake.in b/CMakeScripts/cmake_uninstall.cmake.in
new file mode 100644
index 0000000..b99d7e0
--- /dev/null
+++ b/CMakeScripts/cmake_uninstall.cmake.in
@@ -0,0 +1,21 @@
+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(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
+
+FILE(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files)
+STRING(REGEX REPLACE " " ";" 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(NOT "${rm_retval}" STREQUAL 0)
+ MESSAGE(FATAL_ERROR "Problem when removing "$ENV{DESTDIR}${file}"")
+ ENDIF(NOT "${rm_retval}" STREQUAL 0)
+ ELSE(EXISTS "$ENV{DESTDIR}${file}")
+ MESSAGE(STATUS "File "$ENV{DESTDIR}${file}" does not exist.")
+ ENDIF(EXISTS "$ENV{DESTDIR}${file}")
+ENDFOREACH(file)