Skip to content

Commit

Permalink
Added install and .deb build targets
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Cahill committed Oct 14, 2022
1 parent 5dcd499 commit ea4e398
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,28 @@ target_link_libraries(

fmt
nlohmann_json
)
)

###
# 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 <simon@simonc.eu>")
set(CPACK_PACKAGE_VENDOR "Simon Cahill")
set(CPACK_GENERATOR DEB)
include(CPack)

0 comments on commit ea4e398

Please sign in to comment.