Skip to content

Commit

Permalink
Update OpenDDW, 3.26 ifs, other cleanup
Browse files Browse the repository at this point in the history
- Update OpenDDW submodule to OpenDDS/OpenDDW#18
- Add if macros for 3.26
- Add missing `REQUIRED` check to FindQwt
- Some CMake cleanup
  • Loading branch information
iguessthislldo committed Feb 6, 2024
1 parent bd8ecce commit 935cb6b
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 20 deletions.
4 changes: 1 addition & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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$<$<CONFIG:DEBUG>:d>.lib)
set(QWT_INCLUDE_DIR ${PROJECT_SOURCE_DIR}/qwt/src)
else()
Expand Down Expand Up @@ -121,8 +121,6 @@ endif()

target_compile_options(monitor PRIVATE $<$<OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>,$<CXX_COMPILER_ID:GNU>>: -Wall -Wextra -Wpedantic -Wno-unused -Wunused-parameter> $<$<CXX_COMPILER_ID:MSVC>: /W4>)

add_dependencies(monitor OpenDDW)

target_link_libraries(monitor
OpenDDW
${QWT_LIBRARY}
Expand Down
25 changes: 14 additions & 11 deletions FindQwt.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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()
17 changes: 13 additions & 4 deletions src/main_window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -67,7 +67,8 @@ DDSMonitorMainWindow::DDSMonitorMainWindow() :
// Join the DDS domain
CommonData::m_ddsManager = std::make_unique<DDSManager>();
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<PublicationMonitor>();
m_subscriptionMonitor = std::make_unique<SubscriptionMonitor>();
Expand Down Expand Up @@ -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: "
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)

Expand Down
2 changes: 1 addition & 1 deletion thirdparty/OpenDDW

0 comments on commit 935cb6b

Please sign in to comment.