cmake_uninstall.cmake 1.0 KB

1234567891011121314151617181920212223242526272829
  1. cmake_policy(SET CMP0007 NEW)
  2. if (NOT EXISTS "/home/z/libjson-rpc-cpp-0.7.0/obj-x86_64-linux-gnu/install_manifest.txt")
  3. message(FATAL_ERROR "Cannot find install manifest: \"/home/z/libjson-rpc-cpp-0.7.0/obj-x86_64-linux-gnu/install_manifest.txt\"")
  4. endif(NOT EXISTS "/home/z/libjson-rpc-cpp-0.7.0/obj-x86_64-linux-gnu/install_manifest.txt")
  5. file(READ "/home/z/libjson-rpc-cpp-0.7.0/obj-x86_64-linux-gnu/install_manifest.txt" files)
  6. string(REGEX REPLACE "\n" ";" files "${files}")
  7. list(REVERSE files)
  8. foreach (file ${files})
  9. message(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"")
  10. if (EXISTS "$ENV{DESTDIR}${file}")
  11. execute_process(
  12. COMMAND /usr/bin/cmake -E remove "$ENV{DESTDIR}${file}"
  13. OUTPUT_VARIABLE rm_out
  14. RESULT_VARIABLE rm_retval
  15. )
  16. if (NOT ${rm_retval} EQUAL 0)
  17. message(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"")
  18. endif (NOT ${rm_retval} EQUAL 0)
  19. else (EXISTS "$ENV{DESTDIR}${file}")
  20. message(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.")
  21. endif (EXISTS "$ENV{DESTDIR}${file}")
  22. endforeach(file)