From 9217a03ef3f6bd0e96b6ea4b5ae366c5b3f02379 Mon Sep 17 00:00:00 2001 From: Anton Lundin Date: Fri, 10 Jul 2015 00:02:35 +0200 Subject: Teach android build about subsurface-mobile This teaches android build.sh and cmake about how to build the qml ui of subsurface-mobile as a apk. Signed-off-by: Anton Lundin Signed-off-by: Dirk Hohndel --- CMakeLists.txt | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 1d002a014..6e938a3e0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -456,7 +456,11 @@ if(SUBSURFACE_MOBILE) set(MOBILE_SRC qt-mobile/qmlmanager.cpp qt-models/divelistmodel.cpp) add_definitions(-DSUBSURFACE_MOBILE) qt5_add_resources(MOBILE_RESOURCES qt-mobile/mobile-resources.qrc) - add_executable(subsurface-mobile ${MOBILE_SRC} ${SUBSURFACE_PKG} ${SUBSURFACE_APP} ${SUBSURFACE_RESOURCES} ${MOBILE_RESOURCES}) + if(ANDROID) + add_library(subsurface-mobile SHARED ${MOBILE_SRC} ${SUBSURFACE_PKG} ${SUBSURFACE_APP} ${SUBSURFACE_RESOURCES} ${MOBILE_RESOURCES}) + else() + add_executable(subsurface-mobile ${MOBILE_SRC} ${SUBSURFACE_PKG} ${SUBSURFACE_APP} ${SUBSURFACE_RESOURCES} ${MOBILE_RESOURCES}) + endif() target_link_libraries( subsurface-mobile subsurface_generated_ui @@ -717,11 +721,15 @@ if(ANDROID) # Android template directory set(ANDROID_PACKAGE_SOURCE_DIR, ${CMAKE_BINARY_DIR}/android) include(${QT_ANDROID_CMAKE}) - add_qt_android_apk(subsurface.apk ${SUBSURFACE_TARGET} - NAME "Subsurface" - PACKAGE_NAME "org.subsurfacedivelog" - PACKAGE_SOURCES ${CMAKE_CURRENT_LIST_DIR}/android + if(SUBSURFACE_MOBILE) + add_qt_android_apk(subsurface-mobile.apk subsurface-mobile + PACKAGE_SOURCES ${CMAKE_CURRENT_LIST_DIR}/android ) + else() + add_qt_android_apk(subsurface.apk ${SUBSURFACE_TARGET} + PACKAGE_SOURCES ${CMAKE_CURRENT_LIST_DIR}/android + ) + endif() endif() if(CMAKE_SYSTEM_NAME STREQUAL "Linux") -- cgit v1.2.3-70-g09d2