-
Notifications
You must be signed in to change notification settings - Fork 374
/
Copy pathcmake_uninstall.cmake.in
52 lines (43 loc) · 1.68 KB
/
cmake_uninstall.cmake.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#################################################################################
#
# This file is a part of CMake build configuration of GEOS library
#
# Defines commands used by make uninstall target of CMake build configuration.
#
# Author: Credit to the CMake mailing list archives for providing this solution.
# Modifications: Mateusz Loskot <[email protected]>
#
#################################################################################
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()
file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files)
string(REGEX REPLACE "\n" ";" files "${files}")
set(GEOS_INCLUDE_DIR)
foreach(file ${files})
if(${file} MATCHES "geom.h")
get_filename_component(GEOS_INCLUDE_DIR ${file} PATH)
endif()
message(STATUS "Uninstalling $ENV{DESTDIR}${file}")
if(NOT EXISTS "$ENV{DESTDIR}${file}")
message(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.")
message(STATUS "\tTrying to execute remove command anyway.")
endif()
execute_process(
COMMAND "@CMAKE_COMMAND@" -E remove "$ENV{DESTDIR}${file}"
OUTPUT_VARIABLE rm_out
RESULT_VARIABLE rm_retval)
if(NOT "${rm_retval}" STREQUAL 0)
message(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"")
endif()
endforeach()
message(STATUS "Deleting ${GEOS_INCLUDE_DIR} directory")
execute_process(
COMMAND "@CMAKE_COMMAND@" -E remove_directory "${GEOS_INCLUDE_DIR}"
OUTPUT_VARIABLE rm_out
RESULT_VARIABLE rm_retval)
if(NOT "${rm_retval}" STREQUAL 0)
message(FATAL_ERROR "Problem when removing \"${GEOS_INCLUDE_DIR}\"")
endif()