Debian Codegraph @

cmake/cmake_uninstall.cmake.in

raw
1 #
2 # From CMake FAQ:
3 # https://gitlab.kitware.com/cmake/community/wikis/FAQ#can-i-do-make-uninstall-with-cmake
4 #
5 if(NOT EXISTS "@CMAKE_BINARY_DIR@/install_manifest.txt")
6 message(FATAL_ERROR "Cannot find install manifest: @CMAKE_BINARY_DIR@/install_manifest.txt")
7 endif(NOT EXISTS "@CMAKE_BINARY_DIR@/install_manifest.txt")
8
9 file(READ "@CMAKE_BINARY_DIR@/install_manifest.txt" files)
10 string(REGEX REPLACE "\n" ";" files "${files}")
11 foreach(file ${files})
12 message(STATUS "Uninstalling $ENV{DESTDIR}${file}")
13 if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
14 exec_program(
15 "@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\""
16 OUTPUT_VARIABLE rm_out
17 RETURN_VALUE rm_retval
18 )
19 if(NOT "${rm_retval}" STREQUAL 0)
20 message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}")
21 endif(NOT "${rm_retval}" STREQUAL 0)
22 else(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
23 message(STATUS "File $ENV{DESTDIR}${file} does not exist.")
24 endif(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
25 endforeach(file)