Allow Kirigami build without KWin tablet mode dependency
ClosedPublic

Authored by murillobernardes on May 27 2018, 1:22 PM.

Details

Summary

Even on linux it might be the case to not need/want the tablet mode manager dependency.

This is the case for Subsurface-mobile, where desktop builds (linux and Mac) are used for development, with the final target being iOS and Android.

Diff Detail

Repository
R169 Kirigami
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
Restricted Application added a subscriber: plasma-devel. · View Herald TranscriptMay 27 2018, 1:22 PM
murillobernardes requested review of this revision.May 27 2018, 1:22 PM
davidedmundson requested changes to this revision.May 27 2018, 5:26 PM
davidedmundson added a subscriber: davidedmundson.

This doesn't achieve anything useful.

You're not changing any dependencies as you still link against DBus as CMake is unchanged in this patch.

Code behaves the same as not having KWin at runtime will result in both values being the exact same values as we're doing with this patch

This revision now requires changes to proceed.May 27 2018, 5:26 PM
murillobernardes added a comment.EditedMay 27 2018, 6:06 PM

This doesn't achieve anything useful.

It does for projects that have their own build system.

You're not changing any dependencies as you still link against DBus as CMake is unchanged in this patch.

I understand this does not change how the upstream build is done, but allows users to keep depending only on Qt.

I did not patch CMakeLists.txt because I can't test it. I could not get a system with all the right versions of all build dependencies to build Kirigami.

On Subsurface-mobile we simply have our own integrated qmake/cmake files that builds Kirigami statically with the rest of the project.

Code behaves the same as not having KWin at runtime will result in both values being the exact same values as we're doing with this patch

So the real issue here is the new dependency on linux. Whatever way we can use to disable it is fine.

mart added a comment.May 28 2018, 12:26 PM

I did not patch CMakeLists.txt because I can't test it. I could not get a system with all the right versions of all build dependencies to build Kirigami.

On Subsurface-mobile we simply have our own integrated qmake/cmake files that builds Kirigami statically with the rest of the project.

yeah, i know how is done... tough is it a build time or a runtime problem? there is an environment variable to force tablet mode alreeady

Code behaves the same as not having KWin at runtime will result in both values being the exact same values as we're doing with this patch

So the real issue here is the new dependency on linux. Whatever way we can use to disable it is fine.

what would make sense, instead a force_tablet_mode , is to make the dependency to dbus optional on all platforms

In D13148#269556, @mart wrote:

I did not patch CMakeLists.txt because I can't test it. I could not get a system with all the right versions of all build dependencies to build Kirigami.

On Subsurface-mobile we simply have our own integrated qmake/cmake files that builds Kirigami statically with the rest of the project.

yeah, i know how is done... tough is it a build time or a runtime problem? there is an environment variable to force tablet mode alreeady

Build time. No tabletmodemanager_interface.h available.

Code behaves the same as not having KWin at runtime will result in both values being the exact same values as we're doing with this patch

So the real issue here is the new dependency on linux. Whatever way we can use to disable it is fine.

what would make sense, instead a force_tablet_mode , is to make the dependency to dbus optional on all platforms

Agreed. What would be an acceptable way to do this then?

Add option to disable dbus dependency (build time).

mart added a comment.EditedMay 29 2018, 10:03 AM

almost there :)
since there is also a qmake mode to build for embedded, where dbus should be disabled as well, I would prefer to flip the logic.
so, have a KIRIGAMI_ENABLE_DBUS which is undefined by default (so nothing to do in the .pri file)
but having it defined by default in the main cmake file, so would become

NOT(APPLE) AND NOT(DISABLE_DBUS))
​ find_package(Qt5DBus)
​ add_definitions(-DKIRIGAMI_ENABLE_DBUS)
endif()

If we have an defined(KIRIGAMI_USE_DBUS) we don't need to put
if (!APPLE && ......) in the code which would be much much cleaner.

Update based on your comments.

The MacOS elif is the same as the else, so I removed.

mart accepted this revision.May 30 2018, 8:45 AM

Sorry, first time contributing to kde-related project.

I’m not sure what I need to do next? Send a pull request somewhere?

apol added a subscriber: apol.Jun 1 2018, 12:04 AM

Sorry, first time contributing to kde-related project.

I’m not sure what I need to do next? Send a pull request somewhere?

No, you just would land the patch. I'm guessing you don't have contributor powers as it's your first time, I'll land it for you.

This revision was not accepted when it landed; it landed in state Needs Review.Jun 1 2018, 12:06 AM
This revision was automatically updated to reflect the committed changes.