From 1160c8625c9070f74ad1a5798e401d1d2cf0b4a2 Mon Sep 17 00:00:00 2001 From: dota17 Date: Thu, 27 Feb 2020 16:00:09 +0800 Subject: [PATCH 1/2] Add uninstall target in cmake --- CMakeLists.txt | 6 ++++++ README.md | 7 ++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c7b5195..fc8d38d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -335,6 +335,12 @@ else (DOXYGEN_FOUND) message("Doxygen need to be installed to generate the doxygen documentation") endif(DOXYGEN_FOUND) +# uninstall +add_custom_target(uninstall + COMMAND cat ${PROJECT_BINARY_DIR}/install_manifest.txt | xargs rm -rf + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} +) + # XXX for a normal full distribution we'll need to figure out # XXX how to build both shared and static libraries. # Probably leverage that to build a local VALGRIND=1 library for testing too. diff --git a/README.md b/README.md index b794fcb..66c6eb9 100644 --- a/README.md +++ b/README.md @@ -230,7 +230,7 @@ JSONC_TEST_TRACE=1 make test ``` and check the log files again. -To get doxygen documentation +To get doxygen documentation: The libray documentation can be generated directly from the source codes using Doxygen tool: @@ -239,6 +239,11 @@ make doc google-chrome ../doc/html/index.html ``` +To uninstall: + +```sh +make uninstall +``` Linking to `libjson-c` ---------------------- From c14c6caa32848d6db4d351d69f92d9a32f9f2896 Mon Sep 17 00:00:00 2001 From: dota17 Date: Wed, 11 Mar 2020 10:47:04 +0800 Subject: [PATCH 2/2] delete -r in uninstall --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fc8d38d..2f7f5d6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -337,7 +337,7 @@ endif(DOXYGEN_FOUND) # uninstall add_custom_target(uninstall - COMMAND cat ${PROJECT_BINARY_DIR}/install_manifest.txt | xargs rm -rf + COMMAND cat ${PROJECT_BINARY_DIR}/install_manifest.txt | xargs rm WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} )