1
# Source: http://www.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
foreach (file ${files})
11
message(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"")
12
if (EXISTS "$ENV{DESTDIR}${file}")
14
COMMAND @CMAKE_COMMAND@ -E remove "$ENV{DESTDIR}${file}"
15
OUTPUT_VARIABLE rm_out
16
RESULT_VARIABLE rm_retval
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}")