1 1.1 christos if(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") 2 1.1 christos message(FATAL_ERROR "Cannot find install manifest: @CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") 3 1.1 christos endif(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") 4 1.1 christos 5 1.1 christos file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files) 6 1.1 christos string(REGEX REPLACE "\n" ";" files "${files}") 7 1.1 christos foreach(file ${files}) 8 1.1 christos message(STATUS "Uninstalling $ENV{DESTDIR}${file}") 9 1.1 christos if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") 10 1.1 christos exec_program( 11 1.1 christos "@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\"" 12 1.1 christos OUTPUT_VARIABLE rm_out 13 1.1 christos RETURN_VALUE rm_retval 14 1.1 christos ) 15 1.1 christos if(NOT "${rm_retval}" STREQUAL 0) 16 1.1 christos message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}") 17 1.1 christos endif(NOT "${rm_retval}" STREQUAL 0) 18 1.1 christos else(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") 19 1.1 christos message(STATUS "File $ENV{DESTDIR}${file} does not exist.") 20 1.1 christos endif(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") 21 1.1 christos endforeach(file) 22