Extracting the contact's title (this fixes a regression concerning
[libgcal.git] / cmake / cmake_uninstall.cmake.in
blobe3b189bb7cbbbaa76fb0467b68a9467899b9e139
1 # Copied from http://cmake.org/Wiki/CMake_FAQ#Can_I_do_.22make_uninstall.22_with_CMake.3F
3 IF(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
4         MESSAGE(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt\"")
5 ENDIF(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
7 FILE(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files)
8 STRING(REGEX REPLACE "\n" ";" files "${files}")
9 FOREACH(file ${files})
10         MESSAGE(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"")
11         IF(EXISTS "$ENV{DESTDIR}${file}")
12                 EXEC_PROGRAM(
13                         "@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\""
14                         OUTPUT_VARIABLE rm_out
15                         RETURN_VALUE rm_retval
16                 )
17         IF(NOT "${rm_retval}" STREQUAL 0)
18                 MESSAGE(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"")
19         ENDIF(NOT "${rm_retval}" STREQUAL 0)
20         ELSE(EXISTS "$ENV{DESTDIR}${file}")
21                 MESSAGE(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.")
22         ENDIF(EXISTS "$ENV{DESTDIR}${file}")
23 ENDFOREACH(file)