Added uninstall target for Unix platforms.
authorRyan C. Gordon <icculus@icculus.org>
Tue, 02 Feb 2010 23:22:49 -0500
changeset 1041 f7b7996e54f1
parent 1040 5fc90d008821
child 1042 dc9291957a5a
Added uninstall target for Unix platforms.
CMakeLists.txt
extras/uninstall.sh
--- a/CMakeLists.txt	Tue Feb 02 23:04:28 2010 -0500
+++ b/CMakeLists.txt	Tue Feb 02 23:22:49 2010 -0500
@@ -521,7 +521,17 @@
 ENDIF(DOXYGEN_FOUND)
 
 IF(UNIX)
-    ADD_CUSTOM_TARGET(dist ./extras/makedist.sh ${PHYSFS_VERSION} COMMENT "Building source tarball")
+    ADD_CUSTOM_TARGET(
+        dist
+        ./extras/makedist.sh ${PHYSFS_VERSION}
+        COMMENT "Building source tarball..."
+    )
+    ADD_CUSTOM_TARGET(
+        uninstall
+        "${CMAKE_CURRENT_SOURCE_DIR}/extras/uninstall.sh"
+        WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
+        COMMENT "Uninstall the project..."
+    )
 ENDIF(UNIX)
 
 MACRO(MESSAGE_BOOL_OPTION _NAME _VALUE)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/uninstall.sh	Tue Feb 02 23:22:49 2010 -0500
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+if [ ! -f "./install_manifest.txt" ]; then
+    echo "ERROR: This needs to be run from your CMake build directory after installing." 1>&2
+    exit 1
+fi
+
+xargs rm -vf < install_manifest.txt
+exit 0
+