2008-01-02 12:47:09 +01:00
|
|
|
#
|
2015-01-01 09:23:23 +01:00
|
|
|
# Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org>
|
2010-06-22 19:46:28 +02:00
|
|
|
#
|
|
|
|
# This file is part of WeeChat, the extensible chat client.
|
|
|
|
#
|
|
|
|
# WeeChat is free software; you can redistribute it and/or modify
|
2008-01-02 12:47:09 +01:00
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation; either version 3 of the License, or
|
|
|
|
# (at your option) any later version.
|
|
|
|
#
|
2010-06-22 19:46:28 +02:00
|
|
|
# WeeChat is distributed in the hope that it will be useful,
|
2008-01-02 12:47:09 +01:00
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
2010-06-22 19:46:28 +02:00
|
|
|
# along with WeeChat. If not, see <http://www.gnu.org/licenses/>.
|
2008-01-02 12:47:09 +01:00
|
|
|
#
|
|
|
|
|
2014-04-12 18:00:27 +02:00
|
|
|
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()
|
2007-08-18 08:27:32 +00:00
|
|
|
|
2014-04-12 18:00:27 +02:00
|
|
|
file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files)
|
|
|
|
string(REGEX REPLACE "\n" ";" files "${files}")
|
|
|
|
string(REGEX REPLACE ";$" "" files "${files}")
|
|
|
|
list(REVERSE files)
|
|
|
|
foreach(file ${files})
|
|
|
|
message(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"")
|
|
|
|
if(EXISTS "$ENV{DESTDIR}${file}")
|
|
|
|
exec_program("@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\""
|
2013-08-07 10:11:24 +02:00
|
|
|
OUTPUT_VARIABLE rm_out
|
|
|
|
RETURN_VARIABLE rm_retval)
|
2014-04-12 18:00:27 +02:00
|
|
|
if("${rm_retval}" GREATER 0)
|
|
|
|
message(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"")
|
|
|
|
endif()
|
|
|
|
else()
|
|
|
|
message(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.")
|
|
|
|
endif()
|
|
|
|
endforeach(file)
|