add cmake uninstall
Renzo Davoli
3 years ago
30 | 30 |
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
|
31 | 31 |
|
32 | 32 |
add_subdirectory(man)
|
|
33 |
|
|
34 |
add_custom_target(uninstall
|
|
35 |
"${CMAKE_COMMAND}" -P "${PROJECT_SOURCE_DIR}/Uninstall.cmake")
|
|
0 |
cmake_minimum_required(VERSION 3.13)
|
|
1 |
set(MANIFEST "${CMAKE_CURRENT_BINARY_DIR}/install_manifest.txt")
|
|
2 |
|
|
3 |
if(NOT EXISTS ${MANIFEST})
|
|
4 |
message(FATAL_ERROR "Cannot find install manifest: '${MANIFEST}'")
|
|
5 |
endif()
|
|
6 |
|
|
7 |
file(STRINGS ${MANIFEST} files)
|
|
8 |
foreach(file ${files})
|
|
9 |
if(EXISTS ${file} OR IS_SYMLINK ${file})
|
|
10 |
message(STATUS "Removing: ${file}")
|
|
11 |
|
|
12 |
execute_process(
|
|
13 |
COMMAND rm -f ${file}
|
|
14 |
RESULT_VARIABLE retcode
|
|
15 |
)
|
|
16 |
|
|
17 |
if(NOT "${retcode}" STREQUAL "0")
|
|
18 |
message(WARNING "Failed to remove: ${file}")
|
|
19 |
endif()
|
|
20 |
endif()
|
|
21 |
endforeach(file)
|