From c4c1e2ebf9f4757dd1eb705dfbc4ff24bd09549c Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Mon, 26 Jan 2026 15:52:03 +0500 Subject: [PATCH] cmake_uninstall - simplify by using common variable --- cmake/cmake_uninstall.cmake.in | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/cmake/cmake_uninstall.cmake.in b/cmake/cmake_uninstall.cmake.in index 012b1c0859..d6e6464f87 100644 --- a/cmake/cmake_uninstall.cmake.in +++ b/cmake/cmake_uninstall.cmake.in @@ -25,13 +25,14 @@ file(READ "@CMAKE_BINARY_DIR@/install_manifest.txt" files) string(REGEX REPLACE "\n" ";" files "${files}") foreach(file ${files}) - message(STATUS "Uninstalling $ENV{DESTDIR}${file}") + set(filepath "$ENV{DESTDIR}${file}") + message(STATUS "Uninstalling ${filepath}") - if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") + if(IS_SYMLINK "${filepath}" OR EXISTS "${filepath}") exec_program( "@CMAKE_COMMAND@" ARGS - "-E remove \"$ENV{DESTDIR}${file}\"" + "-E remove \"${filepath}\"" OUTPUT_VARIABLE rm_out RETURN_VALUE @@ -39,9 +40,9 @@ foreach(file ${files}) ) if(NOT "${rm_retval}" STREQUAL 0) - message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}") + message(FATAL_ERROR "Problem when removing ${filepath}") endif() - else(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") - message(STATUS "File $ENV{DESTDIR}${file} does not exist.") + else(IS_SYMLINK "${filepath}" OR EXISTS "${filepath}") + message(STATUS "File ${filepath} does not exist.") endif() endforeach()