Merge lp:~ter0/pantheon-terminal/add-uninstall-target into lp:~elementary-apps/pantheon-terminal/trunk

Proposed by Chris Johns
Status: Merged
Approved by: xapantu
Approved revision: 545
Merged at revision: 747
Proposed branch: lp:~ter0/pantheon-terminal/add-uninstall-target
Merge into: lp:~elementary-apps/pantheon-terminal/trunk
Diff against target: 47 lines (+32/-0)
2 files modified
CMakeLists.txt (+9/-0)
cmake/Uninstall.cmake (+23/-0)
To merge this branch: bzr merge lp:~ter0/pantheon-terminal/add-uninstall-target
Reviewer Review Type Date Requested Status
xapantu (community) Approve
Review via email: mp+203554@code.launchpad.net

Commit message

Add uninstall target

To post a comment you must log in.
Revision history for this message
David Gomes (davidgomes) wrote :

I don't think I'm really the one to review this, I'm going to ask Ricotz to review this though.

Revision history for this message
xapantu (xapantu) wrote :

I am not opposed to this one but that should definitively be in the cmake-modules branch. I will add it if it works fine.

Revision history for this message
xapantu (xapantu) :
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-12-23 21:04:12 +0000
3+++ CMakeLists.txt 2014-01-28 14:21:26 +0000
4@@ -37,6 +37,15 @@
5 include (CPack)
6 add_custom_target (dist COMMAND ${CMAKE_MAKE_PROGRAM} package_source)
7
8+# Add 'make uninstall' command to remove installed files
9+configure_file(
10+ "${CMAKE_SOURCE_DIR}/cmake/Uninstall.cmake"
11+ "${CMAKE_CURRENT_BINARY_DIR}/Uninstall.cmake"
12+ IMMEDIATE @ONLY)
13+
14+add_custom_target(uninstall
15+ COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/Uninstall.cmake)
16+
17 find_package (PkgConfig)
18 pkg_check_modules (DEPS REQUIRED
19 gthread-2.0
20
21=== added file 'cmake/Uninstall.cmake'
22--- cmake/Uninstall.cmake 1970-01-01 00:00:00 +0000
23+++ cmake/Uninstall.cmake 2014-01-28 14:21:26 +0000
24@@ -0,0 +1,23 @@
25+if (NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
26+ message(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt\"")
27+endif(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
28+
29+file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files)
30+string(REGEX REPLACE "\n" ";" files "${files}")
31+cmake_policy (SET CMP0007 NEW)
32+list(REVERSE files)
33+foreach (file ${files})
34+ message(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"")
35+ if (EXISTS "$ENV{DESTDIR}${file}")
36+ execute_process(
37+ COMMAND @CMAKE_COMMAND@ -E remove "$ENV{DESTDIR}${file}"
38+ OUTPUT_VARIABLE rm_out
39+ RESULT_VARIABLE rm_retval
40+ )
41+ if(NOT ${rm_retval} EQUAL 0)
42+ message(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"")
43+ endif (NOT ${rm_retval} EQUAL 0)
44+ else (EXISTS "$ENV{DESTDIR}${file}")
45+ message(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.")
46+ endif (EXISTS "$ENV{DESTDIR}${file}")
47+endforeach(file)

Subscribers

People subscribed via source and target branches