Salome HOME
updated copyright message
[modules/shaper.git] / CMakeCommon / cmake_uninstall.cmake.in
1 # Copyright (C) 2014-2023  CEA, EDF
2 #
3 # This library is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU Lesser General Public
5 # License as published by the Free Software Foundation; either
6 # version 2.1 of the License, or (at your option) any later version.
7 #
8 # This library is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 # Lesser General Public License for more details.
12 #
13 # You should have received a copy of the GNU Lesser General Public
14 # License along with this library; if not, write to the Free Software
15 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 #
17 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 #
19
20 if(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
21   message(FATAL_ERROR "Cannot find install manifest: @CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
22 endif(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
23
24 file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files)
25 string(REGEX REPLACE "\n" ";" files "${files}")
26 foreach(file ${files})
27   message(STATUS "Uninstalling $ENV{DESTDIR}${file}")
28   if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
29     exec_program(
30       "@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\""
31       OUTPUT_VARIABLE rm_out
32       RETURN_VALUE rm_retval
33       )
34     if(NOT "${rm_retval}" STREQUAL 0)
35       message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}")
36     endif(NOT "${rm_retval}" STREQUAL 0)
37   else(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
38     message(STATUS "File $ENV{DESTDIR}${file} does not exist.")
39   endif(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
40 endforeach(file)