Merge pull request #1426 from jsnowy/fixUninstall

Replaced deprecated cmd to fix package uninstall
testing
nightwalker-87 2024-10-03 20:58:08 +02:00 zatwierdzone przez GitHub
commit a548e8304a
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: B5690EEEBB952194
1 zmienionych plików z 11 dodań i 4 usunięć

Wyświetl plik

@ -8,14 +8,21 @@ foreach (file ${files})
message(STATUS "Uninstalling $ENV{DESTDIR}${file}")
if (IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
execute_process(
COMMAND "@CMAKE_COMMAND@" -E remove \"$ENV{DESTDIR}${file}\"
OUTPUT_VARIABLE rm_out
# remove deprecated: use rm instead,
# because it does not check the file path, even return an error.
COMMAND "@CMAKE_COMMAND@" -E rm "$ENV{DESTDIR}${file}"
RESULT_VARIABLE rm_retval
ERROR_VARIABLE rm_err
)
if (NOT "${rm_retval}" STREQUAL 0)
message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}")
message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}\n${rm_err}")
# Detect whether the file has been removed.
elseif (IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
message(FATAL_ERROR "File has not been removed.\n${rm_err}")
else ()
message(STATUS "File has been removed.")
endif ()
else (IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
else ()
message(STATUS "File $ENV{DESTDIR}${file} does not exist.")
endif ()
endforeach ()