• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1cmake_minimum_required(VERSION 2.8.5)
2
3set(MANIFEST "${CMAKE_CURRENT_BINARY_DIR}/install_manifest.txt")
4
5if(NOT EXISTS ${MANIFEST})
6    message(FATAL_ERROR "Cannot find install mainfest: ${MANIFEST}")
7endif()
8
9file(STRINGS ${MANIFEST} files)
10foreach(file ${files})
11    if(EXISTS ${file} OR IS_SYMLINK ${file})
12        message(STATUS "Removing: ${file}")
13
14	execute_process(COMMAND rm -f ${file}
15            RESULT_VARIABLE result
16            OUTPUT_QUIET
17            ERROR_VARIABLE stderr
18            ERROR_STRIP_TRAILING_WHITESPACE
19        )
20
21        if(NOT ${result} EQUAL 0)
22            message(FATAL_ERROR "${stderr}")
23        endif()
24    else()
25        message(STATUS "Does-not-exist: ${file}")
26    endif()
27endforeach(file)
28