1 # Copied from http://cmake.org/Wiki/CMake_FAQ#Can_I_do_.22make_uninstall.22_with_CMake.3F
3 IF(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
4 MESSAGE(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt\"")
5 ENDIF(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
7 FILE(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files)
8 STRING(REGEX REPLACE "\n" ";" files "${files}")
10 MESSAGE(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"")
11 IF(EXISTS "$ENV{DESTDIR}${file}")
13 "@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\""
14 OUTPUT_VARIABLE rm_out
15 RETURN_VALUE rm_retval
17 IF(NOT "${rm_retval}" STREQUAL 0)
18 MESSAGE(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"")
19 ENDIF(NOT "${rm_retval}" STREQUAL 0)
20 ELSE(EXISTS "$ENV{DESTDIR}${file}")
21 MESSAGE(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.")
22 ENDIF(EXISTS "$ENV{DESTDIR}${file}")