forked from KDE/mauiman
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcmake_uninstall.cmake.in
More file actions
25 lines (22 loc) · 934 Bytes
/
cmake_uninstall.cmake.in
File metadata and controls
25 lines (22 loc) · 934 Bytes
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
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()
file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" manifest_content)
string(REPLACE "\n" ";" manifest_files "${manifest_content}")
foreach(installed_file ${manifest_files})
if(installed_file STREQUAL "")
continue()
endif()
set(full_path "$ENV{DESTDIR}${installed_file}")
if(EXISTS "${full_path}" OR IS_SYMLINK "${full_path}")
message(STATUS "Uninstalling ${full_path}")
execute_process(
COMMAND "@CMAKE_COMMAND@" -E rm -f "${full_path}"
RESULT_VARIABLE rm_result)
if(NOT rm_result EQUAL 0)
message(FATAL_ERROR "Failed to uninstall ${full_path}")
endif()
else()
message(STATUS "Skipping missing file: ${full_path}")
endif()
endforeach()