2019-05-05 16:50:10 +00:00
|
|
|
cmake_minimum_required(VERSION 3.7)
|
2019-08-01 19:19:02 +00:00
|
|
|
project(iprefresher VERSION 1.0.1 DESCRIPTION "Dynu ip refresher")
|
2019-05-01 09:14:52 +00:00
|
|
|
|
2019-08-01 18:18:39 +00:00
|
|
|
set(CMAKE_CXX_STANDARD 17)
|
2019-05-01 09:14:52 +00:00
|
|
|
|
2019-08-01 20:31:58 +00:00
|
|
|
#set(CMAKE_BUILD_TYPE Release) # manually set build type
|
|
|
|
|
2019-05-01 09:14:52 +00:00
|
|
|
find_package(CURL REQUIRED)
|
2019-08-01 19:19:02 +00:00
|
|
|
include_directories(${CURL_INCLUDE_DIR} inc)
|
2019-05-01 09:14:52 +00:00
|
|
|
|
2019-08-01 18:18:39 +00:00
|
|
|
add_library(api
|
2019-05-08 17:19:42 +00:00
|
|
|
src/api/API.cpp
|
|
|
|
|
|
|
|
|
|
|
|
src/api/TelegramAPI.cpp
|
2019-06-18 09:23:24 +00:00
|
|
|
|
|
|
|
src/api/DynuAPI.cpp
|
2019-08-01 18:18:39 +00:00
|
|
|
|
|
|
|
src/api/IPAPI.cpp
|
|
|
|
)
|
|
|
|
|
|
|
|
add_library(logger
|
|
|
|
src/Logger.cpp
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
set(SOURCE
|
|
|
|
src/main.cpp
|
2019-08-02 20:44:42 +00:00
|
|
|
src/IPRefresher.cpp inc/IPRefresher.h)
|
2019-05-05 13:38:48 +00:00
|
|
|
|
|
|
|
add_executable(iprefresher ${SOURCE})
|
2019-08-01 19:19:02 +00:00
|
|
|
|
|
|
|
# LINK generated LIBS #
|
2019-08-01 18:18:39 +00:00
|
|
|
target_link_libraries(iprefresher api logger ${CURL_LIBRARIES} )
|
2019-05-01 09:14:52 +00:00
|
|
|
|
2019-08-01 19:19:02 +00:00
|
|
|
# INSTALL to SYSTEM #
|
2019-05-10 19:37:08 +00:00
|
|
|
install (TARGETS iprefresher DESTINATION bin)
|
2019-10-23 11:18:43 +00:00
|
|
|
install(FILES ./iprefresher.service DESTINATION /lib/systemd/system/)
|
2019-10-23 07:24:35 +00:00
|
|
|
|
|
|
|
SET(CPACK_DEB_COMPONENT_INSTALL 1)
|
|
|
|
|
|
|
|
IF (UNIX)
|
|
|
|
|
|
|
|
SET(CPACK_CMAKE_GENERATOR "Unix Makefiles")
|
|
|
|
SET(CPACK_SOURCE_GENERATOR "TGZ;TBZ2")
|
|
|
|
SET(CPACK_GENERATOR "TGZ;TBZ2;DEB;RPM")
|
|
|
|
SET(CPACK_PACKAGE_DESCRIPTION "IPrefresher to refresh Dynu ip address and notify user via Telegram")
|
|
|
|
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "IPrefresher to refresh Dynu ip address and notify user via Telegram")
|
|
|
|
SET(CPACK_PACKAGE_VENDOR "Lukas Heilgienbrunner")
|
2019-10-23 07:32:33 +00:00
|
|
|
SET(CPACK_PACKAGE_VERSION_MAJOR "1")
|
|
|
|
SET(CPACK_PACKAGE_VERSION_MINOR "2")
|
2019-10-23 07:24:35 +00:00
|
|
|
SET(CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}")
|
|
|
|
SET(CPACK_SOURCE_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}-${CPACK_PACKAGE_VERSION}")
|
|
|
|
SET(CPACK_PACKAGE_CONTACT "Lukas Heiligenbrunner <ultimategameingcookie@gmail.com>")
|
|
|
|
SET(CPACK_PACKAGE_SECTION "games")
|
|
|
|
INCLUDE(CPack)
|
|
|
|
|
|
|
|
ENDIF (UNIX)
|
|
|
|
|
|
|
|
add_custom_target(build-linux-packages
|
|
|
|
"${CMAKE_COMMAND}" --build "${CMAKE_BINARY_DIR}" --target package
|
|
|
|
DEPENDS ${PROJECT_NAME}
|
|
|
|
COMMENT "Installing ${PROJECT_NAME}")
|
|
|
|
|