1cmake_minimum_required(VERSION 3.13) 2set(MANIFEST "${CMAKE_CURRENT_BINARY_DIR}/install_manifest.txt") 3 4if(NOT EXISTS ${MANIFEST}) 5 message(FATAL_ERROR "Cannot find install manifest: '${MANIFEST}'") 6endif() 7 8file(STRINGS ${MANIFEST} files) 9foreach(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() 22endforeach(file) 23