mirror of https://github.com/Gnucash/gnucash
Instead of execute_process. It's more portable long-term.pull/2062/head
parent
618cd55826
commit
b5c1937702
@ -0,0 +1,19 @@
|
||||
# This is taken from https://cmake.org/Wiki/CMake_FAQ#Can_I_do_.22make_uninstall.22_with_CMake.3F
|
||||
|
||||
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()
|
||||
|
||||
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}")
|
||||
file(REMOVE "$ENV{DESTDIR}${file}")
|
||||
if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
|
||||
message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}")
|
||||
endif()
|
||||
else()
|
||||
message(STATUS "File $ENV{DESTDIR}${file} does not exist.")
|
||||
endif()
|
||||
endforeach(file)
|
||||
@ -1,13 +0,0 @@
|
||||
#!/bin/sh
|
||||
if [ ! -s install_manifest.txt ]; then
|
||||
echo "Error: No install manifest."
|
||||
fi
|
||||
while IFS= read -r filename; do
|
||||
if [ -e $filename ]; then
|
||||
echo "--Uninstalling $filename"
|
||||
rm $filename
|
||||
else
|
||||
echo "--$filename not found"
|
||||
fi
|
||||
done<install_manifest.txt
|
||||
|
||||
Loading…
Reference in new issue