0001 if(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
0002 message(FATAL_ERROR "Cannot find install manifest: @CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
0003 endif(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
0004
0005 file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files)
0006 string(REGEX REPLACE "\n" ";" files "${files}")
0007 foreach(file ${files})
0008 message(STATUS "Uninstalling $ENV{DESTDIR}${file}")
0009 if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
0010 exec_program(
0011 "@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\""
0012 OUTPUT_VARIABLE rm_out
0013 RETURN_VALUE rm_retval
0014 )
0015 if(NOT "${rm_retval}" STREQUAL 0)
0016 message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}")
0017 endif(NOT "${rm_retval}" STREQUAL 0)
0018 else(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
0019 message(STATUS "File $ENV{DESTDIR}${file} does not exist.")
0020 endif(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
0021 endforeach(file)