|
|
1.1 root 1: #
2: # "uninstall" target for reverting "make install"
3: #
4:
5: # cmake_policy(SET CMP0007 NEW)
6:
7: if (NOT EXISTS "${CMAKE_CURRENT_BINARY_DIR}/install_manifest.txt")
8: message(FATAL_ERROR "Cannot find install manifest: \"${CMAKE_CURRENT_BINARY_DIR}/install_manifest.txt\"")
9: endif()
10:
11: file(READ "${CMAKE_CURRENT_BINARY_DIR}/install_manifest.txt" files)
12: string(REGEX REPLACE "\n" ";" files "${files}")
13: # list(REVERSE files)
14: foreach (file ${files})
15: message(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"")
16: if (EXISTS "$ENV{DESTDIR}${file}")
17: execute_process(
18: COMMAND ${CMAKE_COMMAND} -E remove "$ENV{DESTDIR}${file}"
19: OUTPUT_VARIABLE rm_out
20: RESULT_VARIABLE rm_retval
21: )
22: if(NOT ${rm_retval} EQUAL 0)
23: message(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"")
24: endif (NOT ${rm_retval} EQUAL 0)
25: else (EXISTS "$ENV{DESTDIR}${file}")
26: message(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.")
27: endif (EXISTS "$ENV{DESTDIR}${file}")
28: endforeach(file)
29:
30: execute_process(
31: COMMAND ${CMAKE_COMMAND} -E remove ${CMAKE_CURRENT_BINARY_DIR}/install_manifest.txt
32: )
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.