summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tomaz.canabrava@intel.com>2015-09-03 14:49:59 -0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-10-30 10:36:49 -0700
commit45c97640739198cf9a9cc5c42e81fb9811702b46 (patch)
tree4390fe4387d073ac7802bb6bff3bc0bbe69a836d /CMakeLists.txt
parente49d6213ad129284a45d53c3fcdc03249e84efe2 (diff)
downloadsubsurface-45c97640739198cf9a9cc5c42e81fb9811702b46.tar.gz
main.cpp -> {android-main, desktop-main}
This is needed to compile both in a single call to make. Also it will help removing some of the mistakes in the current android version: it always created the mainwindow, even without using it for anything, so tons of memory will be freed now for the android version, making it snappier and smoother. This is a necessary move so we don't need to #ifdef all over the place for the two different versions, and imo the changes needed to keep both versions will not be that huge if we keep things in subsurface-core sane. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt52
1 files changed, 30 insertions, 22 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 74b9d0d94..620b496ff 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -347,9 +347,10 @@ source_group("Subsurface Models" FILES ${SUBSURFACE_MODELS})
# the main app.
set(SUBSURFACE_APP
- main.cpp
- qt-gui.cpp
+ subsurface-desktop-main.cpp
+ subsurface-desktop-helper.cpp
)
+
source_group("Subsurface App" FILES ${SUBSURFACE_APP})
add_library(subsurface_models STATIC ${SUBSURFACE_MODELS_LIB_SRCS})
@@ -366,13 +367,19 @@ add_subdirectory(desktop-widgets)
# create the executables
if(SUBSURFACE_MOBILE)
- set(MOBILE_SRC qt-mobile/qmlmanager.cpp qt-mobile/qmlprofile.cpp qt-models/divelistmodel.cpp)
+ set(MOBILE_SRC
+ qt-mobile/qmlmanager.cpp
+ qt-mobile/qmlprofile.cpp
+ qt-models/divelistmodel.cpp
+ subsurface-android-main.cpp
+ subsurface-android-helper.cpp
+ )
add_definitions(-DSUBSURFACE_MOBILE)
qt5_add_resources(MOBILE_RESOURCES qt-mobile/mobile-resources.qrc)
if(ANDROID)
- add_library(subsurface-mobile SHARED ${MOBILE_SRC} ${SUBSURFACE_PKG} ${SUBSURFACE_APP} ${SUBSURFACE_RESOURCES} ${MOBILE_RESOURCES})
+ add_library(subsurface-mobile SHARED ${MOBILE_SRC} ${SUBSURFACE_PKG} ${SUBSURFACE_RESOURCES} ${MOBILE_RESOURCES})
else()
- add_executable(subsurface-mobile ${MOBILE_SRC} ${SUBSURFACE_PKG} ${SUBSURFACE_APP} ${SUBSURFACE_RESOURCES} ${MOBILE_RESOURCES})
+ add_executable(subsurface-mobile ${MOBILE_SRC} ${SUBSURFACE_PKG} ${SUBSURFACE_RESOURCES} ${MOBILE_RESOURCES})
endif()
target_link_libraries(
subsurface-mobile
@@ -383,25 +390,26 @@ if(SUBSURFACE_MOBILE)
subsurface_models
subsurface_corelib
${SUBSURFACE_LINK_LIBRARIES})
+endif()
+
+if(ANDROID)
+ # Produce a shared-library instead of a program.
+ # Something that androiddeployqt can work with.
+ # this is the desktop version, running on android.
+ add_library(${SUBSURFACE_TARGET} SHARED ${SUBSURFACE_PKG} ${SUBSURFACE_APP} ${SUBSURFACE_RESOURCES})
else()
- if(ANDROID)
- # Produce a shared-library instead of a program.
- # Something that 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
- subsurface_interface
- subsurface_profile
- subsurface_statistics
- subsurface_models
- subsurface_corelib
- ${SUBSURFACE_LINK_LIBRARIES}
-)
+ add_executable(${SUBSURFACE_TARGET} MACOSX_BUNDLE WIN32 ${SUBSURFACE_PKG} ${SUBSURFACE_APP} ${SUBSURFACE_RESOURCES})
endif()
+target_link_libraries(
+ ${SUBSURFACE_TARGET}
+ subsurface_generated_ui
+ subsurface_interface
+ subsurface_profile
+ subsurface_statistics
+ subsurface_models
+ subsurface_corelib
+ ${SUBSURFACE_LINK_LIBRARIES}
+)
add_dependencies(subsurface_statistics subsurface_generated_ui)
add_dependencies(subsurface_profile subsurface_generated_ui)