From 48a54d034863ec4b9a4e68a725dbc78e8629f2a5 Mon Sep 17 00:00:00 2001 From: Grace Karanja Date: Wed, 27 May 2015 15:33:23 +0300 Subject: 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 Signed-off-by: Dirk Hohndel --- CMakeLists.txt | 49 +++++++++++++++++++++++++++++++++++++------------ 1 file changed, 37 insertions(+), 12 deletions(-) (limited to 'CMakeLists.txt') 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*\")" -- cgit v1.2.3-70-g09d2