From b834645bf71b6a4bee765ea891717eebaf8d4fe5 Mon Sep 17 00:00:00 2001 From: Bill Somerville Date: Fri, 20 Nov 2020 13:45:44 +0000 Subject: [PATCH] Debian 9 backwards compatibility --- CMakeLists.txt | 15 +++++++-------- WSJTXLogging.cpp | 8 +++++--- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 72c38fa13..84bbfbae5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.9 FATAL_ERROR) +cmake_minimum_required (VERSION 3.7.2 FATAL_ERROR) if (APPLE) # @@ -46,9 +46,9 @@ endif () project (wsjtx VERSION 2.3.0.0 - DESCRIPTION "WSJT-X: Digital Modes for Weak Signal Communications in Amateur Radio" LANGUAGES C CXX Fortran ) +set (PROJECT_DESCRIPTION "WSJT-X: Digital Modes for Weak Signal Communications in Amateur Radio") # # Local CMake modules and support files @@ -838,7 +838,7 @@ endif () if (WIN32) set (Boost_USE_STATIC_LIBS OFF) endif () -find_package (Boost 1.63 REQUIRED COMPONENTS log_setup log) +find_package (Boost 1.62 REQUIRED COMPONENTS log_setup log) # # OpenMP @@ -1053,7 +1053,7 @@ query_qmake (QT_HOST_DATA QT_DATA_DIR) set (QT_MKSPECS_DIR ${QT_DATA_DIR}/mkspecs) # project definitions -add_definitions (-DQT5 -DCMAKE_BUILD -DBIGSYM=1) +add_definitions (-DQT5 -DCMAKE_BUILD -DBIGSYM=1 -DBOOST_ALL_DYN_LINK) if (CMAKE_HOST_UNIX) add_definitions (-DUNIX) elseif (CMAKE_HOST_WIN32) @@ -1062,7 +1062,6 @@ endif () # build a library of package functionality (without and optionally with OpenMP support) add_library (wsjt_cxx STATIC ${wsjt_CSRCS} ${wsjt_CXXSRCS}) -target_compile_definitions (wsjt_cxx PUBLIC BOOST_LOG_DYN_LINK) target_link_libraries (wsjt_cxx ${LIBM_LIBRARIES} Boost::log_setup ${LIBM_LIBRARIES}) # build an OpenMP variant of the Fortran library routines @@ -1310,7 +1309,7 @@ target_link_libraries (qcp Qt5::Widgets Qt5::PrintSupport) # build a library of package Qt functionality add_library (wsjt_qt STATIC ${wsjt_qt_CXXSRCS} ${wsjt_qt_GENUISRCS} ${GENAXSRCS}) # set wsjtx_udp exports to static variants -target_compile_definitions (wsjt_qt PUBLIC UDP_STATIC_DEFINE BOOST_LOG_DYN_LINK) +target_compile_definitions (wsjt_qt PUBLIC UDP_STATIC_DEFINE) target_link_libraries (wsjt_qt Boost::log qcp Qt5::Widgets Qt5::Network Qt5::Sql) target_include_directories (wsjt_qt BEFORE PRIVATE ${hamlib_INCLUDE_DIRS}) if (WIN32) @@ -1853,11 +1852,11 @@ else () endif () set (CPACK_DEBIAN_PACKAGE_HOMEPAGE "${PROJECT_HOMEPAGE}") -set (CPACK_DEBIAN_PACKAGE_DEPENDS "libgfortran5 (>=8.3) | libgfortran4 (>=7.3) | libgfortran3 (>=6.3), libfftw3-single3 (>=3.3), libgomp1 (>=6), libqt5serialport5 (>=5.7), libqt5multimedia5-plugins (>=5.7), libqt5widgets5 (>=5.7), libqt5network5 (>=5.7), libqt5printsupport5 (>=5.7), libqt5sql5-sqlite (>=5.7), libusb-1.0-0 (>=1.0.21), libboost-log1.65.1 (>=1.62.0) | libboost-log1.65.1 (>=1.65.1) | libboost-log1.67.0 (>=1.67.0) | libboost-log1.71.0 (>=1.71.0)") +set (CPACK_DEBIAN_PACKAGE_DEPENDS "libgfortran5 (>=8.3) | libgfortran4 (>=7.3) | libgfortran3 (>=6.3), libfftw3-single3 (>=3.3), libgomp1 (>=6), libqt5serialport5 (>=5.7), libqt5multimedia5-plugins (>=5.7), libqt5widgets5 (>=5.7), libqt5network5 (>=5.7), libqt5printsupport5 (>=5.7), libqt5sql5-sqlite (>=5.7), libusb-1.0-0 (>=1.0.21), libboost-log1.62.0 (>=1.62.0) | libboost-log1.65.1 (>=1.65.1) | libboost-log1.67.0 (>=1.67.0) | libboost-log1.71.0 (>=1.71.0) | libboost-log1.74.0 (>=1.74.0)") set (CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON) set (CPACK_RPM_PACKAGE_ARCHITECTURE ${CMAKE_SYSTEM_PROCESSOR}) -set (CPACK_RPM_PACKAGE_REQUIRES "qt5-qtbase >= 5.9, qt5-qtserialport >= 5.9, qt5-qtmultimedia >= 5.9, qt5-qtsvg >= 5.9, libusbx >= 1.0.22, libgfortran >= 7, libgomp >= 7, fftw-libs-single >= 3.3") +set (CPACK_RPM_PACKAGE_REQUIRES "qt5-qtbase >= 5.9, qt5-qtserialport >= 5.9, qt5-qtmultimedia >= 5.9, qt5-qtsvg >= 5.9, libusbx >= 1.0.22, libgfortran >= 7, libgomp >= 7, fftw-libs-single >= 3.3, boost-log >= 1.62") set (CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION /usr/share/pixmaps /usr/share/applications /usr/share/man /usr/share/man1) configure_file ("${PROJECT_SOURCE_DIR}/CMakeCPackOptions.cmake.in" diff --git a/WSJTXLogging.cpp b/WSJTXLogging.cpp index 76adf81b0..ffea213c8 100644 --- a/WSJTXLogging.cpp +++ b/WSJTXLogging.cpp @@ -35,7 +35,7 @@ namespace trivial = logging::trivial; namespace keywords = logging::keywords; namespace expr = logging::expressions; namespace sinks = logging::sinks; -namespace ptime = boost::posix_time; +namespace posix_time = boost::posix_time; namespace gregorian = boost::gregorian; namespace container = boost::container; @@ -139,7 +139,9 @@ WSJTXLogging::WSJTXLogging () app_data.absoluteFilePath ("logs/wsjtx_syslog_%Y-%m.log").toStdString () , keywords::time_based_rotation = sinks::file::rotation_at_time_point (gregorian::greg_day (1), 0, 0, 0) , keywords::open_mode = std::ios_base::out | std::ios_base::app +#if BOOST_VERSION / 100 >= 1063 , keywords::enable_final_rotation = false +#endif ); sys_sink->locked_backend ()->set_file_collector @@ -166,8 +168,8 @@ WSJTXLogging::WSJTXLogging () ( expr::stream << "[" << channel - << "][" << expr::format_date_time ("TimeStamp", "%Y-%m-%d %H:%M:%S.%f") - << "][" << expr::format_date_time ("Uptime", "%O:%M:%S.%f") + << "][" << expr::format_date_time ("TimeStamp", "%Y-%m-%d %H:%M:%S.%f") + << "][" << expr::format_date_time ("Uptime", "%O:%M:%S.%f") << "][" << trivial::severity << "] " << expr::message );