mirror of
https://github.com/curl/curl.git
synced 2026-08-25 03:13:32 +03:00
cmake: dedupe expressions into local vars in cmake_uninstall.in.cmake
Also: use `IN LISTS` syntax.
Follow-up to 27e2a4733c
Closes #22194
This commit is contained in:
parent
65dae4ad80
commit
b8fa725df3
1 changed files with 10 additions and 8 deletions
|
|
@ -21,8 +21,9 @@
|
||||||
# SPDX-License-Identifier: curl
|
# SPDX-License-Identifier: curl
|
||||||
#
|
#
|
||||||
###########################################################################
|
###########################################################################
|
||||||
if(NOT EXISTS "@PROJECT_BINARY_DIR@/install_manifest.txt")
|
set(_manifest "@PROJECT_BINARY_DIR@/install_manifest.txt")
|
||||||
message(FATAL_ERROR "Cannot find install manifest: @PROJECT_BINARY_DIR@/install_manifest.txt")
|
if(NOT EXISTS "${_manifest}")
|
||||||
|
message(FATAL_ERROR "Cannot find install manifest: ${_manifest}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(NOT DEFINED CMAKE_INSTALL_PREFIX)
|
if(NOT DEFINED CMAKE_INSTALL_PREFIX)
|
||||||
|
|
@ -30,13 +31,14 @@ if(NOT DEFINED CMAKE_INSTALL_PREFIX)
|
||||||
endif()
|
endif()
|
||||||
message(${CMAKE_INSTALL_PREFIX})
|
message(${CMAKE_INSTALL_PREFIX})
|
||||||
|
|
||||||
file(READ "@PROJECT_BINARY_DIR@/install_manifest.txt" _files)
|
file(READ "${_manifest}" _files)
|
||||||
string(REGEX REPLACE "\n" ";" _files "${_files}")
|
string(REGEX REPLACE "\n" ";" _files "${_files}")
|
||||||
foreach(_file ${_files})
|
foreach(_file IN LISTS _files)
|
||||||
message(STATUS "Uninstalling $ENV{DESTDIR}${_file}")
|
set(_target "$ENV{DESTDIR}${_file}")
|
||||||
if(IS_SYMLINK "$ENV{DESTDIR}${_file}" OR EXISTS "$ENV{DESTDIR}${_file}")
|
message(STATUS "Uninstalling ${_target}")
|
||||||
execute_process(COMMAND "@CMAKE_COMMAND@" -E rm -f -- "$ENV{DESTDIR}${_file}")
|
if(IS_SYMLINK "${_target}" OR EXISTS "${_target}")
|
||||||
|
execute_process(COMMAND "@CMAKE_COMMAND@" -E rm -f -- "${_target}")
|
||||||
else()
|
else()
|
||||||
message(STATUS "File does not exist: $ENV{DESTDIR}${_file}")
|
message(STATUS "File does not exist: ${_target}")
|
||||||
endif()
|
endif()
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue