CMake: Use CMAKE_CXX_STANDARD to require C++98
[geos.git] / cmake / cmake_uninstall.cmake.in
blob725ab7d083863b3fb626897e520fac29c836b35c
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")
12   message(FATAL_ERROR 
13     "Cannot find install manifest:
14     @CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
15 endif()
17 file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files)
18 string(REGEX REPLACE "\n" ";" files "${files}")
20 set(GEOS_INCLUDE_DIR)
21 foreach(file ${files})
23   if(${file} MATCHES "geos.h")
24     get_filename_component(GEOS_INCLUDE_DIR ${file} PATH)
25   endif()
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.")
31   endif()
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}\"")
38   endif()
39 endforeach()
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}\"")
48 endif()