blob: a24945929342c5f8c64b7c7446665879f94ca433 [file] [log] [blame]
DRCb7140022011-06-25 07:33:57 +00001# This code is from the CMake FAQ
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}")
9list(REVERSE files)
10foreach (file ${files})
11 message(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"")
12 if (EXISTS "$ENV{DESTDIR}${file}")
13 execute_process(
14 COMMAND @CMAKE_COMMAND@ -E remove "$ENV{DESTDIR}${file}"
15 OUTPUT_VARIABLE rm_out
16 RESULT_VARIABLE rm_retval
17 )
18 if(NOT ${rm_retval} EQUAL 0)
19 message(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"")
20 endif (NOT ${rm_retval} EQUAL 0)
21 else (EXISTS "$ENV{DESTDIR}${file}")
22 message(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.")
23 endif (EXISTS "$ENV{DESTDIR}${file}")
24endforeach(file)