cmake_uninstall.cmake.in (1985B)
1 #*************************************************************************** 2 # _ _ ____ _ 3 # Project ___| | | | _ \| | 4 # / __| | | | |_) | | 5 # | (__| |_| | _ <| |___ 6 # \___|\___/|_| \_\_____| 7 # 8 # Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al. 9 # 10 # This software is licensed as described in the file COPYING, which 11 # you should have received as part of this distribution. The terms 12 # are also available at https://curl.se/docs/copyright.html. 13 # 14 # You may opt to use, copy, modify, merge, publish, distribute and/or sell 15 # copies of the Software, and permit persons to whom the Software is 16 # furnished to do so, under the terms of the COPYING file. 17 # 18 # This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 19 # KIND, either express or implied. 20 # 21 # SPDX-License-Identifier: curl 22 # 23 ########################################################################### 24 if(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") 25 message(FATAL_ERROR "Cannot find install manifest: @CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") 26 endif() 27 28 if(NOT DEFINED CMAKE_INSTALL_PREFIX) 29 set(CMAKE_INSTALL_PREFIX "@CMAKE_INSTALL_PREFIX@") 30 endif() 31 message(${CMAKE_INSTALL_PREFIX}) 32 33 file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" _files) 34 string(REGEX REPLACE "\n" ";" _files "${_files}") 35 foreach(_file ${_files}) 36 message(STATUS "Uninstalling $ENV{DESTDIR}${_file}") 37 if(IS_SYMLINK "$ENV{DESTDIR}${_file}" OR EXISTS "$ENV{DESTDIR}${_file}") 38 execute_process( 39 COMMAND "@CMAKE_COMMAND@" -E remove "$ENV{DESTDIR}${_file}" 40 RESULT_VARIABLE rm_retval 41 OUTPUT_QUIET 42 ERROR_QUIET 43 ) 44 if(NOT "${rm_retval}" STREQUAL 0) 45 message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${_file}") 46 endif() 47 else() 48 message(STATUS "File $ENV{DESTDIR}${_file} does not exist.") 49 endif() 50 endforeach()