2
0

cmake_uninstall.cmake.in 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #***************************************************************************
  2. # _ _ ____ _
  3. # Project ___| | | | _ \| |
  4. # / __| | | | |_) | |
  5. # | (__| |_| | _ <| |___
  6. # \___|\___/|_| \_\_____|
  7. #
  8. # Copyright (C) 1998 - 2020, 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.haxx.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. ###########################################################################
  22. if(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
  23. message(FATAL_ERROR "Cannot find install manifest: @CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
  24. endif()
  25. if(NOT DEFINED CMAKE_INSTALL_PREFIX)
  26. set(CMAKE_INSTALL_PREFIX "@CMAKE_INSTALL_PREFIX@")
  27. endif()
  28. message(${CMAKE_INSTALL_PREFIX})
  29. file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files)
  30. string(REGEX REPLACE "\n" ";" files "${files}")
  31. foreach(file ${files})
  32. message(STATUS "Uninstalling $ENV{DESTDIR}${file}")
  33. if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
  34. exec_program(
  35. "@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\""
  36. OUTPUT_VARIABLE rm_out
  37. RETURN_VALUE rm_retval
  38. )
  39. if(NOT "${rm_retval}" STREQUAL 0)
  40. message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}")
  41. endif()
  42. else()
  43. message(STATUS "File $ENV{DESTDIR}${file} does not exist.")
  44. endif()
  45. endforeach()