diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 52a4234c..ddc7c977 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -19,9 +19,9 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config-examples.h.cmake ${CMAKE_CURRE add_subdirectory(layoutexport) add_subdirectory(export) -if(Qt${Qt_VERSION_MAJOR}RemoteObjects_FOUND) +if(TARGET Qt::RemoteObjects) add_subdirectory(qsmdebugger) - if(Qt${Qt_VERSION_MAJOR}Scxml_FOUND) + if(TARGET Qt::Scxml) add_subdirectory(qscxmldebugger) endif() endif() diff --git a/examples/layoutexport/CMakeLists.txt b/examples/layoutexport/CMakeLists.txt index 9561a072..e817b765 100644 --- a/examples/layoutexport/CMakeLists.txt +++ b/examples/layoutexport/CMakeLists.txt @@ -14,4 +14,4 @@ # add_executable(layoutexport main.cpp) -target_link_libraries(layoutexport KDSME::Core Qt${Qt_VERSION_MAJOR}::Gui) +target_link_libraries(layoutexport KDSME::Core Qt::Gui) diff --git a/examples/qscxmldebugger/CMakeLists.txt b/examples/qscxmldebugger/CMakeLists.txt index 7ff22928..2f733615 100644 --- a/examples/qscxmldebugger/CMakeLists.txt +++ b/examples/qscxmldebugger/CMakeLists.txt @@ -16,9 +16,9 @@ add_executable(qscxmldebugger trafficlight.cpp main.cpp trafficlight-widgets-static.qrc) # Copy the .rep file to your project if(NOT BUILD_QT6) - qt5_generate_repc(REPC_SRCS ../../src/debuginterface/debuginterface.rep REPLICA) + qt_generate_repc(REPC_SRCS ../../src/debuginterface/debuginterface.rep REPLICA) - qt5_add_statecharts(STATECHART_SRCS 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**) @@ -26,8 +26,8 @@ if(NOT BUILD_QT6) target_sources(qscxmldebugger PRIVATE ${REPC_SRCS} ${STATECHART_SRCS}) endif() if(BUILD_QT6) - qt6_add_repc_replicas(qscxmldebugger ../../src/debuginterface/debuginterface.rep) - qt6_add_statecharts(qscxmldebugger statemachine.scxml) + qt_add_repc_replicas(qscxmldebugger ../../src/debuginterface/debuginterface.rep) + qt_add_statecharts(qscxmldebugger statemachine.scxml) endif() target_link_libraries( qscxmldebugger @@ -35,7 +35,7 @@ target_link_libraries( KDSME::View KDSME::DebugInterfaceClient KDSME::DebugInterfaceSource - Qt${Qt_VERSION_MAJOR}::Widgets - Qt${Qt_VERSION_MAJOR}::RemoteObjects - Qt${Qt_VERSION_MAJOR}::Scxml + Qt::Widgets + Qt::RemoteObjects + Qt::Scxml ) diff --git a/examples/scxmlimport/CMakeLists.txt b/examples/scxmlimport/CMakeLists.txt index c9dbf628..1027fc7c 100644 --- a/examples/scxmlimport/CMakeLists.txt +++ b/examples/scxmlimport/CMakeLists.txt @@ -14,4 +14,4 @@ # add_executable(scxmlimport main.cpp) -target_link_libraries(scxmlimport KDSME::Core KDSME::View Qt${Qt_VERSION_MAJOR}::Gui) +target_link_libraries(scxmlimport KDSME::Core KDSME::View Qt::Gui) diff --git a/examples/simplestatemachine/CMakeLists.txt b/examples/simplestatemachine/CMakeLists.txt index 742b0406..c212f952 100644 --- a/examples/simplestatemachine/CMakeLists.txt +++ b/examples/simplestatemachine/CMakeLists.txt @@ -14,4 +14,4 @@ # add_executable(simplestatemachine main.cpp) -target_link_libraries(simplestatemachine KDSME::Core KDSME::View Qt${Qt_VERSION_MAJOR}::Gui) +target_link_libraries(simplestatemachine KDSME::Core KDSME::View Qt::Gui) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 629fa17a..86f32b15 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -21,7 +21,7 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR}) add_subdirectory(core) add_subdirectory(view) -if(Qt${Qt_VERSION_MAJOR}RemoteObjects_FOUND) +if(TARGET Qt${Qt_VERSION_MAJOR}::RemoteObjects) add_subdirectory(debuginterface) endif() diff --git a/src/app/CMakeLists.txt b/src/app/CMakeLists.txt index c8958f2a..38cbd0a6 100644 --- a/src/app/CMakeLists.txt +++ b/src/app/CMakeLists.txt @@ -15,11 +15,11 @@ set(KDSME_APPBIN ${CMAKE_PROJECT_NAME}) -set(BIN_SRCS mainwindow.cpp main.cpp) +set(BIN_SRCS mainwindow.cpp mainwindow.h main.cpp) set(BIN_UIS mainwindow.ui) add_executable(${KDSME_APPBIN} WIN32 ${BIN_SRCS} ${BIN_UIS}) target_link_libraries( - ${KDSME_APPBIN} Qt${Qt_VERSION_MAJOR}::QuickWidgets kdstatemachineeditor_core kdstatemachineeditor_view - kdsme_testhelper + ${KDSME_APPBIN} PUBLIC Qt${Qt_VERSION_MAJOR}::QuickWidgets kdstatemachineeditor_core kdstatemachineeditor_view + kdsme_testhelper ) diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index f7853904..9b680103 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -14,33 +14,64 @@ # set(LIB_SRCS + debug.cpp + debug.h export/abstractexporter.cpp + export/abstractexporter.h export/qmlexporter.cpp + export/qmlexporter.h export/scxmlexporter.cpp + export/scxmlexporter.h export/svgexporter.cpp + export/svgexporter.h + import/abstractimporter.cpp + import/abstractimporter.h + import/scxmlimporter.cpp + import/scxmlimporter.h layout/layerwiselayouter.cpp + layout/layerwiselayouter.h layout/layouter.cpp + layout/layouter.h layout/layoutimportexport.cpp + layout/layoutimportexport.h layout/layoutproperties.cpp + layout/layoutproperties.h layout/layoututils.cpp + layout/layoututils.h model/element.cpp + model/element.h model/elementfactory.cpp + model/elementfactory.h model/elementmodel.cpp + model/elementmodel.h model/elementutil.cpp + model/elementutil.h model/runtimecontroller.cpp + model/runtimecontroller.h model/state.cpp + model/state.h model/transition.cpp - import/abstractimporter.cpp - import/scxmlimporter.cpp + model/transition.h util/depthchecker.cpp + util/depthchecker.h util/objecthelper.cpp + util/objecthelper.h util/objecttreemodel.cpp - debug.cpp + util/objecttreemodel.h ) if(GRAPHVIZ_FOUND) - list(APPEND LIB_SRCS layout/graphvizlayout/gvutils.cpp layout/graphvizlayout/graphvizlayerlayouter.cpp - layout/graphvizlayout/graphvizlayouter.cpp layout/graphvizlayout/graphvizlayouterbackend.cpp + list( + APPEND + LIB_SRCS + layout/graphvizlayout/graphvizlayerlayouter.cpp + layout/graphvizlayout/graphvizlayerlayouter.h + layout/graphvizlayout/graphvizlayouter.cpp + layout/graphvizlayout/graphvizlayouter.h + layout/graphvizlayout/graphvizlayouterbackend.cpp + layout/graphvizlayout/graphvizlayouterbackend_p.h + layout/graphvizlayout/gvutils.cpp + layout/graphvizlayout/gvutils.h ) if(WITH_STATIC_GRAPHVIZ) list(APPEND LIB_SRCS layout/graphvizlayout/graphviz_staticbuild.c) diff --git a/src/core/tests/CMakeLists.txt b/src/core/tests/CMakeLists.txt index f8b7a889..50ca83ea 100644 --- a/src/core/tests/CMakeLists.txt +++ b/src/core/tests/CMakeLists.txt @@ -22,62 +22,54 @@ if(TARGET Qt5::XmlPatterns_FOUND AND NOT APPLE) endif() add_library(kdsme_testhelper STATIC parsehelper.cpp util.cpp) -target_link_libraries(kdsme_testhelper Qt${Qt_VERSION_MAJOR}::Test kdstatemachineeditor_core) +target_link_libraries(kdsme_testhelper Qt::Test kdstatemachineeditor_core) if(GRAPHVIZ_FOUND) - ecm_add_test(test_layouter.cpp LINK_LIBRARIES Qt${Qt_VERSION_MAJOR}::Gui kdsme_testhelper) + ecm_add_test(test_layouter.cpp LINK_LIBRARIES Qt::Gui kdsme_testhelper) endif() ecm_add_test(test_layoutitem.cpp LINK_LIBRARIES kdsme_testhelper) -ecm_add_test( - test_models.cpp LINK_LIBRARIES Qt${Qt_VERSION_MAJOR}::Gui Qt${Qt_VERSION_MAJOR}::Test kdstatemachineeditor_core -) +ecm_add_test(test_models.cpp LINK_LIBRARIES Qt::Gui Qt::Test kdstatemachineeditor_core) ecm_add_test(test_qmlexport.cpp LINK_LIBRARIES kdsme_testhelper) -if(Qt${Qt_VERSION_MAJOR}RemoteObjects_FOUND) +if(TARGET Qt::RemoteObjects) set(SRCS test_qsmintegration.cpp) if(NOT BUILD_QT6) - qt5_generate_repc(SRCS ../../debuginterface/debuginterface.rep REPLICA) + qt_generate_repc(SRCS ../../debuginterface/debuginterface.rep REPLICA) endif() ecm_add_test( ${SRCS} TEST_NAME test_qsmintegration LINK_LIBRARIES - Qt${Qt_VERSION_MAJOR}::RemoteObjects - Qt${Qt_VERSION_MAJOR}::Test + Qt::RemoteObjects + Qt::Test kdstatemachineeditor_debuginterfaceclient kdstatemachineeditor_debuginterfacesource kdsme_testhelper ) if(BUILD_QT6) target_link_libraries(test_qsmintegration Qt6::StateMachine) - qt6_add_repc_replicas(test_qsmintegration ../../debuginterface/debuginterface.rep) + qt_add_repc_replicas(test_qsmintegration ../../debuginterface/debuginterface.rep) endif() endif() ecm_add_test(test_scxmlimport.cpp LINK_LIBRARIES kdsme_testhelper) if(DEFINED KDSME_TESTHELPER_EXTRA_LIBS) - ecm_add_test( - test_scxmlexport.cpp LINK_LIBRARIES Qt${Qt_VERSION_MAJOR}::Test ${KDSME_TESTHELPER_EXTRA_LIBS} - kdstatemachineeditor_core - ) + ecm_add_test(test_scxmlexport.cpp LINK_LIBRARIES Qt::Test ${KDSME_TESTHELPER_EXTRA_LIBS} kdstatemachineeditor_core) else() - ecm_add_test(test_scxmlexport.cpp LINK_LIBRARIES Qt${Qt_VERSION_MAJOR}::Test kdstatemachineeditor_core) + ecm_add_test(test_scxmlexport.cpp LINK_LIBRARIES Qt::Test kdstatemachineeditor_core) endif() ecm_add_test(test_statemachine.cpp LINK_LIBRARIES kdsme_testhelper) -ecm_add_test(test_util.cpp LINK_LIBRARIES Qt${Qt_VERSION_MAJOR}::Gui kdsme_testhelper) +ecm_add_test(test_util.cpp LINK_LIBRARIES Qt::Gui kdsme_testhelper) if(NOT BUILD_QT6 OR Qt6Core5Compat_FOUND) - ecm_add_test( - test_layoutinformation.cpp LINK_LIBRARIES Qt${Qt_VERSION_MAJOR}::Gui Qt${Qt_VERSION_MAJOR}::Test - kdstatemachineeditor_core - ) + ecm_add_test(test_layoutinformation.cpp LINK_LIBRARIES Qt::Gui Qt::Test kdstatemachineeditor_core) if(BUILD_QT6) target_link_libraries(test_layoutinformation Qt6::Core5Compat) endif() diff --git a/src/view/tests/CMakeLists.txt b/src/view/tests/CMakeLists.txt index 3b01718c..881d60ac 100644 --- a/src/view/tests/CMakeLists.txt +++ b/src/view/tests/CMakeLists.txt @@ -13,6 +13,6 @@ # Contact info@kdab.com if any conditions of this licensing are not clear to you. # -ecm_add_test(test_commands.cpp LINK_LIBRARIES Qt${Qt_VERSION_MAJOR}::Test kdstatemachineeditor_view) +ecm_add_test(test_commands.cpp LINK_LIBRARIES Qt::Test kdstatemachineeditor_view) -ecm_add_test(test_statemachineview.cpp LINK_LIBRARIES Qt${Qt_VERSION_MAJOR}::Test kdstatemachineeditor_view) +ecm_add_test(test_statemachineview.cpp LINK_LIBRARIES Qt::Test kdstatemachineeditor_view)