Blame thirdparty/libjpeg-turbo/libjpeg-turbo-2.0.6/cmakescripts/cmake_uninstall.cmake.in

shun-iwasawa 82a8f5
# This code is from the CMake FAQ
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
if (NOT EXISTS "@CMAKE_BINARY_DIR@/install_manifest.txt")
shun-iwasawa 82a8f5
  message(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_BINARY_DIR@/install_manifest.txt\"")
shun-iwasawa 82a8f5
endif(NOT EXISTS "@CMAKE_BINARY_DIR@/install_manifest.txt")
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
file(READ "@CMAKE_BINARY_DIR@/install_manifest.txt" files)
shun-iwasawa 82a8f5
string(REGEX REPLACE "\n" ";" files "${files}")
shun-iwasawa 82a8f5
list(REVERSE files)
shun-iwasawa 82a8f5
foreach (file ${files})
shun-iwasawa 82a8f5
  message(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"")
shun-iwasawa 82a8f5
    if (EXISTS "$ENV{DESTDIR}${file}")
shun-iwasawa 82a8f5
      execute_process(
shun-iwasawa 82a8f5
        COMMAND "@CMAKE_COMMAND@" -E remove "$ENV{DESTDIR}${file}"
shun-iwasawa 82a8f5
        OUTPUT_VARIABLE rm_out
shun-iwasawa 82a8f5
        RESULT_VARIABLE rm_retval
shun-iwasawa 82a8f5
      )
shun-iwasawa 82a8f5
    if(NOT ${rm_retval} EQUAL 0)
shun-iwasawa 82a8f5
      message(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"")
shun-iwasawa 82a8f5
    endif (NOT ${rm_retval} EQUAL 0)
shun-iwasawa 82a8f5
  else (EXISTS "$ENV{DESTDIR}${file}")
shun-iwasawa 82a8f5
    message(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.")
shun-iwasawa 82a8f5
  endif (EXISTS "$ENV{DESTDIR}${file}")
shun-iwasawa 82a8f5
endforeach(file)