From 1540067e20cbf2d4a09214a2054b2090d439a8ff Mon Sep 17 00:00:00 2001 From: Andy Cedilnik Date: Tue, 18 Jan 2005 08:58:27 -0500 Subject: ENH: Add uninstall. This is not really a feature but more of an example on how to do it. --- cmake_uninstall.cmake.in | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 cmake_uninstall.cmake.in (limited to 'cmake_uninstall.cmake.in') diff --git a/cmake_uninstall.cmake.in b/cmake_uninstall.cmake.in new file mode 100644 index 0000000000..47187f5a9d --- /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 \"${file}\"") + IF(NOT EXISTS "${file}") + MESSAGE(FATAL_ERROR "File \"${file}\" does not exists.") + ENDIF(NOT EXISTS "${file}") + EXEC_PROGRAM("@CMAKE_COMMAND@" ARGS "-E remove \"${file}\"" + OUTPUT_VARIABLE rm_out + RETURN_VARIABLE rm_retval) + IF("${rm_retval}" GREATER 0) + MESSAGE(FATAL_ERROR "Problem when removing \"${file}\"") + ENDIF("${rm_retval}" GREATER 0) +ENDFOREACH(file) + + + -- cgit v1.2.1