From 48e2df5d0474a5fdee52124835fef3430a783b5b Mon Sep 17 00:00:00 2001 From: Lukasz Biegaj Date: Sat, 30 Apr 2022 20:41:51 +0200 Subject: [PATCH] Uninstallation target for CMake Why: * Users are requesting uninstallation method * https://github.com/DanielOgorchock/joycond/issues/93 This change addresses the need by: * CMake target for uninstall * An install_manifest.txt is used to revert changes * Uninstall steps are described in README.md --- CMakeLists.txt | 9 +++++++++ README.md | 5 +++++ 2 files changed, 14 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index f9d6e93..2ce4cc6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -37,3 +37,12 @@ install(FILES systemd/joycond.service DESTINATION /etc/systemd/system install(FILES systemd/joycond.conf DESTINATION /etc/modules-load.d PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ ) + +add_custom_target("uninstall" COMMENT "Uninstall installed files") +add_custom_command( + TARGET "uninstall" + POST_BUILD + COMMENT "Uninstall files with install_manifest.txt" + COMMAND xargs rm -vf < install_manifest.txt || echo Nothing in + install_manifest.txt to be uninstalled! +) diff --git a/README.md b/README.md index d928afa..a25c614 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,11 @@ hid-nintendo is currently in review on the linux-input mailing list. The most re 4. `sudo make install` 5. `sudo systemctl enable --now joycond` +# Uninstallation + +1. `sudo systemctl disable --now joycond` +2. `sudo make uninstall` + # Usage When a joy-con or pro controller is connected via bluetooth or USB, the player LEDs should start blinking periodically. This signals that the controller is in pairing mode.