From: Ludwig Jäck Date: Wed, 10 Apr 2024 14:23:55 +0000 (+0200) Subject: Update pingcheck to work with cmake 3.28 X-Git-Url: http://developer.intra2net.com/git/?p=pingcheck;a=commitdiff_plain Update pingcheck to work with cmake 3.28 Most prominent change: The way the boost libraries get linked. --- diff --git a/CMakeLists.txt b/CMakeLists.txt index b5e89d8..24d4d58 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,3 +1,5 @@ +cmake_minimum_required(VERSION 3.28 FATAL_ERROR) + # project: definitions project(pingcheck) set(VERSION 0.8) @@ -6,7 +8,6 @@ set(TARGET ${PROJECT_NAME}) # cmake: build options set(CMAKE_COLOR_MAKEFILE ON) -cmake_minimum_required(VERSION 2.6 FATAL_ERROR) # compiler: add definitions and arguments to the compiler add_definitions( diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 268d58f..1ba31c9 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -5,9 +5,8 @@ include(FindPkgConfig) set(Boost_USE_STATIC_LIBS OFF) set(Boost_USE_MULTITHREADED OFF) set(Boost_USE_STATIC_RUNTIME OFF) + find_package(Boost 1.44 COMPONENTS filesystem program_options system serialization date_time REQUIRED) -include_directories(${Boost_INCLUDE_DIRS}) -link_directories(${Boost_LIBRARY_DIRS}) # package: boost-custom include_directories(${CMAKE_SOURCE_DIR}/lib/boost-custom) @@ -126,7 +125,11 @@ add_executable(${TARGET} ${SOURCES}) # linker: link the program against the libraries target_link_libraries( ${TARGET} - ${Boost_LIBRARIES} + Boost::filesystem + Boost::program_options + Boost::system + Boost::serialization + Boost::date_time ${I2NCOMMON_LIBRARIES} pthread ) @@ -145,7 +148,11 @@ add_executable(feed_packet_data ${feed_packet_data_SOURCES}) target_link_libraries( feed_packet_data lib_for_tools - ${Boost_LIBRARIES} + Boost::filesystem + Boost::program_options + Boost::system + Boost::serialization + Boost::date_time ${I2NCOMMON_LIBRARIES} ) # no install! install(TARGETS feed_packet_data DESTINATION bin) diff --git a/test/CMakeLists.test_configurationcommandline.txt b/test/CMakeLists.test_configurationcommandline.txt index a6508b7..c2e1f0c 100644 --- a/test/CMakeLists.test_configurationcommandline.txt +++ b/test/CMakeLists.test_configurationcommandline.txt @@ -42,7 +42,11 @@ add_executable(test_configurationcommandline target_link_libraries( test_configurationcommandline ${I2NCOMMON_LIBRARIES} - ${Boost_LIBRARIES} + Boost::unit_test_framework + Boost::system + Boost::program_options + Boost::date_time + Boost::serialization pthread ) diff --git a/test/CMakeLists.test_configurationfile.txt b/test/CMakeLists.test_configurationfile.txt index 0dad829..791ec63 100644 --- a/test/CMakeLists.test_configurationfile.txt +++ b/test/CMakeLists.test_configurationfile.txt @@ -42,7 +42,11 @@ add_executable(test_configurationfile target_link_libraries( test_configurationfile ${I2NCOMMON_LIBRARIES} - ${Boost_LIBRARIES} + Boost::unit_test_framework + Boost::system + Boost::program_options + Boost::date_time + Boost::serialization pthread ) diff --git a/test/CMakeLists.test_configurationoptions.txt b/test/CMakeLists.test_configurationoptions.txt index faa41b5..5770f37 100644 --- a/test/CMakeLists.test_configurationoptions.txt +++ b/test/CMakeLists.test_configurationoptions.txt @@ -40,7 +40,11 @@ add_executable(test_configurationoptions target_link_libraries( test_configurationoptions ${I2NCOMMON_LIBRARIES} - ${Boost_LIBRARIES} + Boost::unit_test_framework + Boost::system + Boost::program_options + Boost::date_time + Boost::serialization pthread ) diff --git a/test/CMakeLists.test_dns.txt b/test/CMakeLists.test_dns.txt index 5620a6a..93b3da1 100644 --- a/test/CMakeLists.test_dns.txt +++ b/test/CMakeLists.test_dns.txt @@ -30,7 +30,11 @@ include_directories(${CMAKE_SOURCE_DIR}/lib/boost-net-dns) target_link_libraries( test_dns ${I2NCOMMON_LIBRARIES} - ${Boost_LIBRARIES} + Boost::unit_test_framework + Boost::system + Boost::program_options + Boost::date_time + Boost::serialization pthread ) diff --git a/test/CMakeLists.test_hoststatus.txt b/test/CMakeLists.test_hoststatus.txt index e60c237..420a155 100644 --- a/test/CMakeLists.test_hoststatus.txt +++ b/test/CMakeLists.test_hoststatus.txt @@ -10,7 +10,11 @@ add_executable(test_hoststatus target_link_libraries( test_hoststatus ${I2NCOMMON_LIBRARIES} - ${Boost_LIBRARIES} + Boost::unit_test_framework + Boost::system + Boost::program_options + Boost::date_time + Boost::serialization pthread ) diff --git a/test/CMakeLists.test_icmppacket.txt b/test/CMakeLists.test_icmppacket.txt index 19a2471..921d7f2 100644 --- a/test/CMakeLists.test_icmppacket.txt +++ b/test/CMakeLists.test_icmppacket.txt @@ -32,7 +32,11 @@ link_directories(${Boost_LIBRARY_DIRS}) target_link_libraries( test_icmppacket ${I2NCOMMON_LIBRARIES} - ${Boost_LIBRARIES} + Boost::unit_test_framework + Boost::system + Boost::program_options + Boost::date_time + Boost::serialization pthread ) diff --git a/test/CMakeLists.test_icmpv4header.txt b/test/CMakeLists.test_icmpv4header.txt index 59b3e83..5ecfa32 100644 --- a/test/CMakeLists.test_icmpv4header.txt +++ b/test/CMakeLists.test_icmpv4header.txt @@ -17,7 +17,11 @@ add_executable(test_icmpv4header target_link_libraries( test_icmpv4header ${I2NCOMMON_LIBRARIES} - ${Boost_LIBRARIES} + Boost::unit_test_framework + Boost::system + Boost::program_options + Boost::date_time + Boost::serialization pthread ) diff --git a/test/CMakeLists.test_icmpv6header.txt b/test/CMakeLists.test_icmpv6header.txt index fe5266a..c05d668 100644 --- a/test/CMakeLists.test_icmpv6header.txt +++ b/test/CMakeLists.test_icmpv6header.txt @@ -17,7 +17,11 @@ add_executable(test_icmpv6header target_link_libraries( test_icmpv6header ${I2NCOMMON_LIBRARIES} - ${Boost_LIBRARIES} + Boost::unit_test_framework + Boost::system + Boost::program_options + Boost::date_time + Boost::serialization pthread ) diff --git a/test/CMakeLists.test_ipv4header.txt b/test/CMakeLists.test_ipv4header.txt index af8ec8d..09985ef 100644 --- a/test/CMakeLists.test_ipv4header.txt +++ b/test/CMakeLists.test_ipv4header.txt @@ -11,7 +11,11 @@ add_executable(test_ipv4header target_link_libraries( test_ipv4header ${I2NCOMMON_LIBRARIES} - ${Boost_LIBRARIES} + Boost::unit_test_framework + Boost::system + Boost::program_options + Boost::date_time + Boost::serialization pthread ) diff --git a/test/CMakeLists.test_ipv6header.txt b/test/CMakeLists.test_ipv6header.txt index bae2ab9..21d5083 100644 --- a/test/CMakeLists.test_ipv6header.txt +++ b/test/CMakeLists.test_ipv6header.txt @@ -11,7 +11,11 @@ add_executable(test_ipv6header target_link_libraries( test_ipv6header ${I2NCOMMON_LIBRARIES} - ${Boost_LIBRARIES} + Boost::unit_test_framework + Boost::system + Boost::program_options + Boost::date_time + Boost::serialization pthread ) diff --git a/test/CMakeLists.test_linkstatus.txt b/test/CMakeLists.test_linkstatus.txt index ad3b987..e58ea15 100644 --- a/test/CMakeLists.test_linkstatus.txt +++ b/test/CMakeLists.test_linkstatus.txt @@ -1,6 +1,6 @@ # compiler: creates the binaries add_executable(test_linkstatus - test_linkstatus + test_linkstatus.cpp ${CMAKE_SOURCE_DIR}/src/boost_assert_handler.cpp ${CMAKE_SOURCE_DIR}/src/link/linkstatus.cpp ${CMAKE_SOURCE_DIR}/src/dns/hostaddress.cpp @@ -18,7 +18,11 @@ add_executable(test_linkstatus target_link_libraries( test_linkstatus ${I2NCOMMON_LIBRARIES} - ${Boost_LIBRARIES} + Boost::unit_test_framework + Boost::system + Boost::program_options + Boost::date_time + Boost::serialization pthread ) diff --git a/test/CMakeLists.test_loglevel.txt b/test/CMakeLists.test_loglevel.txt index 12a9e15..eea1cb2 100644 --- a/test/CMakeLists.test_loglevel.txt +++ b/test/CMakeLists.test_loglevel.txt @@ -9,7 +9,11 @@ add_executable(test_loglevel target_link_libraries( test_loglevel ${I2NCOMMON_LIBRARIES} - ${Boost_LIBRARIES} + Boost::unit_test_framework + Boost::system + Boost::program_options + Boost::date_time + Boost::serialization pthread ) diff --git a/test/CMakeLists.test_logoutput.txt b/test/CMakeLists.test_logoutput.txt index b8cf2b6..bf5ba87 100644 --- a/test/CMakeLists.test_logoutput.txt +++ b/test/CMakeLists.test_logoutput.txt @@ -9,7 +9,11 @@ add_executable(test_logoutput target_link_libraries( test_logoutput ${I2NCOMMON_LIBRARIES} - ${Boost_LIBRARIES} + Boost::unit_test_framework + Boost::system + Boost::program_options + Boost::date_time + Boost::serialization pthread ) diff --git a/test/CMakeLists.test_messagepayload.txt b/test/CMakeLists.test_messagepayload.txt index 07cc163..53b320b 100644 --- a/test/CMakeLists.test_messagepayload.txt +++ b/test/CMakeLists.test_messagepayload.txt @@ -9,7 +9,11 @@ add_executable(test_messagepayload target_link_libraries( test_messagepayload ${I2NCOMMON_LIBRARIES} - ${Boost_LIBRARIES} + Boost::unit_test_framework + Boost::system + Boost::program_options + Boost::date_time + Boost::serialization pthread ) diff --git a/test/CMakeLists.test_pingprotocol.txt b/test/CMakeLists.test_pingprotocol.txt index 24cef29..85813a2 100644 --- a/test/CMakeLists.test_pingprotocol.txt +++ b/test/CMakeLists.test_pingprotocol.txt @@ -9,7 +9,11 @@ add_executable(test_pingprotocol target_link_libraries( test_pingprotocol ${I2NCOMMON_LIBRARIES} - ${Boost_LIBRARIES} + Boost::unit_test_framework + Boost::system + Boost::program_options + Boost::date_time + Boost::serialization pthread ) diff --git a/test/CMakeLists.test_tcpheader.txt b/test/CMakeLists.test_tcpheader.txt index 8a41528..f551853 100644 --- a/test/CMakeLists.test_tcpheader.txt +++ b/test/CMakeLists.test_tcpheader.txt @@ -10,7 +10,11 @@ add_executable(test_tcpheader target_link_libraries( test_tcpheader ${I2NCOMMON_LIBRARIES} - ${Boost_LIBRARIES} + Boost::unit_test_framework + Boost::system + Boost::program_options + Boost::date_time + Boost::serialization pthread )