aboutsummaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt41
1 files changed, 33 insertions, 8 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2424376d7..534e8e2b6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -14,13 +14,13 @@ option(NO_MARBLE "disable the marble widget" OFF)
option(NO_TESTS "disable the tests" OFF)
option(NO_DOCS "disable the docs" OFF)
option(NO_PRINTING "disable the printing support" ON)
+option(NO_USERMANUAL "don't include a viewer for the user manual" OFF)
option(USE_LIBGIT23_API "allow building with libgit2 master" OFF)
option(SUBSURFACE_MOBILE "build the QtQuick version for mobile device" OFF)
set(CMAKE_MODULE_PATH
${CMAKE_MODULE_PATH}
${${PROJECT_NAME}_SOURCE_DIR}/cmake/Modules
- ${${PROJECT_NAME}_SOURCE_SIR}/../install-root/lib/cmake/libssh2
)
include_directories(.
@@ -119,6 +119,17 @@ else()
printer.cpp
templatelayout.cpp
)
+ set(PRINTING_PKG PrintSupport)
+ set(PRINTING_LIB Qt5::PrintSupport)
+endif()
+
+if(NO_USERMANUAL)
+ message(STATUS "building without usermanual")
+ add_definitions(-DNO_USERMANUAL)
+else()
+ set(USERMANUAL qt-ui/usermanual.cpp)
+ set(WEBKIT_PKG WebKitWidgets)
+ set(WEBKIT_LIB Qt5::WebKitWidgets)
endif()
set(SUBSURFACE_LINK_LIBRARIES ${SUBSURFACE_LINK_LIBRARIES} ${LIBDIVECOMPUTER_LIBRARIES} ${LIBGIT2_LIBRARIES} ${GRANTLEE_LIBRARIES} -lusb-1.0)
@@ -140,13 +151,15 @@ endif()
# configure Qt.
if(SUBSURFACE_MOBILE)
- set(QT_QUICK Quick)
+ set(QT_QUICK_PKG Quick)
+ set(QT_QUICK_LIB Qt5::Quick)
endif()
-find_package(Qt5 REQUIRED COMPONENTS Core Concurrent Widgets Network WebKitWidgets PrintSupport Svg Test LinguistTools ${QT_QUICK})
-set(QT_LIBRARIES Qt5::Core Qt5::Concurrent Qt5::Widgets Qt5::Network Qt5::WebKitWidgets Qt5::PrintSupport Qt5::Svg)
-if(SUBSURFACE_MOBILE)
- set(QT_LIBRARIES ${QT_LIBRARIES} Qt5::Quick)
+if(CMAKE_SYSTEM_NAME STREQUAL "Android")
+ set(ANDROID_PKG AndroidExtras)
+ set(ANDROID_LIB Qt5::AndroidExtras)
endif()
+find_package(Qt5 REQUIRED COMPONENTS Core Concurrent Widgets Network ${WEBKIT_PKG} ${PRINTING_PKG} Svg Test LinguistTools ${QT_QUICK_PKG} ${ANDROID_PKG})
+set(QT_LIBRARIES Qt5::Core Qt5::Concurrent Qt5::Widgets Qt5::Network ${WEBKIT_LIB} ${PRINTING_LIB} Qt5::Svg ${QT_QUICK_PKG} ${ANDROID_LIB})
set(QT_TEST_LIBRARIES ${QT_LIBRARIES} Qt5::Test)
# Generate the ssrf-config.h every 'make'
@@ -213,6 +226,12 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
# in some builds we appear to be missing libz for some strange reason...
set(SUBSURFACE_LINK_LIBRARIES ${SUBSURFACE_LINK_LIBRARIES} -lz)
endif()
+if(CMAKE_SYSTEM_NAME STREQUAL "Android")
+ set(PLATFORM_SRC android.cpp)
+ # FIXME: Shouldn't cmake/Qt add this automatically somehow?
+ add_definitions(-DQ_OS_ANDROID)
+ set(SUBSURFACE_TARGET subsurface)
+endif()
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
set(FBSUPPORT 1)
set(SUBSURFACE_TARGET Subsurface)
@@ -353,7 +372,7 @@ set(SUBSURFACE_INTERFACE
qt-ui/divelogimportdialog.cpp
qt-ui/tagwidget.cpp
qt-ui/groupedlineedit.cpp
- qt-ui/usermanual.cpp
+ ${USERMANUAL}
qt-ui/divelogexportdialog.cpp
qt-ui/divepicturewidget.cpp
qt-ui/usersurvey.cpp
@@ -442,7 +461,13 @@ if(SUBSURFACE_MOBILE)
subsurface_corelib
${SUBSURFACE_LINK_LIBRARIES})
else()
- add_executable(${SUBSURFACE_TARGET} MACOSX_BUNDLE WIN32 ${SUBSURFACE_PKG} ${SUBSURFACE_APP} ${SUBSURFACE_RESOURCES})
+ if(CMAKE_SYSTEM_NAME STREQUAL "Android")
+ # FIXME: is this the right way to link somehting which
+ # androiddeployqt can work with?
+ add_library(${SUBSURFACE_TARGET} SHARED ${SUBSURFACE_PKG} ${SUBSURFACE_APP} ${SUBSURFACE_RESOURCES})
+ else()
+ add_executable(${SUBSURFACE_TARGET} MACOSX_BUNDLE WIN32 ${SUBSURFACE_PKG} ${SUBSURFACE_APP} ${SUBSURFACE_RESOURCES})
+ endif()
target_link_libraries(
${SUBSURFACE_TARGET}
subsurface_generated_ui