blob: 4ea57b1cfb6c476f152a505710973005bb118870 [file] [log] [blame]
Camilla Berglund3249f812010-09-07 17:34:51 +02001
Camilla Berglund2d3f25c2012-08-19 02:33:43 +02002if (NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
3 message(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt\"")
4endif()
5
6file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files)
7string(REGEX REPLACE "\n" ";" files "${files}")
8
9foreach (file ${files})
10 message(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"")
11 if (EXISTS "$ENV{DESTDIR}${file}")
12 exec_program("@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\""
13 OUTPUT_VARIABLE rm_out
14 RETURN_VALUE rm_retval)
15 if (NOT "${rm_retval}" STREQUAL 0)
Camilla Berglund3249f812010-09-07 17:34:51 +020016 MESSAGE(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"")
Camilla Berglund2d3f25c2012-08-19 02:33:43 +020017 endif()
18 elseif (IS_SYMLINK "$ENV{DESTDIR}${file}")
19 EXEC_PROGRAM("@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\""
20 OUTPUT_VARIABLE rm_out
21 RETURN_VALUE rm_retval)
22 if (NOT "${rm_retval}" STREQUAL 0)
23 message(FATAL_ERROR "Problem when removing symlink \"$ENV{DESTDIR}${file}\"")
24 endif()
25 else()
26 message(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.")
27 endif()
28endforeach()
Camilla Berglund3249f812010-09-07 17:34:51 +020029