From 4503c7e6287e4204af946c9aa6e669f76c9b8289 Mon Sep 17 00:00:00 2001 From: Nicholas Corgan Date: Wed, 29 Jun 2016 15:30:43 -0700 Subject: cmake: "make uninstall" now removes symlinks (CMake 2.8.1 and above) --- host/cmake/cmake_uninstall.cmake.in | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'host/cmake/cmake_uninstall.cmake.in') diff --git a/host/cmake/cmake_uninstall.cmake.in b/host/cmake/cmake_uninstall.cmake.in index 6031a6ca9..b4d731a14 100644 --- a/host/cmake/cmake_uninstall.cmake.in +++ b/host/cmake/cmake_uninstall.cmake.in @@ -17,6 +17,17 @@ 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(NOT "${CMAKE_VERSION}" STRLESS "2.8.1") + IF(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 \"$ENV{DESTDIR}${file}\"") + ENDIF(NOT "${rm_retval}" STREQUAL 0) + ENDIF(IS_SYMLINK "$ENV{DESTDIR}${file}") ELSE(EXISTS "$ENV{DESTDIR}${file}") MESSAGE(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.") ENDIF(EXISTS "$ENV{DESTDIR}${file}") -- cgit v1.2.3