| 1 |
cmake_minimum_required(VERSION 3.13) |
| 2 |
set(MANIFEST "${CMAKE_CURRENT_BINARY_DIR}/install_manifest.txt") |
| 3 |
|
| 4 |
if(NOT EXISTS ${MANIFEST}) |
| 5 |
message(FATAL_ERROR "Cannot find install manifest: '${MANIFEST}'") |
| 6 |
endif() |
| 7 |
|
| 8 |
file(STRINGS ${MANIFEST} files) |
| 9 |
foreach(file ${files}) |
| 10 |
if(EXISTS ${file} OR IS_SYMLINK ${file}) |
| 11 |
message(STATUS "Removing: ${file}") |
| 12 |
|
| 13 |
execute_process( |
| 14 |
COMMAND rm -f ${file} |
| 15 |
RESULT_VARIABLE retcode |
| 16 |
) |
| 17 |
|
| 18 |
if(NOT "${retcode}" STREQUAL "0") |
| 19 |
message(WARNING "Failed to remove: ${file}") |
| 20 |
endif() |
| 21 |
endif() |
| 22 |
endforeach(file) |