cmake_uninstall.cmake.in 1.1 KB

123456789101112131415161718192021222324252627
  1. # -----------------------------------------------
  2. # File that provides "make uninstall" target
  3. # We use the file 'install_manifest.txt'
  4. # -----------------------------------------------
  5. IF(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
  6. MESSAGE(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt\"")
  7. ENDIF(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
  8. FILE(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files)
  9. STRING(REGEX REPLACE "\n" ";" files "${files}")
  10. FOREACH(file ${files})
  11. MESSAGE(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"")
  12. IF(EXISTS "$ENV{DESTDIR}${file}")
  13. EXEC_PROGRAM(
  14. "@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\""
  15. OUTPUT_VARIABLE rm_out
  16. RETURN_VALUE rm_retval
  17. )
  18. IF(NOT "${rm_retval}" STREQUAL 0)
  19. MESSAGE(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"")
  20. ENDIF(NOT "${rm_retval}" STREQUAL 0)
  21. ELSE(EXISTS "$ENV{DESTDIR}${file}")
  22. MESSAGE(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.")
  23. ENDIF(EXISTS "$ENV{DESTDIR}${file}")
  24. ENDFOREACH(file)