diff options
author | Anton Lundin <glance@acc.umu.se> | 2015-07-10 00:02:35 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-07-09 15:10:48 -0700 |
commit | 9217a03ef3f6bd0e96b6ea4b5ae366c5b3f02379 (patch) | |
tree | 3bffcb5ee1ebbacf32a208cb4c821fb4c76e2d34 /CMakeLists.txt | |
parent | e16b1162977ac1bf293f0c39a7a8e679935a5ce9 (diff) | |
download | subsurface-9217a03ef3f6bd0e96b6ea4b5ae366c5b3f02379.tar.gz |
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 <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 18 |
1 files changed, 13 insertions, 5 deletions
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") |