summaryrefslogtreecommitdiffstats
path: root/cmake/scripts/common/Uninstall.cmake
diff options
context:
space:
mode:
authormanuel <manuel@mausz.at>2017-06-04 16:57:49 +0200
committermanuel <manuel@mausz.at>2017-06-04 16:57:49 +0200
commitf44ecaa4f27e7538ddcad66d40e543bffa2d2d86 (patch)
treed8de60fc7e17edeb6f0921726c038ee54b281445 /cmake/scripts/common/Uninstall.cmake
parentae08c8b7221bc965ac40d70e53fc8fcddb050c46 (diff)
downloadkodi-pvr-build-f44ecaa4f27e7538ddcad66d40e543bffa2d2d86.tar.gz
kodi-pvr-build-f44ecaa4f27e7538ddcad66d40e543bffa2d2d86.tar.bz2
kodi-pvr-build-f44ecaa4f27e7538ddcad66d40e543bffa2d2d86.zip
sync with upstream
Diffstat (limited to 'cmake/scripts/common/Uninstall.cmake')
-rw-r--r--cmake/scripts/common/Uninstall.cmake22
1 files changed, 22 insertions, 0 deletions
diff --git a/cmake/scripts/common/Uninstall.cmake b/cmake/scripts/common/Uninstall.cmake
new file mode 100644
index 0000000..5660e19
--- /dev/null
+++ b/cmake/scripts/common/Uninstall.cmake
@@ -0,0 +1,22 @@
1# Uninstall target
2set(MANIFEST ${CMAKE_CURRENT_BINARY_DIR}/install_manifest.txt)
3if(EXISTS ${MANIFEST})
4 file(STRINGS ${MANIFEST} files)
5 foreach(file IN LISTS files)
6 if(EXISTS $ENV{DESTDIR}${file})
7 message(STATUS "Uninstalling: ${file}")
8 execute_process(
9 COMMAND ${CMAKE_COMMAND} -E remove $ENV{DESTDIR}${file}
10 OUTPUT_VARIABLE rm_out
11 RESULT_VARIABLE rm_retval
12 )
13 if(NOT "${rm_retval}" STREQUAL 0)
14 message(FATAL_ERROR "Failed to remove file: $ENV{DESTDIR}${file}")
15 endif()
16 else()
17 message(STATUS "File does not exist: $ENV{DESTDIR}${file}")
18 endif()
19 endforeach(file)
20else()
21 message(STATUS "Cannot find install manifest: '${MANIFEST}'")
22endif()