Debian Codegraph @

cmake/cmake-uninstall.cmake.in

raw
1 # from https://gitlab.kitware.com/cmake/community/-/wikis/FAQ
2 # short unix alternative;
3 # xargs rm < install_manifest.txt
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()
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()
22 else(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
23 message(STATUS "File $ENV{DESTDIR}${file} does not exist.")
24 endif()
25 endforeach()