diff options
author | jasjuang <jasjuang@gmail.com> | 2016-07-21 12:04:41 -0700 |
---|---|---|
committer | jasjuang <jasjuang@gmail.com> | 2016-07-21 12:04:41 -0700 |
commit | 9376bde1beba649e4c522b742064223ac9d2cab4 (patch) | |
tree | 2155d1e63239bc2968b4c969dc82e2895ce723ed /cmake | |
parent | 42cd785e4b5ed824a9b2a02a19aa534042b64325 (diff) | |
download | caffe-9376bde1beba649e4c522b742064223ac9d2cab4.tar.gz caffe-9376bde1beba649e4c522b742064223ac9d2cab4.tar.bz2 caffe-9376bde1beba649e4c522b742064223ac9d2cab4.zip |
add in sudo make uninstall for cmake
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/Uninstall.cmake.in | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/cmake/Uninstall.cmake.in b/cmake/Uninstall.cmake.in new file mode 100644 index 00000000..bb8e2964 --- /dev/null +++ b/cmake/Uninstall.cmake.in @@ -0,0 +1,26 @@ +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") + +if (NOT DEFINED CMAKE_INSTALL_PREFIX) + set (CMAKE_INSTALL_PREFIX "@CMAKE_INSTALL_PREFIX@") +endif () + message(${CMAKE_INSTALL_PREFIX}) + +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)
\ No newline at end of file |