Debian Codegraph @

cmake/cmake_uninstall.cmake.in

raw
1 # ----------------------------------
2 # Setup for make uninstall target
3 # See:
4 # http://www.cmake.org/Wiki/CMake_FAQ#Can_I_do_.22make_uninstall.22_with_CMake.3F
5 # ----------------------------------
6
7 if(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
8 message(FATAL_ERROR "Cannot find install manifest: @CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
9 endif(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
10
11 file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files)
12 string(REGEX REPLACE "\n" ";" files "${files}")
13 foreach(file ${files})
14 message(STATUS "Uninstalling $ENV{DESTDIR}${file}")
15 if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
16 exec_program(
17 "@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\""
18 OUTPUT_VARIABLE rm_out
19 RETURN_VALUE rm_retval
20 )
21 if(NOT "${rm_retval}" STREQUAL 0)
22 message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}")
23 endif(NOT "${rm_retval}" STREQUAL 0)
24 else(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
25 message(STATUS "File $ENV{DESTDIR}${file} does not exist.")
26 endif(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
27 endforeach(file)
28