0001-Add-missing-file-Uninstall.cmake.in.patch 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. From 9c2d9d2c8f65d7c6bb268c0e9795bac296661ca8 Mon Sep 17 00:00:00 2001
  2. From: Daniel Engberg <daniel.engberg.lists@pyret.net>
  3. Date: Wed, 7 Aug 2019 00:56:39 +0200
  4. Subject: [PATCH] Add missing file Uninstall.cmake.in
  5. Needed to fix compilation
  6. Signed-off-by: Daniel Engberg <daniel.engberg.lists@pyret.net>
  7. ---
  8. cmake/Uninstall.cmake.in | 23 +++++++++++++++++++++++
  9. 1 file changed, 23 insertions(+)
  10. create mode 100644 cmake/Uninstall.cmake.in
  11. diff --git a/cmake/Uninstall.cmake.in b/cmake/Uninstall.cmake.in
  12. new file mode 100644
  13. index 0000000..c6dc09e
  14. --- /dev/null
  15. +++ b/cmake/Uninstall.cmake.in
  16. @@ -0,0 +1,23 @@
  17. +# https://gitlab.kitware.com/cmake/community/wikis/FAQ#can-i-do-make-uninstall-with-cmake
  18. +
  19. +if(NOT EXISTS "@CMAKE_BINARY_DIR@/install_manifest.txt")
  20. + message(FATAL_ERROR "Cannot find install manifest: @CMAKE_BINARY_DIR@/install_manifest.txt")
  21. +endif(NOT EXISTS "@CMAKE_BINARY_DIR@/install_manifest.txt")
  22. +
  23. +file(READ "@CMAKE_BINARY_DIR@/install_manifest.txt" files)
  24. +string(REGEX REPLACE "\n" ";" files "${files}")
  25. +foreach(file ${files})
  26. + message(STATUS "Uninstalling $ENV{DESTDIR}${file}")
  27. + if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
  28. + exec_program(
  29. + "@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\""
  30. + OUTPUT_VARIABLE rm_out
  31. + RETURN_VALUE rm_retval
  32. + )
  33. + if(NOT "${rm_retval}" STREQUAL 0)
  34. + message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}")
  35. + endif(NOT "${rm_retval}" STREQUAL 0)
  36. + else(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
  37. + message(STATUS "File $ENV{DESTDIR}${file} does not exist.")
  38. + endif(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
  39. +endforeach(file)
  40. --
  41. 2.22.0