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