From f259763151095bf98240c333ae364c7ff9a0e77a Mon Sep 17 00:00:00 2001 From: Lambert Clara Date: Wed, 15 Aug 2012 19:57:23 +0200 Subject: [PATCH] Fix removal of symlinks when uninstalling When build shared library is ON, these symlinks were installed but not removed when uninstalling : libglfw.so -> libglfw.so.3 libglfw.so.3 -> libglfw.so.3.0 --- cmake_uninstall.cmake.in | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/cmake_uninstall.cmake.in b/cmake_uninstall.cmake.in index 17376d2e..c8d6f8b9 100644 --- a/cmake_uninstall.cmake.in +++ b/cmake_uninstall.cmake.in @@ -15,6 +15,15 @@ FOREACH(file ${files}) IF(NOT "${rm_retval}" STREQUAL 0) MESSAGE(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"") ENDIF(NOT "${rm_retval}" STREQUAL 0) + ELSEIF(IS_SYMLINK "$ENV{DESTDIR}${file}") + EXEC_PROGRAM( + "@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\"" + OUTPUT_VARIABLE rm_out + RETURN_VALUE rm_retval + ) + IF(NOT "${rm_retval}" STREQUAL 0) + MESSAGE(FATAL_ERROR "Problem when removing symlink \"$ENV{DESTDIR}${file}\"") + ENDIF(NOT "${rm_retval}" STREQUAL 0) ELSE(EXISTS "$ENV{DESTDIR}${file}") MESSAGE(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.") ENDIF(EXISTS "$ENV{DESTDIR}${file}")