You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ament_cmake_uninstall_target.cmake 2.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. # generated from
  2. # ament_cmake_core/cmake/uninstall_target/ament_cmake_uninstall_target.cmake.in
  3. function(ament_cmake_uninstall_target_remove_empty_directories path)
  4. set(install_space "/home/ros2/dev2_ws/install/aruco_interfaces")
  5. if(install_space STREQUAL "")
  6. message(FATAL_ERROR "The CMAKE_INSTALL_PREFIX variable must not be empty")
  7. endif()
  8. string(LENGTH "${install_space}" length)
  9. string(SUBSTRING "${path}" 0 ${length} path_prefix)
  10. if(NOT path_prefix STREQUAL install_space)
  11. message(FATAL_ERROR "The path '${path}' must be within the install space '${install_space}'")
  12. endif()
  13. if(path STREQUAL install_space)
  14. return()
  15. endif()
  16. # check if directory is empty
  17. file(GLOB files "${path}/*")
  18. list(LENGTH files length)
  19. if(length EQUAL 0)
  20. message(STATUS "Uninstalling: ${path}/")
  21. execute_process(COMMAND "/usr/bin/cmake" "-E" "remove_directory" "${path}")
  22. # recursively try to remove parent directories
  23. get_filename_component(parent_path "${path}" PATH)
  24. ament_cmake_uninstall_target_remove_empty_directories("${parent_path}")
  25. endif()
  26. endfunction()
  27. # uninstall files installed using the standard install() function
  28. set(install_manifest "/home/ros2/dev2_ws/build/aruco_interfaces/install_manifest.txt")
  29. if(NOT EXISTS "${install_manifest}")
  30. message(FATAL_ERROR "Cannot find install manifest: ${install_manifest}")
  31. endif()
  32. file(READ "${install_manifest}" installed_files)
  33. string(REGEX REPLACE "\n" ";" installed_files "${installed_files}")
  34. foreach(installed_file ${installed_files})
  35. if(EXISTS "${installed_file}" OR IS_SYMLINK "${installed_file}")
  36. message(STATUS "Uninstalling: ${installed_file}")
  37. file(REMOVE "${installed_file}")
  38. if(EXISTS "${installed_file}" OR IS_SYMLINK "${installed_file}")
  39. message(FATAL_ERROR "Failed to remove '${installed_file}'")
  40. endif()
  41. # remove empty parent folders
  42. get_filename_component(parent_path "${installed_file}" PATH)
  43. ament_cmake_uninstall_target_remove_empty_directories("${parent_path}")
  44. endif()
  45. endforeach()
  46. # end of template
  47. message(STATUS "Execute custom uninstall script")
  48. # begin of custom uninstall code