blob: 9ae1ae4bd6049b7e94b46ecb1894a52cafdf257a [file] [log] [blame]
piotr437f5462014-02-04 17:57:25 +01001# http://www.vtk.org/Wiki/CMake_FAQ#Can_I_do_.22make_uninstall.22_with_CMake.3F
2
3IF(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
4 MESSAGE(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt\"")
5ENDIF(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
6
7FILE(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files)
8STRING(REGEX REPLACE "\n" ";" files "${files}")
9FOREACH(file ${files})
10 MESSAGE(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"")
11 IF(EXISTS "$ENV{DESTDIR}${file}")
12 EXEC_PROGRAM(
13 "@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\""
14 OUTPUT_VARIABLE rm_out
15 RETURN_VALUE rm_retval
16 )
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 ELSEIF(IS_SYMLINK "$ENV{DESTDIR}${file}")
21 EXEC_PROGRAM(
22 "@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\""
23 OUTPUT_VARIABLE rm_out
24 RETURN_VALUE rm_retval
25 )
26 IF(NOT "${rm_retval}" STREQUAL 0)
27 MESSAGE(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"")
28 ENDIF(NOT "${rm_retval}" STREQUAL 0)
29 ELSE(EXISTS "$ENV{DESTDIR}${file}")
30 MESSAGE(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.")
31 ENDIF(EXISTS "$ENV{DESTDIR}${file}")
32ENDFOREACH(file)