curl/CMake/cmake_uninstall.cmake.in
Viktor Szakats 919394ee64
cmake: more small tidy-ups and fixes
- tidy up two `MATCHES` expression by avoiding macros expansion and
  adding quotes. Then convert then to `STREQUAL` to match other places
  in the code doing the same checks.

- fix setting `_ALL_SOURCE` for AIX to match what autotools does.

- delete stray `_ALL_SOURCE` reference from `lib/config_riscos.h`

- simplify/fix two `STREQUAL ""` checks.
  The one in the `openssl_check_symbol_exists()` macro succeeded
  regardless of the value. The other could return TRUE when
  `CMAKE_OSX_SYSROOT` was undefined.

- delete code for CMake versions (<3.7) we no longer support.

- prefer `LIST(APPEND ...)` to extend `CURL_LIBS`.

- use `CURL_LIBS` to add the `network` lib for Haiku.
  Before this patch it was done via raw C flags. I could not test this.

- move `_WIN32_WINNT`-related code next to each other.
  It also moves detection to the top, allowing more code to use
  the result.

- merge two `WIN32` blocks.

- rename internal variables to underscore + lowercase.

- unwrap a line, indent, whitespace.

Closes #14450
2024-08-08 13:48:28 +02:00

50 lines
1.9 KiB
CMake

#***************************************************************************
# _ _ ____ _
# Project ___| | | | _ \| |
# / __| | | | |_) | |
# | (__| |_| | _ <| |___
# \___|\___/|_| \_\_____|
#
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at https://curl.se/docs/copyright.html.
#
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
# copies of the Software, and permit persons to whom the Software is
# furnished to do so, under the terms of the COPYING file.
#
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
# KIND, either express or implied.
#
# SPDX-License-Identifier: curl
#
###########################################################################
if(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
message(FATAL_ERROR "Cannot find install manifest: @CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
endif()
if(NOT DEFINED CMAKE_INSTALL_PREFIX)
set(CMAKE_INSTALL_PREFIX "@CMAKE_INSTALL_PREFIX@")
endif()
message(${CMAKE_INSTALL_PREFIX})
file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" _files)
string(REGEX REPLACE "\n" ";" _files "${_files}")
foreach(_file ${_files})
message(STATUS "Uninstalling $ENV{DESTDIR}${_file}")
if(IS_SYMLINK "$ENV{DESTDIR}${_file}" OR EXISTS "$ENV{DESTDIR}${_file}")
exec_program(
"@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${_file}\""
OUTPUT_VARIABLE rm_out
RETURN_VALUE rm_retval
)
if(NOT "${rm_retval}" STREQUAL 0)
message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${_file}")
endif()
else()
message(STATUS "File $ENV{DESTDIR}${_file} does not exist.")
endif()
endforeach()