summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2013-08-07 10:11:24 +0200
committerSebastien Helleu <flashcode@flashtux.org>2013-08-07 10:11:24 +0200
commite8122773b8b9c2661a9234f80ecc0998029bb995 (patch)
tree25b561c21b4a8fdf5db49b6f019aa58716983a30
parente5de0cd0e89d35a6e7be03da6e756c2396701a1b (diff)
downloadweechat-e8122773b8b9c2661a9234f80ecc0998029bb995.zip
core: use $DESTDIR on make uninstall with cmake
-rw-r--r--cmake/cmake_uninstall.cmake.in25
1 files changed, 12 insertions, 13 deletions
diff --git a/cmake/cmake_uninstall.cmake.in b/cmake/cmake_uninstall.cmake.in
index 19c8d37bf..41cc88ab4 100644
--- a/cmake/cmake_uninstall.cmake.in
+++ b/cmake/cmake_uninstall.cmake.in
@@ -23,18 +23,17 @@ ENDIF(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
FILE(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files)
STRING(REGEX REPLACE "\n" ";" files "${files}")
+LIST(REVERSE files)
FOREACH(file ${files})
- MESSAGE(STATUS "Uninstalling \"${file}\"")
- IF(NOT EXISTS "${file}")
- MESSAGE(FATAL_ERROR "File \"${file}\" does not exists.")
- ENDIF(NOT EXISTS "${file}")
- EXEC_PROGRAM("@CMAKE_COMMAND@" ARGS "-E remove \"${file}\""
- OUTPUT_VARIABLE rm_out
- RETURN_VARIABLE rm_retval)
- IF("${rm_retval}" GREATER 0)
- MESSAGE(FATAL_ERROR "Problem when removing \"${file}\"")
- ENDIF("${rm_retval}" GREATER 0)
+ MESSAGE(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"")
+ IF(EXISTS "$ENV{DESTDIR}${file}")
+ EXEC_PROGRAM("@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\""
+ OUTPUT_VARIABLE rm_out
+ RETURN_VARIABLE rm_retval)
+ IF("${rm_retval}" GREATER 0)
+ MESSAGE(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"")
+ ENDIF("${rm_retval}" GREATER 0)
+ ELSE(EXISTS "$ENV{DESTDIR}${file}")
+ MESSAGE(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.")
+ ENDIF(EXISTS "$ENV{DESTDIR}${file}")
ENDFOREACH(file)
-
-
-