aboutsummaryrefslogtreecommitdiff
path: root/cmake_uninstall.cmake.in
diff options
context:
space:
mode:
authortrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2008-06-15 19:12:19 +0000
committertrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2008-06-15 19:12:19 +0000
commit0856046be26d3b417f8d3d1dc2c248e78009ac68 (patch)
tree830e5d6cff5e710f9999679fab84ffaf84df6663 /cmake_uninstall.cmake.in
parent82f861f1b6d8e86ed44b8512de6f9924cc7f2cb5 (diff)
downloadqmmp-0856046be26d3b417f8d3d1dc2c248e78009ac68.tar.gz
qmmp-0856046be26d3b417f8d3d1dc2c248e78009ac68.tar.bz2
qmmp-0856046be26d3b417f8d3d1dc2c248e78009ac68.zip
added uninstall target for cmake
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@421 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'cmake_uninstall.cmake.in')
-rw-r--r--cmake_uninstall.cmake.in21
1 files changed, 21 insertions, 0 deletions
diff --git a/cmake_uninstall.cmake.in b/cmake_uninstall.cmake.in
new file mode 100644
index 000000000..df95fb9d8
--- /dev/null
+++ b/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 "\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(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)