]> granicus.if.org Git - json-c/commitdiff
Add uninstall target in cmake
authordota17 <chenguopingdota@163.com>
Thu, 27 Feb 2020 08:00:09 +0000 (16:00 +0800)
committerdota17 <chenguopingdota@163.com>
Thu, 27 Feb 2020 13:02:31 +0000 (21:02 +0800)
CMakeLists.txt
README.md

index c7b5195d9bd1532649b0301f3115a16a1d5d561f..fc8d38d2b0270f5324f4c1c7078762d299c896d0 100644 (file)
@@ -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.
index b794fcb700e8485e872d75109eed6c772fba5851..66c6eb9f03e18125be13f7067ef41422bf3a02ad 100644 (file)
--- 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` <a name="linking">
 ----------------------