1 #################################################################################
3 # This file is a part of CMake build configuration of GEOS library
5 # Defines commands used by make uninstall target of CMake build configuration.
7 # Author: Credit to the CMake mailing list archives for providing this solution.
8 # Modifications: Mateusz Loskot <mateusz@loskot.net>
10 #################################################################################
11 if(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
13 "Cannot find install manifest:
14 @CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
17 file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files)
18 string(REGEX REPLACE "\n" ";" files "${files}")
21 foreach(file ${files})
23 if(${file} MATCHES "geos.h")
24 get_filename_component(GEOS_INCLUDE_DIR ${file} PATH)
27 message(STATUS "Uninstalling $ENV{DESTDIR}${file}")
28 if(NOT EXISTS "$ENV{DESTDIR}${file}")
29 message(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.")
30 message(STATUS "\tTrying to execute remove command anyway.")
33 exec_program("@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\""
34 OUTPUT_VARIABLE rm_out
35 RETURN_VALUE rm_retval)
36 if(NOT "${rm_retval}" STREQUAL 0)
37 message(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"")
41 message(STATUS "Deleting ${GEOS_INCLUDE_DIR} directory")
42 exec_program("@CMAKE_COMMAND@"
43 ARGS "-E remove_directory \"${GEOS_INCLUDE_DIR}\""
44 OUTPUT_VARIABLE rm_out
45 RETURN_VALUE rm_retval)
46 if(NOT "${rm_retval}" STREQUAL 0)
47 message(FATAL_ERROR "Problem when removing \"${GEOS_INCLUDE_DIR}\"")