summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Jeanmougin <marc@jeanmougin.fr>2017-07-20 23:10:37 +0000
committerMarc Jeanmougin <marc@jeanmougin.fr>2017-07-20 23:10:37 +0000
commit3c0fb8f0a06b1a3fe7fe94259b48558aeaa2845d (patch)
tree079d0b7cf5d8662663c04f7a85cdc9c3339be9f7
parentTry to fix CI (diff)
parentcmake: update uninstall target (diff)
downloadinkscape-3c0fb8f0a06b1a3fe7fe94259b48558aeaa2845d.tar.gz
inkscape-3c0fb8f0a06b1a3fe7fe94259b48558aeaa2845d.zip
Merge branch 'master' of gitlab.com:inkscape/inkscape
-rw-r--r--CMakeLists.txt20
-rw-r--r--CMakeScripts/cmake_uninstall.cmake.in21
-rw-r--r--cmake_uninstall.cmake.in23
3 files changed, 33 insertions, 31 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index fec795c48..4a07a8456 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -177,13 +177,17 @@ add_custom_target(dist
# -----------------------------------------------------------------------------
# Uninstall Target
# -----------------------------------------------------------------------------
-configure_file(
- "${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
- "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
- IMMEDIATE @ONLY)
-
-add_custom_target(uninstall
- "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")
+if(WIN32)
+ add_custom_target(uninstall
+ "${CMAKE_COMMAND}" -E remove_directory "${CMAKE_INSTALL_PREFIX}")
+else()
+ configure_file(
+ "${CMAKE_SOURCE_DIR}/CMakeScripts/cmake_uninstall.cmake.in"
+ "${CMAKE_BINARY_DIR}/cmake_uninstall.cmake"
+ @ONLY)
+ add_custom_target(uninstall
+ "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")
+endif()
# -----------------------------------------------------------------------------
@@ -198,7 +202,7 @@ endif(ENABLE_NLS)
if(NOT WIN32)
include(CMakeScripts/Pod2man.cmake)
add_subdirectory(man)
-endif(NOT WIN32)
+endif()
# -----------------------------------------------------------------------------
# Installation
diff --git a/CMakeScripts/cmake_uninstall.cmake.in b/CMakeScripts/cmake_uninstall.cmake.in
new file mode 100644
index 000000000..2037e3653
--- /dev/null
+++ b/CMakeScripts/cmake_uninstall.cmake.in
@@ -0,0 +1,21 @@
+if(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
+ message(FATAL_ERROR "Cannot find install manifest: @CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
+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}")
+foreach(file ${files})
+ message(STATUS "Uninstalling $ENV{DESTDIR}${file}")
+ if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$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(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
+ message(STATUS "File $ENV{DESTDIR}${file} does not exist.")
+ endif(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
+endforeach(file)
diff --git a/cmake_uninstall.cmake.in b/cmake_uninstall.cmake.in
deleted file mode 100644
index cd2001a16..000000000
--- a/cmake_uninstall.cmake.in
+++ /dev/null
@@ -1,23 +0,0 @@
-IF(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
- MESSAGE(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt\"")
-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}")
-FOREACH(file ${files})
- 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_VALUE rm_retval
- )
- IF("${rm_retval}" STREQUAL 0)
- ELSE("${rm_retval}" STREQUAL 0)
- MESSAGE(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"")
- ENDIF("${rm_retval}" STREQUAL 0)
- ELSE(EXISTS "$ENV{DESTDIR}${file}")
- MESSAGE(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.")
- ENDIF(EXISTS "$ENV{DESTDIR}${file}")
-ENDFOREACH(file)
-