From ea4e398ba777186f4fca26ce04be02079a9fab33 Mon Sep 17 00:00:00 2001 From: Simon Cahill Date: Fri, 14 Oct 2022 23:57:20 +0200 Subject: [PATCH] Added install and .deb build targets --- CMakeLists.txt | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0908adc..100e3f5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -57,4 +57,28 @@ target_link_libraries( fmt nlohmann_json -) \ No newline at end of file +) + +### +# Install and Remove targets and their configs go here +### +set(fail2abuseipdb_INSTALL_DIR "/usr/local/bin") + +install( + TARGETS ${PROJECT_NAME} + RUNTIME DESTINATION ${fail2abuseipdb_INSTALL_DIR} +) + +add_custom_target("uninstall" COMMENT "Uninstall fail2abuseipdb") +add_custom_command( + TARGET "uninstall" + POST_BUILD + COMMENT "Uninstall fail2abuseipdb from the current system" + COMMAND xargs rm -Rfv < install_manifest.txt || echo "Nothing to be removed from system!" +) + +set(CPACK_PACKAGE_NAME ${PROJECT_NAME}) +set(CPACK_PACKAGE_CONTACT "Simon Cahill ") +set(CPACK_PACKAGE_VENDOR "Simon Cahill") +set(CPACK_GENERATOR DEB) +include(CPack) \ No newline at end of file