# sleep_on_lan / remote reboot and shutdown over LAN # # Copyright (C) 2018, Daniel Vogel, # # Last Update: $Id$ # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 3 # of the license, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the license along with this # program. If not, see . cmake_minimum_required(VERSION 3.10) project(nethaltd CXX) set(${PROJECT_NAME}_VERSION_MAJOR 1) set(${PROJECT_NAME}_VERSION_MINOR 0) set(${PROJECT_NAME}_VERSION_PATCH 2) find_package(Boost 1.81.0 COMPONENTS system thread program_options chrono date_time log filesystem) set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra") set(HEADER ${CMAKE_CURRENT_SOURCE_DIR}/inc/request.hpp ${CMAKE_CURRENT_SOURCE_DIR}/inc/server.hpp ${CMAKE_CURRENT_SOURCE_DIR}/inc/daemon.hpp) set(SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/src/main.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/request.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/server.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/daemon.cpp) configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/inc/config.hpp.in ${CMAKE_CURRENT_BINARY_DIR}/inc/config.hpp) add_executable(${PROJECT_NAME} ${SOURCE} ${HEADER}) target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/inc ${CMAKE_CURRENT_BINARY_DIR}/inc) target_link_libraries(${PROJECT_NAME} PUBLIC Boost::boost Boost::system Boost::thread Boost::program_options Boost::chrono Boost::date_time Boost::log Boost::filesystem pthread) target_compile_definitions(${PROJECT_NAME} PUBLIC BOOST_LOG_DYN_LINK) install(TARGETS ${PROJECT_NAME} DESTINATION bin)