summaryrefslogtreecommitdiff
path: root/cmake/cmake_uninstall.cmake.in
diff options
context:
space:
mode:
authorTom Rondeau <trondeau@vt.edu>2011-10-25 17:28:50 -0400
committerTom Rondeau <trondeau@vt.edu>2011-10-25 17:28:50 -0400
commitd26a6f2e650c22b932352a91f23e572ff18c38b4 (patch)
treeaf0ab55eb781a68c81340a32b7256376330c9b7f /cmake/cmake_uninstall.cmake.in
parent9c853b962d73565f2980789a32f347309bcc605f (diff)
cmake: adding uninstall rule to remove symlinks, too.
I wish this could have been done in a single, compound IF, but cmake didn't like the OR for this one.
Diffstat (limited to 'cmake/cmake_uninstall.cmake.in')
-rw-r--r--cmake/cmake_uninstall.cmake.in9
1 files changed, 9 insertions, 0 deletions
diff --git a/cmake/cmake_uninstall.cmake.in b/cmake/cmake_uninstall.cmake.in
index 6031a6ca98..9ae1ae4bd6 100644
--- a/cmake/cmake_uninstall.cmake.in
+++ b/cmake/cmake_uninstall.cmake.in
@@ -17,6 +17,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 \"$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}")