uninstall.cmake 678 B

12345678910111213141516171819202122232425
  1. set(MANIFEST "${CMAKE_CURRENT_BINARY_DIR}/install_manifest.txt")
  2. if(NOT EXISTS ${MANIFEST})
  3. message(FATAL_ERROR "Cannot find install manifest: '${MANIFEST}'")
  4. endif()
  5. file(STRINGS ${MANIFEST} files)
  6. foreach(file ${files})
  7. if(EXISTS ${file})
  8. message(STATUS "Removing file: '${file}'")
  9. exec_program(
  10. ${CMAKE_COMMAND} ARGS "-E remove ${file}"
  11. OUTPUT_VARIABLE stdout
  12. RETURN_VALUE result
  13. )
  14. if(NOT "${result}" STREQUAL 0)
  15. message(FATAL_ERROR "Failed to remove file: '${file}'.")
  16. endif()
  17. else()
  18. MESSAGE(STATUS "File '${file}' does not exist.")
  19. endif()
  20. endforeach(file)