uninstall.cmake 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. ## ======================================================================== ##
  2. ## Copyright 2009-2015 Intel Corporation ##
  3. ## ##
  4. ## Licensed under the Apache License, Version 2.0 (the "License"); ##
  5. ## you may not use this file except in compliance with the License. ##
  6. ## You may obtain a copy of the License at ##
  7. ## ##
  8. ## http://www.apache.org/licenses/LICENSE-2.0 ##
  9. ## ##
  10. ## Unless required by applicable law or agreed to in writing, software ##
  11. ## distributed under the License is distributed on an "AS IS" BASIS, ##
  12. ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ##
  13. ## See the License for the specific language governing permissions and ##
  14. ## limitations under the License. ##
  15. ## ======================================================================== ##
  16. IF(NOT EXISTS "/home/thuemmel/libs/libigl/build2/embree/install_manifest.txt")
  17. MESSAGE(FATAL_ERROR "Cannot find install manifest: /home/thuemmel/libs/libigl/build2/embree/install_manifest.txt")
  18. ENDIF(NOT EXISTS "/home/thuemmel/libs/libigl/build2/embree/install_manifest.txt")
  19. FILE(READ "/home/thuemmel/libs/libigl/build2/embree/install_manifest.txt" files)
  20. STRING(REGEX REPLACE "\n" ";" files "${files}")
  21. FOREACH(file ${files})
  22. MESSAGE(STATUS "Uninstalling $ENV{DESTDIR}${file}")
  23. IF(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
  24. EXEC_PROGRAM(
  25. "/usr/bin/cmake" ARGS "-E remove \"$ENV{DESTDIR}${file}\""
  26. OUTPUT_VARIABLE rm_out
  27. RETURN_VALUE rm_retval
  28. )
  29. IF(NOT "${rm_retval}" STREQUAL 0)
  30. MESSAGE(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}")
  31. ENDIF(NOT "${rm_retval}" STREQUAL 0)
  32. ELSE(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
  33. MESSAGE(STATUS "File $ENV{DESTDIR}${file} does not exist.")
  34. ENDIF(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
  35. ENDFOREACH(file)