diff --git a/CMakeLists.txt b/CMakeLists.txt index 658f4a0..f57f8f9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,7 +14,7 @@ endif() find_package(Qt5 REQUIRED COMPONENTS Core Widgets Gui PrintSupport Svg OpenGL OPTIONAL_COMPONENTS ${qt_optional_components}) -if(${QWT_IS_LOCAL}) +if(QWT_IS_LOCAL) set(QWT_LIBRARY ${PROJECT_SOURCE_DIR}/qwt/lib/qwt$<$:d>.lib) set(QWT_INCLUDE_DIR ${PROJECT_SOURCE_DIR}/qwt/src) else() @@ -121,8 +121,6 @@ endif() target_compile_options(monitor PRIVATE $<$,$,$>: -Wall -Wextra -Wpedantic -Wno-unused -Wunused-parameter> $<$: /W4>) -add_dependencies(monitor OpenDDW) - target_link_libraries(monitor OpenDDW ${QWT_LIBRARY} diff --git a/FindQwt.cmake b/FindQwt.cmake index 77d2978..2c490d2 100644 --- a/FindQwt.cmake +++ b/FindQwt.cmake @@ -42,18 +42,21 @@ FIND_PATH(QWT_INCLUDE_DIR NAMES qwt.h PATHS PATH_SUFFIXES qwt-qt5 qwt qwt6 qt5/qwt ) -IF (QWT_INCLUDE_DIR AND QWT_LIBRARY) - SET(QWT_FOUND TRUE) -ENDIF (QWT_INCLUDE_DIR AND QWT_LIBRARY) +if(QWT_INCLUDE_DIR AND QWT_LIBRARY) + set(Qwt_FOUND TRUE) -IF (QWT_FOUND) FILE(READ ${QWT_INCLUDE_DIR}/qwt_global.h qwt_header) STRING(REGEX REPLACE "^.*QWT_VERSION_STR +\"([^\"]+)\".*$" "\\1" QWT_VERSION_STR "${qwt_header}") - IF (NOT QWT_FIND_QUIETLY) + + if(NOT Qwt_FIND_QUIETLY) MESSAGE(STATUS "Found Qwt: ${QWT_LIBRARY} (${QWT_VERSION_STR})") - ENDIF (NOT QWT_FIND_QUIETLY) -ELSE (QWT_FOUND) - IF (QWT_FIND_REQUIRED) - MESSAGE(FATAL_ERROR "Could not find Qwt") - ENDIF (QWT_FIND_REQUIRED) -ENDIF (QWT_FOUND) + endif() +else() + set(Qwt_FOUND FALSE) + + if(Qwt_FIND_REQUIRED) + message(FATAL_ERROR "Could not find required Qwt") + elseif(NOT Qwt_FIND_QUIETLY) + message(STATUS "Could not find optional Qwt") + endif() +endif() diff --git a/src/main_window.cpp b/src/main_window.cpp index 2123339..6f49db7 100644 --- a/src/main_window.cpp +++ b/src/main_window.cpp @@ -53,7 +53,7 @@ DDSMonitorMainWindow::DDSMonitorMainWindow() : { // Prompt the user for the domain selection domainID = settings.value("domainID").toInt(); - + domainID = QInputDialog::getInt( this, "Join Domain", "Join DDS Domain:", domainID, -1, 232, 1, &ok); } @@ -67,7 +67,8 @@ DDSMonitorMainWindow::DDSMonitorMainWindow() : // Join the DDS domain CommonData::m_ddsManager = std::make_unique(); m_participantPage = new ParticipantPage(mainTabWidget); - CommonData::m_ddsManager->joinDomain(domainID, "", [page = m_participantPage](const ParticipantInfo& info) {page->addParticipant(info); }, + CommonData::m_ddsManager->joinDomain(domainID, "", + [page = m_participantPage](const ParticipantInfo& info) {page->addParticipant(info); }, [page = m_participantPage](const ParticipantInfo& info) {page->removeParticipant(info); }); m_publicationMonitor = std::make_unique(); m_subscriptionMonitor = std::make_unique(); @@ -375,7 +376,11 @@ void DDSMonitorMainWindow::reportConfig() const //const uint16_t userMulicastPort = pb + (dg * domainID) + d2; std::cout << "\nDiscovery multicast: " - << rtpsInfo->default_multicast_group(domainID).to_addr().get_host_addr() + << rtpsInfo->default_multicast_group( +#if OPENDDS_VERSION_AT_LEAST(3, 27, 0) + domainID).to_addr( +#endif + ).get_host_addr() << ":" << discoveryMulicastPort //<< "\nDiscovery unicast: " @@ -438,7 +443,11 @@ void DDSMonitorMainWindow::reportConfig() const const OpenDDS::DCPS::TransportInst_rch transportInstance = transportConfig->instances_[i]; - std::cout << transportInstance->dump_to_str(domainID) << "\n"; + std::cout << transportInstance->dump_to_str( +#if OPENDDS_VERSION_AT_LEAST(3, 27, 0) + domainID +#endif + ) << "\n"; } } // End DDSMonitorMainWindow::reportConfig diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index b3f26d9..69b54d4 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.0) +cmake_minimum_required(VERSION 3.20) project(opendds-monitor-tests VERSION 0.0.1 LANGUAGES CXX) diff --git a/thirdparty/OpenDDW b/thirdparty/OpenDDW index 013e6e7..7a56951 160000 --- a/thirdparty/OpenDDW +++ b/thirdparty/OpenDDW @@ -1 +1 @@ -Subproject commit 013e6e7cc44f290228a04a4ff4f88b85f7e67188 +Subproject commit 7a569515aafab11c0819dc3cc592e5aeba98e4d7