From 78dcb3f44db670fa1047af39080450d1a7865ba0 Mon Sep 17 00:00:00 2001 From: Timothy Simpson Date: Fri, 29 Nov 2024 11:01:16 +0000 Subject: [PATCH] Hide qt5 functions behind test condition --- CMakeLists.txt | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ed94021..96d2083 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -79,21 +79,31 @@ if(WIN32) list(APPEND SOURCE ddsmon.rc) endif(WIN32) -qt_add_resources(RESOURCES ddsmon.qrc) +if (NOT Qt6_FOUND) + qt5_add_resources(RESOURCES ddsmon.qrc) +else() + qt_add_resources(RESOURCES ddsmon.qrc) +endif() -qt_wrap_cpp(MOC_SOURCE - src/graph_page.h - src/log_page.h - src/main_window.h - src/participant_page.h - src/participant_table_model.h - src/publication_monitor.h - src/recorder_dialog.h - src/subscription_monitor.h - src/table_page.h - src/topic_table_model.h +set(MOC_SOURCE_LIST + src/graph_page.h + src/log_page.h + src/main_window.h + src/participant_page.h + src/participant_table_model.h + src/publication_monitor.h + src/recorder_dialog.h + src/subscription_monitor.h + src/table_page.h + src/topic_table_model.h ) +if (NOT Qt6_FOUND) + qt5_wrap_cpp(MOC_SOURCE ${MOC_SOURCE_LIST}) +else() + qt_wrap_cpp(MOC_SOURCE ${MOC_SOURCE_LIST}) +endif() + add_executable(monitor ${SOURCE} ${HEADER}