diff options
author | zeshuai007 <51382517@qq.com> | 2020-03-23 16:48:35 +0800 |
---|---|---|
committer | Jens Geyer <jensg@apache.org> | 2020-05-21 12:49:57 +0200 |
commit | 348790deaf633f368a147c413e0f17eb7373a973 (patch) | |
tree | eef011bb30e506902c2072fbc473b4370b3c1b92 | |
parent | 528c22f59d3a35934f4f4308746a78d833b759e8 (diff) | |
download | thrift-348790deaf633f368a147c413e0f17eb7373a973.tar.gz |
THRIFT-5147: Add uninstall function
Patch: Zezeng Wang
This closes #2066
-rw-r--r-- | CMakeLists.txt | 3 | ||||
-rw-r--r-- | README.md | 12 | ||||
-rw-r--r-- | build/cmake/uninstall.cmake | 47 |
3 files changed, 58 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 18e52f638..127ceaf26 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -135,4 +135,7 @@ if(BUILD_HASKELL) endif() endif() +# Create the uninstall target +add_custom_target(uninstall "${CMAKE_COMMAND}" -P "${PROJECT_SOURCE_DIR}/build/cmake/uninstall.cmake") + PRINT_CONFIG_SUMMARY() @@ -163,11 +163,15 @@ where the Python modules are installed, set the PY_PREFIX variable. Make thrift: - make + make From the top directory, become superuser and do: - make install + make install + +Uninstall thrift: + + make uninstall Note that some language packages must be installed manually using build tools better suited to those languages (at the time of this writing, this applies @@ -190,7 +194,7 @@ Testing There are a large number of client library tests that can all be run from the top-level directory. - make -k check + make -k check This will make all of the libraries (as necessary), and run through the unit tests defined in each of the client libraries. If a single @@ -199,7 +203,7 @@ at the end. To run the cross-language test suite, please run: - make cross + make cross This will run a set of tests that use different language clients and servers. diff --git a/build/cmake/uninstall.cmake b/build/cmake/uninstall.cmake new file mode 100644 index 000000000..3842a83df --- /dev/null +++ b/build/cmake/uninstall.cmake @@ -0,0 +1,47 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + +cmake_minimum_required(VERSION 3.4) + +set(MANIFEST "${CMAKE_CURRENT_BINARY_DIR}/install_manifest.txt") + +if(NOT EXISTS ${MANIFEST}) + message(FATAL_ERROR "Cannot find install mainfest: ${MANIFEST}") +endif() + +file(STRINGS ${MANIFEST} files) +foreach(file ${files}) + if(EXISTS ${file} OR IS_SYMLINK ${file}) + message(STATUS "Removing: ${file}") + + execute_process( + COMMAND ${CMAKE_COMMAND} -E remove ${file} + RESULT_VARIABLE result + OUTPUT_QUIET + ERROR_VARIABLE stderr + ERROR_STRIP_TRAILING_WHITESPACE + ) + + if(NOT ${result} EQUAL 0) + message(FATAL_ERROR "${stderr}") + endif() + else() + message(STATUS "Does-not-exist: ${file}") + endif() +endforeach(file) |