summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorGravatar Grace Karanja <gracie.karanja89@gmail.com>2015-05-27 15:33:23 +0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-06-20 14:18:06 -0700
commit48a54d034863ec4b9a4e68a725dbc78e8629f2a5 (patch)
treedcb08c58364cb5ee3bd890a60bccdd5279bdbf98 /CMakeLists.txt
parente2c1d24d02be8be0a056bd5bca65a619bf870831 (diff)
downloadsubsurface-48a54d034863ec4b9a4e68a725dbc78e8629f2a5.tar.gz
Add subsurface-mobile app to cmake
Add a subsurface-mobile entry to the CMakeLists.txt file. When cmake is run with -DSUBSURFACE_MOBILE=True, the compiled app will be named subsurface-mobile, and the initial page (main.qml) will automatically be loaded. This will ensure that the mobile app will be linked to QtQuick. Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt49
1 files changed, 37 insertions, 12 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index cb5082d49..b602a4793 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -135,8 +135,14 @@ if(NOT (insource OR insourcedir))
endif()
# configure Qt.
-find_package(Qt5 REQUIRED COMPONENTS Core Concurrent Widgets Network WebKitWidgets PrintSupport Svg Test LinguistTools)
+if(SUBSURFACE_MOBILE)
+ set(QT_QUICK 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)
+endif()
set(QT_TEST_LIBRARIES ${QT_LIBRARIES} Qt5::Test)
# Generate the ssrf-config.h every 'make'
@@ -416,17 +422,32 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
endif()
# create the executables
-add_executable(${SUBSURFACE_TARGET} MACOSX_BUNDLE WIN32 ${SUBSURFACE_PKG} ${SUBSURFACE_APP} ${SUBSURFACE_RESOURCES})
-target_link_libraries(
- ${SUBSURFACE_TARGET}
- subsurface_generated_ui
- subsurface_interface
- subsurface_profile
- subsurface_statistics
- subsurface_models
- subsurface_corelib
- ${SUBSURFACE_LINK_LIBRARIES}
+if(SUBSURFACE_MOBILE)
+ add_definitions(-DSUBSURFACE_MOBILE)
+ qt5_add_resources(MOBILE_RESOURCES qt-mobile/mobile-resources.qrc)
+ add_executable(subsurface-mobile ${SUBSURFACE_PKG} ${SUBSURFACE_APP} ${SUBSURFACE_RESOURCES} ${MOBILE_RESOURCES})
+ target_link_libraries(
+ subsurface-mobile
+ subsurface_generated_ui
+ subsurface_interface
+ subsurface_profile
+ subsurface_statistics
+ subsurface_models
+ subsurface_corelib
+ ${SUBSURFACE_LINK_LIBRARIES})
+else()
+ add_executable(${SUBSURFACE_TARGET} MACOSX_BUNDLE WIN32 ${SUBSURFACE_PKG} ${SUBSURFACE_APP} ${SUBSURFACE_RESOURCES})
+ target_link_libraries(
+ ${SUBSURFACE_TARGET}
+ subsurface_generated_ui
+ subsurface_interface
+ subsurface_profile
+ subsurface_statistics
+ subsurface_models
+ subsurface_corelib
+ ${SUBSURFACE_LINK_LIBRARIES}
)
+endif()
add_dependencies(subsurface_statistics subsurface_generated_ui)
add_dependencies(subsurface_profile subsurface_generated_ui)
@@ -661,7 +682,11 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
install(DIRECTORY theme DESTINATION share/subsurface)
install(DIRECTORY printing_templates DESTINATION share/subsurface)
install(FILES ${TRANSLATIONS} DESTINATION share/subsurface/translations)
- install(TARGETS ${SUBSURFACE_TARGET} DESTINATION bin)
+ if(SUBSURFACE_MOBILE)
+ install(TARGETS subsurface-mobile DESTINATION bin)
+ else()
+ install(TARGETS ${SUBSURFACE_TARGET} DESTINATION bin)
+ endif()
if(DEFINED LIBMARBLEDEVEL)
install(
CODE "file(GLOB SSRFMARBLE_SHLIBS \"${LIBMARBLEDEVEL}/lib/libssrfmarblewidget.so*\")"