diff options
| author | Eduard Braun <eduard.braun2@gmx.de> | 2017-07-20 21:46:12 +0000 |
|---|---|---|
| committer | Eduard Braun <eduard.braun2@gmx.de> | 2017-07-20 22:21:55 +0000 |
| commit | fbd2c9a9e0c4633817c7b4f0f61c06582afbb674 (patch) | |
| tree | 89541bf7a106bc7376d537ad9288e784650cb209 /CMakeScripts | |
| parent | cmake: cleanup man page generation (diff) | |
| download | inkscape-fbd2c9a9e0c4633817c7b4f0f61c06582afbb674.tar.gz inkscape-fbd2c9a9e0c4633817c7b4f0f61c06582afbb674.zip | |
cmake: update uninstall target
- update cmake_uninstall.cmake.in from
https://cmake.org/Wiki/CMake_FAQ#Can_I_do_.22make_uninstall.22_with_CMake.3F
and move the file to /CMakeScripts
- on WIN32 simply delete the whole distribution directory
(should be sufficient ant the script version is unbearably slow)
Diffstat (limited to 'CMakeScripts')
| -rw-r--r-- | CMakeScripts/cmake_uninstall.cmake.in | 21 |
1 files changed, 21 insertions, 0 deletions
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) |
