diff options
| author | Haibo Huang <hhb@google.com> | 2020-07-14 18:31:56 +0000 |
|---|---|---|
| committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2020-07-14 18:31:56 +0000 |
| commit | 884d7a39094e590c9dc58f865b068f40694c6a49 (patch) | |
| tree | 53915fc3eafdda183ab94c84e85ad7d7107afc6a /cmake/Uninstall.cmake.in | |
| parent | c4d7c4bdab4c5587b42073d60fb6aca6e335d76e (diff) | |
| parent | 023ea039b9fada42e0cbbefcd75858a855a6130a (diff) | |
| download | platform_external_libevent-master.tar.gz platform_external_libevent-master.tar.bz2 platform_external_libevent-master.zip | |
Original change: https://android-review.googlesource.com/c/platform/external/libevent/+/1360893
Change-Id: Iee716ec96a55737a04463c7b84c929c2e6418c54
Diffstat (limited to 'cmake/Uninstall.cmake.in')
| -rw-r--r-- | cmake/Uninstall.cmake.in | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/cmake/Uninstall.cmake.in b/cmake/Uninstall.cmake.in new file mode 100644 index 0000000..c6dc09e --- /dev/null +++ b/cmake/Uninstall.cmake.in @@ -0,0 +1,23 @@ +# https://gitlab.kitware.com/cmake/community/wikis/FAQ#can-i-do-make-uninstall-with-cmake + +if(NOT EXISTS "@CMAKE_BINARY_DIR@/install_manifest.txt") + message(FATAL_ERROR "Cannot find install manifest: @CMAKE_BINARY_DIR@/install_manifest.txt") +endif(NOT EXISTS "@CMAKE_BINARY_DIR@/install_manifest.txt") + +file(READ "@CMAKE_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) |
