3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-08-25 20:46:01 +00:00
z3/test-cmake/cmake_uninstall.cmake
copilot-swe-agent[bot] 4e51949669 Create VERSION.txt and update CMakeLists.txt to read version from file
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
2025-08-20 15:45:25 +00:00

24 lines
971 B
CMake

if(NOT EXISTS "/home/runner/work/z3/z3/test-cmake/install_manifest.txt")
message(FATAL_ERROR "Cannot find install manifest: "
"/home/runner/work/z3/z3/test-cmake/install_manifest.txt")
endif()
file(READ "/home/runner/work/z3/z3/test-cmake/install_manifest.txt" files)
string(REGEX REPLACE "\n" ";" files "${files}")
foreach(file ${files})
set(_full_file_path "$ENV{DESTDIR}${file}")
message(STATUS "Uninstalling ${_full_file_path}")
if(IS_SYMLINK "${_full_file_path}" OR EXISTS "${_full_file_path}")
# We could use ``file(REMOVE ...)`` here but then we wouldn't
# know if the removal failed.
execute_process(COMMAND
"/usr/local/bin/cmake" "-E" "remove" "${_full_file_path}"
RESULT_VARIABLE rm_retval
)
if(NOT "${rm_retval}" STREQUAL 0)
message(FATAL_ERROR "Problem when removing \"${_full_file_path}\"")
endif()
else()
message(STATUS "File \"${_full_file_path}\" does not exist.")
endif()
endforeach()