mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-27 20:58:47 +00:00
mobile/kirigami: first steps to switching to Kirigami 5.76
Our half-assed manual build of Kirigami was becoming completely unmaintainable. So let's try to use the build method that the Kirigami team recommends. Which unfortunately requires us to have access to the KDE extra cmake modules (ECM). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
daebd0ad0e
commit
0851224b6c
6 changed files with 36 additions and 58 deletions
|
@ -328,25 +328,29 @@ endif()
|
|||
|
||||
# create the executables
|
||||
if (SUBSURFACE_TARGET_EXECUTABLE MATCHES "MobileExecutable")
|
||||
# set up Kirigami using KDE ECM
|
||||
# that's available as kde-extra-cmake-modules on Homebrew, on all Linux flavors
|
||||
# Android and iOS are built via qmake, Windows build of Subsurface-mobile isn't supported
|
||||
find_package(ECM REQUIRED CONFIG)
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/ ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH})
|
||||
set(BREEZEICONS_DIR mobile-widgets/3rdparty/breeze-icons/)
|
||||
|
||||
SET(QML_IMPORT_PATH ${QML_IMPORT_PATH} ${CMAKE_SOURCE_DIR}/mobile-widgets/3rdparty/kirigami/src ${CMAKE_SOURCE_DIR}/mobile-widgets/qml)
|
||||
add_subdirectory(mobile-widgets/3rdparty)
|
||||
include_directories(${CMAKE_SOURCE_DIR}/mobile-widgets/3rdparty/kirigami/src)
|
||||
include(${CMAKE_SOURCE_DIR}/mobile-widgets/3rdparty/kirigami/KF5Kirigami2Macros.cmake)
|
||||
|
||||
set(MOBILE_SRC
|
||||
subsurface-mobile-main.cpp
|
||||
subsurface-helper.cpp
|
||||
)
|
||||
include_directories(${CMAKE_SOURCE_DIR}/mobile-widgets/qml/kirigami/src/libkirigami)
|
||||
add_definitions(-DKIRIGAMI_BUILD_TYPE_STATIC)
|
||||
qt5_add_resources(MOBILE_RESOURCES mobile-widgets/qml/mobile-resources.qrc)
|
||||
qt5_add_resources(MOBILE_RESOURCES mobile-widgets/qml/kirigami/kirigami.qrc)
|
||||
# When building the mobile application in Android, link it and Qt will do the rest, when doing the mobile application on Desktop, create an executable.
|
||||
if(ANDROID)
|
||||
qt5_add_resources(MOBILE_RESOURCES android-mobile/font.qrc)
|
||||
add_library(${SUBSURFACE_TARGET} SHARED ${SUBSURFACE_PKG} ${MOBILE_SRC} ${SUBSURFACE_RESOURCES} ${MOBILE_RESOURCES})
|
||||
else()
|
||||
# the following is split across two commands since in cmake 3.12 this would result
|
||||
# in a non-sensical "no sources given to target" error if done all as one set of
|
||||
# arguments to the add_executable() call
|
||||
add_executable(${SUBSURFACE_TARGET} ${SUBSURFACE_PKG} ${SUBSURFACE_RESOURCES})
|
||||
target_sources(${SUBSURFACE_TARGET} PUBLIC ${MOBILE_SRC} ${MOBILE_RESOURCES})
|
||||
endif()
|
||||
|
||||
# the following is split across two commands since in cmake 3.12 this would result
|
||||
# in a non-sensical "no sources given to target" error if done all as one set of
|
||||
# arguments to the add_executable() call
|
||||
add_executable(${SUBSURFACE_TARGET} ${SUBSURFACE_PKG} ${SUBSURFACE_RESOURCES})
|
||||
target_sources(${SUBSURFACE_TARGET} PUBLIC ${MOBILE_SRC} ${MOBILE_RESOURCES})
|
||||
target_link_libraries(
|
||||
${SUBSURFACE_TARGET}
|
||||
subsurface_mobile
|
||||
|
@ -356,6 +360,7 @@ if (SUBSURFACE_TARGET_EXECUTABLE MATCHES "MobileExecutable")
|
|||
subsurface_models_mobile
|
||||
subsurface_commands
|
||||
subsurface_corelib
|
||||
kirigamiplugin
|
||||
${SUBSURFACE_LINK_LIBRARIES}
|
||||
)
|
||||
elseif (SUBSURFACE_TARGET_EXECUTABLE MATCHES "DesktopExecutable")
|
||||
|
|
4
mobile-widgets/3rdparty/CMakeLists.txt
vendored
Normal file
4
mobile-widgets/3rdparty/CMakeLists.txt
vendored
Normal file
|
@ -0,0 +1,4 @@
|
|||
# simply pull in Kirigami, making sure it's statically built
|
||||
option(BUILD_SHARED_LIBS "Build a shared module" OFF)
|
||||
|
||||
add_subdirectory(kirigami)
|
|
@ -4,25 +4,9 @@ set(SUBSURFACE_MOBILE_SRCS
|
|||
qmlinterface.cpp
|
||||
qmlmanager.cpp
|
||||
themeinterface.cpp
|
||||
qml/kirigami/src/columnview.cpp
|
||||
qml/kirigami/src/delegaterecycler.cpp
|
||||
qml/kirigami/src/enums.cpp
|
||||
qml/kirigami/src/formlayoutattached.cpp
|
||||
qml/kirigami/src/icon.cpp
|
||||
qml/kirigami/src/kirigamiplugin.cpp
|
||||
qml/kirigami/src/mnemonicattached.cpp
|
||||
qml/kirigami/src/scenepositionattached.cpp
|
||||
qml/kirigami/src/settings.cpp
|
||||
qml/kirigami/src/wheelhandler.cpp
|
||||
qml/kirigami/src/libkirigami/basictheme.cpp
|
||||
qml/kirigami/src/libkirigami/kirigamipluginfactory.cpp
|
||||
qml/kirigami/src/libkirigami/platformtheme.cpp
|
||||
qml/kirigami/src/libkirigami/tabletmodewatcher.cpp
|
||||
)
|
||||
|
||||
if (SUBSURFACE_TARGET_EXECUTABLE MATCHES "MobileExecutable")
|
||||
include_directories(${CMAKE_SOURCE_DIR}/mobile-widgets/qml/kirigami/src/libkirigami)
|
||||
add_definitions(-DKIRIGAMI_BUILD_TYPE_STATIC)
|
||||
add_library(subsurface_mobile STATIC ${SUBSURFACE_MOBILE_SRCS})
|
||||
target_link_libraries(subsurface_mobile ${QT_LIBRARIES})
|
||||
endif()
|
||||
|
|
|
@ -96,34 +96,8 @@
|
|||
<file alias="icons/ic_sort.svg">icons/ic_sort_24px.svg</file>
|
||||
<file alias="icons/trip_details.svg">icons/local_offer.svg</file>
|
||||
|
||||
<!-- ********** kirigami icons ********** -->
|
||||
<file alias="icons/application-menu.svg">kirigami/icons/application-menu.svg</file>
|
||||
<file alias="icons/dialog-cancel.svg">kirigami/icons/dialog-cancel.svg</file>
|
||||
<file alias="icons/distribute-horizontal-x.svg">kirigami/icons/distribute-horizontal-x.svg</file>
|
||||
<file alias="icons/document-edit.svg">kirigami/icons/document-edit.svg</file>
|
||||
<file alias="icons/document-save.svg">kirigami/icons/document-save.svg</file>
|
||||
<file alias="icons/go-up.svg">kirigami/icons/go-up.svg</file>
|
||||
<file alias="icons/gps.svg">kirigami/icons/gps.svg</file>
|
||||
<file alias="icons/handle-left.svg">kirigami/icons/handle-left.svg</file>
|
||||
<file alias="icons/handle-right.svg">kirigami/icons/handle-right.svg</file>
|
||||
<file alias="icons/map-globe.svg">kirigami/icons/map-globe.svg</file>
|
||||
<file alias="icons/list-add.svg">kirigami/icons/list-add.svg</file>
|
||||
<file alias="icons/overflow-menu.svg">kirigami/icons/overflow-menu.svg</file>
|
||||
<file alias="icons/trash-empty.svg">kirigami/icons/trash-empty.svg</file>
|
||||
<file alias="icons/edit-copy.svg">kirigami/icons/edit-copy.svg</file>
|
||||
<file alias="icons/edit-paste.svg">kirigami/icons/edit-paste.svg</file>
|
||||
<file alias="icons/view-readermode.svg">kirigami/icons/view-readermode.svg</file>
|
||||
</qresource>
|
||||
|
||||
<qresource prefix="/">
|
||||
<!-- ********** kirigami icons ********** -->
|
||||
<file alias="/org/kde/kirigami/templates/private/go-next-symbolic">kirigami/icons/go-next.svg</file>
|
||||
<file alias="/org/kde/kirigami/templates/private/go-previous-symbolic">kirigami/icons/go-previous.svg</file>
|
||||
<file alias="go-next-symbolic">kirigami/icons/go-next.svg</file>
|
||||
<file alias="go-previous-symbolic">kirigami/icons/go-previous.svg</file>
|
||||
</qresource>
|
||||
|
||||
|
||||
<qresource prefix="/xslt">
|
||||
<!-- ********** xslt ********** -->
|
||||
<file alias="commonTemplates.xsl">../../xslt/commonTemplates.xsl</file>
|
||||
|
|
|
@ -13,7 +13,7 @@ CURRENT_XSLT="v1.1.34"
|
|||
CURRENT_SQLITE="3190200"
|
||||
CURRENT_LIBXML2="v2.9.4"
|
||||
CURRENT_LIBFTDI="1.3"
|
||||
CURRENT_KIRIGAMI="v5.62.0"
|
||||
CURRENT_KIRIGAMI="v5.76.0"
|
||||
CURRENT_BREEZE_ICONS="4daac191fb33c8c03bba8356db9767816cb8ee02"
|
||||
CURRENT_MDBTOOLS="master"
|
||||
CURRENT_QT_ANDROID_CMAKE="master"
|
||||
|
|
|
@ -14,6 +14,17 @@ if [ ! -d "$SRC/subsurface" ] || [ ! -d "mobile-widgets" ] || [ ! -d "core" ] ;
|
|||
exit 1
|
||||
fi
|
||||
|
||||
# completely changing the Kirigami build, going down the path that the
|
||||
# Kirigami developers favor, which is to install Kirigami and Breeze in
|
||||
# a 3rdparty folder within our sources
|
||||
./scripts/get-dep-lib.sh single "$SRC"/subsurface/mobile-widgets/3rdparty kirigami
|
||||
./scripts/get-dep-lib.sh single "$SRC"/subsurface/mobile-widgets/3rdparty breeze-icons
|
||||
|
||||
|
||||
exit 0
|
||||
|
||||
|
||||
|
||||
# now bring in the latest Kirigami mobile components plus a couple of icons that we need
|
||||
# first, get the latest from upstream
|
||||
# yes, this is a bit overkill as we clone a lot of stuff for just a few files, but this way
|
||||
|
@ -64,7 +75,7 @@ sed -i -e "s/width: backgroundRect/enabled: root.enabled; width: backgroundRe
|
|||
# double defined symbols in our setting. I would like a nicer fix for this
|
||||
# issue, but failed to find one. For example, not adding the resource in
|
||||
# our build causes the qrc file not to be generated. Manual generation
|
||||
# of the resource file (using rcc) introduces the double symbols again.
|
||||
# of the resource file (using rcc) introduces the double symbols again.
|
||||
# so it seems some Kirigami weirdness (but their staticcmake example compiles
|
||||
# correctly).
|
||||
|
||||
|
|
Loading…
Reference in a new issue