1335640Shselaskyif(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
2335640Shselasky  message(FATAL_ERROR "Cannot find install manifest: @CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
3335640Shselaskyendif(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
4335640Shselasky
5335640Shselaskyfile(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files)
6335640Shselaskystring(REGEX REPLACE "\n" ";" files "${files}")
7335640Shselaskyforeach(file ${files})
8335640Shselasky  message(STATUS "Uninstalling $ENV{DESTDIR}${file}")
9335640Shselasky  if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
10335640Shselasky    exec_program(
11335640Shselasky      "@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\""
12335640Shselasky      OUTPUT_VARIABLE rm_out
13335640Shselasky      RETURN_VALUE rm_retval
14335640Shselasky      )
15335640Shselasky    if(NOT "${rm_retval}" STREQUAL 0)
16335640Shselasky      message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}")
17335640Shselasky    endif(NOT "${rm_retval}" STREQUAL 0)
18335640Shselasky  else(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
19335640Shselasky    message(STATUS "File $ENV{DESTDIR}${file} does not exist.")
20335640Shselasky  endif(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
21335640Shselaskyendforeach(file)
22