-
Notifications
You must be signed in to change notification settings - Fork 285
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add KDSME as submodule for CI testing #905
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
Submodule KDStateMachineEditor
added at
2567f4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This breaks the ability to use a KDSME package installed separately on the system, doesn't it? Since
find_package()
is no longer even attempted, even if KDSME is installed, it won't be used — the submodule is the only option. And if the.git
directory isn't present (e.g. package releases), there's no way to make it use a KDSME at all.Distro packagers won't like that, for one. ...Unless I'm completely missing something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FTR, my suggestion would be to keep the
find_package()
, but insert a condition to trigger the submodule stuff:Maybe even change the option name to
GAMMARAY_USE_INTERNAL_KDSME
or something.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it breaks, I did that because of the includes.
@winterz @Waqar144 thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A fourth option:
add_subdirectory()
, have the CI build-and-install KDSME from there before it configures GammaRay. Then pick it up withfind_package()
as usual.The built KDSME could even be added to the GitHub cache, to speed things up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or, in fact, you could use FetchContent to incorporate the submodule'd KDSME — with CMake 3.24+, if you give
FetchContent_Declare()
aFIND_PACKAGE_ARGS
argument, it'll automatically automatically try afind_package()
first, and use the installed package if it's found.(
FetchContent_Declare()
doesn't have to download it from a remote repo. LikeExternalProject_Add()
, you can give it aSOURCE_DIR
argument with the path to existing sources.)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FetchContent doesn't solve the include issue, it's just a little better ExternalProject_Add() but we are avoiding it in favor of submodules.