From b77bb441c0865eb3ac3ae7c7d61d1e8ce1cf59a2 Mon Sep 17 00:00:00 2001 From: Sergio Martins Date: Sun, 21 Sep 2025 22:41:24 +0100 Subject: [PATCH 1/3] Fix build if Qt Remote Objects is installed CI wasn't building certain code paths so wasn't detecting KDSME_QT6 leftovers --- .github/workflows/build-external-graphviz.yml | 2 +- .github/workflows/build.yml | 4 +-- examples/qscxmldebugger/CMakeLists.txt | 16 +++--------- examples/qsmdebugger/CMakeLists.txt | 13 ++++------ .../debuginterfaceclient/CMakeLists.txt | 24 +++-------------- .../debuginterfacesource/CMakeLists.txt | 26 +++---------------- .../qscxmldebuginterfacesource.cpp | 2 +- .../qsmdebuginterfacesource.cpp | 2 +- 8 files changed, 19 insertions(+), 70 deletions(-) diff --git a/.github/workflows/build-external-graphviz.yml b/.github/workflows/build-external-graphviz.yml index 3dffe7f7..ba1ce3a0 100644 --- a/.github/workflows/build-external-graphviz.yml +++ b/.github/workflows/build-external-graphviz.yml @@ -28,7 +28,7 @@ jobs: - Static config: - qt_version: 6.6.2 - qt_modules: qtscxml + qt_modules: qtscxml qtremoteobjects steps: - name: Install Dependencies on Linux diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5fff569f..51ff1327 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -30,11 +30,11 @@ jobs: - Static config: - qt_version: 6.6.2 - qt_modules: qtscxml + qt_modules: qtscxml qtremoteobjects qt_arch: win64_msvc2019_64 macos_architectures: "x86_64;arm64" - qt_version: 6.9.0 # Bump to latest freely - qt_modules: qtscxml + qt_modules: qtscxml qtremoteobjects qt_arch: win64_msvc2022_64 macos_architectures: "x86_64;arm64" steps: diff --git a/examples/qscxmldebugger/CMakeLists.txt b/examples/qscxmldebugger/CMakeLists.txt index 804a9b11..57b2b21b 100644 --- a/examples/qscxmldebugger/CMakeLists.txt +++ b/examples/qscxmldebugger/CMakeLists.txt @@ -13,21 +13,11 @@ # add_executable(qscxmldebugger trafficlight.cpp main.cpp trafficlight-widgets-static.qrc) + # Copy the .rep file to your project -if(NOT KDSME_QT6) - qt_generate_repc(REPC_SRCS ../../src/debuginterface/debuginterface.rep REPLICA) +qt_add_repc_replicas(qscxmldebugger ../../src/debuginterface/debuginterface.rep) +qt_add_statecharts(qscxmldebugger statemachine.scxml) - qt_add_statecharts(STATECHART_SRCS statemachine.scxml) - # Work-around QTBUG-84387 - # Needed in Qt5, otherwise we'll run into duplicate symbol issues like this: - # ld: error: duplicate symbol: TrafficLightStateMachine::qt_metacall(QMetaObject::Call, int, void**) - set_source_files_properties(${STATECHART_SRCS} PROPERTIES GENERATED TRUE SKIP_AUTOGEN ON) - target_sources(qscxmldebugger PRIVATE ${REPC_SRCS} ${STATECHART_SRCS}) -endif() -if(KDSME_QT6) - qt_add_repc_replicas(qscxmldebugger ../../src/debuginterface/debuginterface.rep) - qt_add_statecharts(qscxmldebugger statemachine.scxml) -endif() target_link_libraries( qscxmldebugger KDSME::Core diff --git a/examples/qsmdebugger/CMakeLists.txt b/examples/qsmdebugger/CMakeLists.txt index 0986e4ec..55b97c1c 100644 --- a/examples/qsmdebugger/CMakeLists.txt +++ b/examples/qsmdebugger/CMakeLists.txt @@ -13,15 +13,12 @@ # set(SRCS trafficlight.cpp main.cpp) -# Copy the .rep file to your project -if(NOT KDSME_QT6) - qt5_generate_repc(SRCS ../../src/debuginterface/debuginterface.rep REPLICA) -endif() + add_executable(qsmdebugger ${SRCS}) -if(KDSME_QT6) - qt6_add_repc_replicas(qsmdebugger ../../src/debuginterface/debuginterface.rep) - target_link_libraries(qsmdebugger Qt6::StateMachine) -endif() + +qt6_add_repc_replicas(qsmdebugger ../../src/debuginterface/debuginterface.rep) +target_link_libraries(qsmdebugger Qt6::StateMachine) + target_link_libraries( qsmdebugger KDSME::Core diff --git a/src/debuginterface/debuginterfaceclient/CMakeLists.txt b/src/debuginterface/debuginterfaceclient/CMakeLists.txt index 01c00ec1..dbfb93bf 100644 --- a/src/debuginterface/debuginterfaceclient/CMakeLists.txt +++ b/src/debuginterface/debuginterfaceclient/CMakeLists.txt @@ -13,15 +13,11 @@ # set(DEBUGINTERFACECLIENT_SRCS debuginterfaceclient.cpp) -if(NOT KDSME_QT6) - qt5_generate_repc(DEBUGINTERFACECLIENT_SRCS ../debuginterface.rep REPLICA) -endif() add_library(kdstatemachineeditor_debuginterfaceclient ${DEBUGINTERFACECLIENT_SRCS}) -if(KDSME_QT6) - qt6_add_repc_replicas(kdstatemachineeditor_debuginterfaceclient ../debuginterface.rep) -endif() +qt6_add_repc_replicas(kdstatemachineeditor_debuginterfaceclient ../debuginterface.rep) + add_library(KDSME::DebugInterfaceClient ALIAS kdstatemachineeditor_debuginterfaceclient) target_link_libraries( @@ -58,21 +54,7 @@ target_include_directories( kdstatemachineeditor_debuginterfaceclient PUBLIC "$" $ ) -if(NOT KDSME_QT6) - ecm_generate_pri_file( - BASE_NAME - KDSMEDebugInterfaceClient - LIB_NAME - kdstatemachineeditor_debuginterfaceclient - DEPS - "" - FILENAME_VAR - PRI_FILENAME - INCLUDE_INSTALL_DIR - ${INCLUDE_INSTALL_DIR}/debuginterfaceclient - ) - install(FILES ${PRI_FILENAME} DESTINATION ${ECM_MKSPECS_INSTALL_DIR}) -endif() + set_target_properties( kdstatemachineeditor_debuginterfaceclient PROPERTIES OUTPUT_NAME "kdstatemachineeditor_debuginterfaceclient${KDSME_LIBRARY_QTID}" diff --git a/src/debuginterface/debuginterfacesource/CMakeLists.txt b/src/debuginterface/debuginterfacesource/CMakeLists.txt index 5e5983ef..87c96a16 100644 --- a/src/debuginterface/debuginterfacesource/CMakeLists.txt +++ b/src/debuginterface/debuginterfacesource/CMakeLists.txt @@ -18,16 +18,10 @@ if(Qt${QT_VERSION_MAJOR}Scxml_FOUND) list(APPEND QSMDEBUGINTERFACESOURCE_SRCS qscxmldebuginterfacesource.cpp) endif() -if(NOT KDSME_QT6) - qt5_generate_repc(QSMDEBUGINTERFACESOURCE_SRCS ../debuginterface.rep SOURCE) -endif() - add_library(kdstatemachineeditor_debuginterfacesource STATIC ${QSMDEBUGINTERFACESOURCE_SRCS}) -if(KDSME_QT6) - qt6_add_repc_sources(kdstatemachineeditor_debuginterfacesource ../debuginterface.rep) - target_link_libraries(kdstatemachineeditor_debuginterfacesource LINK_PRIVATE Qt6::StateMachine) -endif() +qt6_add_repc_sources(kdstatemachineeditor_debuginterfacesource ../debuginterface.rep) +target_link_libraries(kdstatemachineeditor_debuginterfacesource LINK_PRIVATE Qt6::StateMachine) add_library(KDSME::DebugInterfaceSource ALIAS kdstatemachineeditor_debuginterfacesource) target_link_libraries( @@ -71,21 +65,7 @@ target_include_directories( PUBLIC $ PRIVATE ../ ) -if(NOT KDSME_QT6) - ecm_generate_pri_file( - BASE_NAME - KDSMEDebugInterfaceSource - LIB_NAME - kdstatemachineeditor_debuginterfacesource - DEPS - "" - FILENAME_VAR - PRI_FILENAME - INCLUDE_INSTALL_DIR - ${INCLUDE_INSTALL_DIR}/debuginterfacesource - ) - install(FILES ${PRI_FILENAME} DESTINATION ${ECM_MKSPECS_INSTALL_DIR}) -endif() + set_target_properties( kdstatemachineeditor_debuginterfacesource PROPERTIES OUTPUT_NAME "kdstatemachineeditor_debuginterfacesource${KDSME_LIBRARY_QTID}" diff --git a/src/debuginterface/debuginterfacesource/qscxmldebuginterfacesource.cpp b/src/debuginterface/debuginterfacesource/qscxmldebuginterfacesource.cpp index 9deb4b06..e5592dda 100644 --- a/src/debuginterface/debuginterfacesource/qscxmldebuginterfacesource.cpp +++ b/src/debuginterface/debuginterfacesource/qscxmldebuginterfacesource.cpp @@ -251,7 +251,7 @@ void QScxmlDebugInterfaceSource::Private::handleStateConfigurationChanged() StateMachineConfiguration config; config.reserve(newConfig.size()); - for (auto state : qAsConst(newConfig)) { + for (auto state : std::as_const(newConfig)) { config << makeStateId(state); } diff --git a/src/debuginterface/debuginterfacesource/qsmdebuginterfacesource.cpp b/src/debuginterface/debuginterfacesource/qsmdebuginterfacesource.cpp index c20c8107..4253ff67 100644 --- a/src/debuginterface/debuginterfacesource/qsmdebuginterfacesource.cpp +++ b/src/debuginterface/debuginterfacesource/qsmdebuginterfacesource.cpp @@ -222,7 +222,7 @@ void QsmDebugInterfaceSource::Private::handleStateConfigurationChanged() StateMachineConfiguration config; config.reserve(newConfig.size()); - for (QAbstractState *state : qAsConst(newConfig)) { + for (QAbstractState *state : std::as_const(newConfig)) { config << makeStateId(state); } From 3c16cf64447c7d7736ed21f001d95a225f112bf9 Mon Sep 17 00:00:00 2001 From: Sergio Martins <@> Date: Sun, 21 Sep 2025 23:12:15 +0100 Subject: [PATCH 2/3] cmake: Fix empty elseif() warning this warning is fatal in CI --- cmake/FindGraphviz.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/FindGraphviz.cmake b/cmake/FindGraphviz.cmake index fd0e2d4d..c528a03c 100644 --- a/cmake/FindGraphviz.cmake +++ b/cmake/FindGraphviz.cmake @@ -198,7 +198,7 @@ if(GRAPHVIZ_FOUND) message(FATAL_ERROR "Unable to compile or run the graphviz version detection program.") endif() endif() - elseif() + else() find_program(DOT_TOOL dot PATHS ${_GRAPHVIZ_ROOT}/bin) execute_process( COMMAND ${DOT_TOOL} -V From 407af01383fd1aede5609b257f1ce819120d193d Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sun, 21 Sep 2025 22:13:01 +0000 Subject: [PATCH 3/3] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/debuginterface/debuginterfaceclient/CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/src/debuginterface/debuginterfaceclient/CMakeLists.txt b/src/debuginterface/debuginterfaceclient/CMakeLists.txt index dbfb93bf..86c70aa9 100644 --- a/src/debuginterface/debuginterfaceclient/CMakeLists.txt +++ b/src/debuginterface/debuginterfaceclient/CMakeLists.txt @@ -18,7 +18,6 @@ add_library(kdstatemachineeditor_debuginterfaceclient ${DEBUGINTERFACECLIENT_SRC qt6_add_repc_replicas(kdstatemachineeditor_debuginterfaceclient ../debuginterface.rep) - add_library(KDSME::DebugInterfaceClient ALIAS kdstatemachineeditor_debuginterfaceclient) target_link_libraries( kdstatemachineeditor_debuginterfaceclient LINK_PRIVATE Qt${QT_VERSION_MAJOR}::RemoteObjects LINK_PUBLIC KDSME::Core