aboutsummaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2020-11-23 09:34:02 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2020-12-17 09:17:54 -0800
commit0851224b6c53d1023ea7b2d8642de77608475e44 (patch)
treed314f6cf5e07d9bfcdfaafea238eede07587c83b /CMakeLists.txt
parentdaebd0ad0e49f7577a45c182d738f03b157d05df (diff)
downloadsubsurface-0851224b6c53d1023ea7b2d8642de77608475e44.tar.gz
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>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt33
1 files changed, 19 insertions, 14 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 79fd6eddd..0f23e1323 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -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")