Skip to content

Commit

Permalink
Add KDSME as submodule for CI testing
Browse files Browse the repository at this point in the history
  • Loading branch information
dantti committed Jan 7, 2024
1 parent a3d0d84 commit 02f7f6a
Show file tree
Hide file tree
Showing 8 changed files with 89 additions and 30 deletions.
15 changes: 9 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,14 @@ jobs:

- name: Checkout sources
uses: actions/checkout@v4
with:
submodules: recursive

- name: Install Dependencies on Linux
if: ${{ runner.os == 'Linux' }}
run: |
sudo apt update -qq
sudo apt install -y gdb doxygen libgraphviz-dev
- name: Install ninja-build tool (must be after Qt due PATH changes)
uses: turtlesec-no/get-ninja@main
Expand All @@ -59,17 +67,12 @@ jobs:
- name: Configure project
run: >
cmake -S . -G Ninja --preset ${{ matrix.config.preset }}
-DGAMMARAY_WITH_KDSME=${{ runner.os == 'Linux' }}
-DGAMMARAY_BUILD_DOCS=${{ runner.os == 'Linux' }}
- name: Build Project
run: cmake --build ./build-${{ matrix.config.preset }}

- name: Install dependencies on Ubuntu
if: ${{ runner.os == 'Linux' }}
run: |
sudo apt update -qq
sudo apt install -y gdb
- name: Enable gdb attaching
if: ${{ runner.os == 'Linux' }}
run: echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope
Expand Down
12 changes: 12 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# This file is part of GammaRay, the Qt application inspection and manipulation tool.
#
# SPDX-FileCopyrightText: 2010 Klarälvdalens Datakonsult AB, a KDAB Group company <[email protected]>
#
# SPDX-License-Identifier: GPL-2.0-or-later
#
# Contact KDAB at <[email protected]> for commercial licensing options.
#

[submodule "3rdparty/KDStateMachineEditor"]
path = 3rdparty/KDStateMachineEditor
url = https://github.com/KDAB/KDStateMachineEditor.git
36 changes: 36 additions & 0 deletions 3rdparty/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# This file is part of GammaRay, the Qt application inspection and manipulation tool.
#
# SPDX-FileCopyrightText: 2024 Klarälvdalens Datakonsult AB, a KDAB Group company <[email protected]>
#
# SPDX-License-Identifier: GPL-2.0-or-later
#
# Contact KDAB at <[email protected]> for commercial licensing options.
#

if(GAMMARAY_WITH_KDSME)
function(add_ksme_subdirectory)
# Function creates extra scope to keep these variables local
set(BUILD_DOCS OFF)
set(BUILD_EXAMPLES OFF)
set(BUILD_TESTS OFF)

set(KDSME_PACKAGE_NAME KDSME)
if(QT_VERSION_MAJOR GREATER_EQUAL 6)
set(KDSME_PACKAGE_NAME KDSME-qt6)
set(BUILD_QT6 ON)
endif()
set_package_properties(
${KDSME_PACKAGE_NAME} PROPERTIES
URL "https://github.com/KDAB/KDStateMachineEditor"
DESCRIPTION "KDAB State Machine Editor framework"
TYPE RECOMMENDED
PURPOSE "Graphical state machine debugging."
)

gammaray_ensure_submodule_exists(KDStateMachineEditor)
add_subdirectory(KDStateMachineEditor)
endfunction()
add_ksme_subdirectory()
endif()

add_subdirectory(kde)
1 change: 1 addition & 0 deletions 3rdparty/KDStateMachineEditor
Submodule KDStateMachineEditor added at 2567f4
7 changes: 6 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@
# Enable Precompiled Headers support
# Default=false
#
# -DGAMMARAY_WITH_KDSME=[true|false]
# Enable State Machine Viewer Plugin UI by requiring KDAB State Machine Editor
# Default=false
#
# -DENABLE_GOLD_LINKER=[true|false]
# Use GNU gold linker
# Default=false
Expand Down Expand Up @@ -250,6 +254,7 @@ endif()
gammaray_option(GAMMARAY_INSTALL_QT_LAYOUT "Install into Qt directory layout." OFF)
gammaray_option(GAMMARAY_MULTI_BUILD "Build multiple applicable probe configurations." ON)
gammaray_option(GAMMARAY_BUILD_CLI_INJECTOR "Build command line injector on Windows." ON)
gammaray_option(GAMMARAY_WITH_KDSME "Enable State Machine UI with KDSME" OFF)

set(GAMMARAY_BUILD_DOCS_DEFAULT ON)
set(GAMMARAY_DISABLE_FEEDBACK_DEFAULT OFF)
Expand Down Expand Up @@ -797,7 +802,7 @@ include_directories(${CMAKE_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/3rdparty ${CMAKE_BIN

include(KDQtInstallPaths) #to set QT_INSTALL_FOO variables
add_subdirectory(cmake)
add_subdirectory(3rdparty/kde)
add_subdirectory(3rdparty)
add_subdirectory(common)
add_subdirectory(core)
add_subdirectory(probe)
Expand Down
16 changes: 16 additions & 0 deletions cmake/GammaRayMacrosInternal.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -132,3 +132,19 @@ macro(gammaray_add_dummy_package _package _found)
list(APPEND _packages ${_package})
set_property(GLOBAL PROPERTY ${_property_name} "${_packages}")
endmacro()

# Check if some required submodule is initialized
function(gammaray_ensure_submodule_exists submodule)
if(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${submodule}/.git")
if(EXISTS "${appframework_SOURCE_DIR}/.git")
message(
FATAL_ERROR
"The git submodule ${submodule} is not initialized.\n"
"Please run the following command in the source directory (${appframework_SOURCE_DIR}):\n"
" git submodule update --init --recursive ${CMAKE_CURRENT_SOURCE_DIR}/${submodule}\n"
)
else()
message(FATAL_ERROR "The submodules are missing - please report a broken source package.\n")
endif()
endif()
endfunction()
16 changes: 1 addition & 15 deletions plugins/statemachineviewer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,22 +46,8 @@ if(NOT GAMMARAY_CLIENT_ONLY_BUILD)
endif()
endif()

# UI part - dependencies
set(KDSME_PACKAGE_NAME KDSME)
if(QT_VERSION_MAJOR GREATER_EQUAL 6)
set(KDSME_PACKAGE_NAME KDSME-qt6)
endif()
set_package_properties(
${KDSME_PACKAGE_NAME} PROPERTIES
URL "https://github.com/KDAB/KDStateMachineEditor"
DESCRIPTION "KDAB State Machine Editor framework"
TYPE RECOMMENDED
PURPOSE "Graphical state machine debugging."
)
find_package(${KDSME_PACKAGE_NAME} 1.2 CONFIG QUIET)

# UI part
if(GAMMARAY_BUILD_UI AND ${KDSME_PACKAGE_NAME}_FOUND)
if(GAMMARAY_BUILD_UI AND GAMMARAY_WITH_KDSME)

set(gammaray_statemachineviewer_ui_plugin_srcs statemachineviewerwidget.cpp statemachineviewerclient.cpp
statemodeldelegate.cpp
Expand Down
16 changes: 8 additions & 8 deletions plugins/statemachineviewer/statemachineviewerwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@
#include <ui/contextmenuextension.h>
#include <ui/clientdecorationidentityproxymodel.h>

#include <kdstatemachineeditor/core/elementmodel.h>
#include <kdstatemachineeditor/core/layoutproperties.h>
#include <kdstatemachineeditor/core/state.h>
#include <kdstatemachineeditor/core/transition.h>
#include <kdstatemachineeditor/core/runtimecontroller.h>
#include <kdstatemachineeditor/view/statemachinescene.h>
#include <kdstatemachineeditor/view/statemachinetoolbar.h>
#include <kdstatemachineeditor/view/statemachineview.h>
#include <elementmodel.h>
#include <layoutproperties.h>
#include <state.h>
#include <transition.h>
#include <runtimecontroller.h>
#include <statemachinescene.h>
#include <statemachinetoolbar.h>
#include <statemachineview.h>

#include <QDebug>
#include <QMenu>
Expand Down

0 comments on commit 02f7f6a

Please sign in to comment.