Merge lp:~ter0/audience/fix-1169372 into lp:~audience-members/audience/trunk

Proposed by Chris Johns
Status: Merged
Approved by: Corentin Noël
Approved revision: 307
Merged at revision: 333
Proposed branch: lp:~ter0/audience/fix-1169372
Merge into: lp:~audience-members/audience/trunk
Diff against target: 44 lines (+32/-0)
2 files modified
CMakeLists.txt (+9/-0)
cmake/Uninstall.cmake (+23/-0)
To merge this branch: bzr merge lp:~ter0/audience/fix-1169372
Reviewer Review Type Date Requested Status
Corentin Noël Approve
Review via email: mp+201288@code.launchpad.net

Commit message

Added uninstall.

To post a comment you must log in.
Revision history for this message
Corentin Noël (tintou) wrote :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'CMakeLists.txt'
2--- CMakeLists.txt 2013-04-01 05:05:19 +0000
3+++ CMakeLists.txt 2014-01-11 15:01:00 +0000
4@@ -88,3 +88,12 @@
5 add_subdirectory (po)
6 add_executable(audience ${VALA_C})
7 install (TARGETS audience RUNTIME DESTINATION bin)
8+
9+# uninstall target
10+configure_file(
11+ "${CMAKE_SOURCE_DIR}/cmake/Uninstall.cmake"
12+ "${CMAKE_CURRENT_BINARY_DIR}/Uninstall.cmake"
13+ IMMEDIATE @ONLY)
14+
15+add_custom_target(uninstall
16+ COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/Uninstall.cmake)
17
18=== added file 'cmake/Uninstall.cmake'
19--- cmake/Uninstall.cmake 1970-01-01 00:00:00 +0000
20+++ cmake/Uninstall.cmake 2014-01-11 15:01:00 +0000
21@@ -0,0 +1,23 @@
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(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
25+
26+file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files)
27+string(REGEX REPLACE "\n" ";" files "${files}")
28+cmake_policy (SET CMP0007 NEW)
29+list(REVERSE files)
30+foreach (file ${files})
31+ message(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"")
32+ if (EXISTS "$ENV{DESTDIR}${file}")
33+ execute_process(
34+ COMMAND @CMAKE_COMMAND@ -E remove "$ENV{DESTDIR}${file}"
35+ OUTPUT_VARIABLE rm_out
36+ RESULT_VARIABLE rm_retval
37+ )
38+ if(NOT ${rm_retval} EQUAL 0)
39+ message(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"")
40+ endif (NOT ${rm_retval} EQUAL 0)
41+ else (EXISTS "$ENV{DESTDIR}${file}")
42+ message(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.")
43+ endif (EXISTS "$ENV{DESTDIR}${file}")
44+endforeach(file)

Subscribers

People subscribed via source and target branches

to all changes: