aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDRC <dcommander@users.sourceforge.net>2011-06-25 07:33:57 +0000
committerDRC <dcommander@users.sourceforge.net>2011-06-25 07:33:57 +0000
commitb7140022dfe7dfd1f52145e190ad0ff0f6cc83bd (patch)
treedfc5c66e8aa5e3b2856768fd996d9daf2ea4f81d
parent5b6aee2dbf63b15224061640c6ac0f8d3aa5f263 (diff)
downloadtigervnc-b7140022dfe7dfd1f52145e190ad0ff0f6cc83bd.tar.gz
tigervnc-b7140022dfe7dfd1f52145e190ad0ff0f6cc83bd.zip
Add uninstall target
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4554 3789f03b-4d11-0410-bbf8-ca57d06f2519
-rw-r--r--CMakeLists.txt6
-rw-r--r--cmake/cmake_uninstall.cmake.in24
2 files changed, 30 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 675c3ddd..159de720 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -324,3 +324,9 @@ if(BUILD_NEW_VNCVIEWER)
endif()
include(cmake/BuildPackages.cmake)
+
+# uninstall
+configure_file("${CMAKE_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in"
+ "cmake_uninstall.cmake" IMMEDIATE @ONLY)
+
+add_custom_target(uninstall COMMAND ${CMAKE_COMMAND} -P cmake_uninstall.cmake)
diff --git a/cmake/cmake_uninstall.cmake.in b/cmake/cmake_uninstall.cmake.in
new file mode 100644
index 00000000..a2494592
--- /dev/null
+++ b/cmake/cmake_uninstall.cmake.in
@@ -0,0 +1,24 @@
+# This code is from the CMake FAQ
+
+if (NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
+ message(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt\"")
+endif(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
+
+file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files)
+string(REGEX REPLACE "\n" ";" files "${files}")
+list(REVERSE files)
+foreach (file ${files})
+ message(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"")
+ if (EXISTS "$ENV{DESTDIR}${file}")
+ execute_process(
+ COMMAND @CMAKE_COMMAND@ -E remove "$ENV{DESTDIR}${file}"
+ OUTPUT_VARIABLE rm_out
+ RESULT_VARIABLE rm_retval
+ )
+ if(NOT ${rm_retval} EQUAL 0)
+ message(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"")
+ endif (NOT ${rm_retval} EQUAL 0)
+ else (EXISTS "$ENV{DESTDIR}${file}")
+ message(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.")
+ endif (EXISTS "$ENV{DESTDIR}${file}")
+endforeach(file)
'>stats
path: root/archiva-modules/archiva-base/archiva-policies/pom.xml
blob: 7306a056506cca4fe4c7848b8aef33aa0cb1550e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145