summaryrefslogtreecommitdiffstats
path: root/qt-models/CMakeLists.txt
diff options
context:
space:
mode:
authorGravatar Jan Mulder <jlmulder@xs4all.nl>2018-01-09 16:30:03 +0100
committerGravatar Jan Mulder <jlmulder@xs4all.nl>2018-01-10 16:44:15 +0100
commitc8e9b934045a4627d142f44261a2846a9865ecfc (patch)
tree9addc8e5f8b30e605645a8c4b64444e6c46a4404 /qt-models/CMakeLists.txt
parent8928e54dfce324185fcd22d1d32f6343c3a3f865 (diff)
downloadsubsurface-c8e9b934045a4627d142f44261a2846a9865ecfc.tar.gz
build system: split qt-models into parts
For a long time, I did not realize that a lot of qt-models are only used in the mobile app, or only used in the desktop application. This commit splits the qt-models in 3 parts. Used in both mobile and desktop, used in desktop only, used in mobile only. There is no other code change in here, other than cmake changes. To me, this gives at least developers more insight where code is actually used, and there is a small benefit in footpoint. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
Diffstat (limited to 'qt-models/CMakeLists.txt')
-rw-r--r--qt-models/CMakeLists.txt46
1 files changed, 31 insertions, 15 deletions
diff --git a/qt-models/CMakeLists.txt b/qt-models/CMakeLists.txt
index 4e2491a23..13c3034a8 100644
--- a/qt-models/CMakeLists.txt
+++ b/qt-models/CMakeLists.txt
@@ -1,31 +1,47 @@
# the data models that will interface
# with the views.
-set(SUBSURFACE_MODELS_LIB_SRCS
+
+# models used both mobile and desktop builds
+set(SUBSURFACE_GENERIC_MODELS_LIB_SRCS
cleanertablemodel.cpp
cylindermodel.cpp
- diveplannermodel.cpp
models.cpp
- filtermodels.cpp
tankinfomodel.cpp
- weigthsysteminfomodel.cpp
- weightmodel.cpp
- divecomputermodel.cpp
+ divepicturemodel.cpp
+ diveplannermodel.cpp
treemodel.cpp
+ diveplotdatamodel.cpp
+ diveimportedmodel.cpp
+)
+
+# models exclusively used in desktop builds
+set(SUBSURFACE_DESKTOP_MODELS_LIB_SRCS
+ maplocationmodel.cpp
yearlystatisticsmodel.cpp
+ weigthsysteminfomodel.cpp
+ weightmodel.cpp
+ filtermodels.cpp
+ divecomputermodel.cpp
divetripmodel.cpp
divecomputerextradatamodel.cpp
- completionmodels.cpp
- divepicturemodel.cpp
- diveplotdatamodel.cpp
+ completionmodels.cpp
divelocationmodel.cpp
ssrfsortfilterproxymodel.cpp
+)
+
+# models exclusively used in mobile builds
+set(SUBSURFACE_MOBILE_MODELS_LIB_SRCS
divelistmodel.cpp
- gpslistmodel.cpp
- diveimportedmodel.cpp
messagehandlermodel.cpp
- maplocationmodel.cpp
+ gpslistmodel.cpp
)
-source_group("Subsurface Models" FILES ${SUBSURFACE_MODELS})
-add_library(subsurface_models STATIC ${SUBSURFACE_MODELS_LIB_SRCS})
-target_link_libraries(subsurface_models ${QT_LIBRARIES})
+if(${SUBSURFACE_TARGET_EXECUTABLE} MATCHES "DesktopExecutable")
+ add_library(subsurface_models_desktop STATIC ${SUBSURFACE_GENERIC_MODELS_LIB_SRCS}
+ ${SUBSURFACE_DESKTOP_MODELS_LIB_SRCS})
+ target_link_libraries(subsurface_models_desktop ${QT_LIBRARIES})
+elseif(${SUBSURFACE_TARGET_EXECUTABLE} MATCHES "MobileExecutable")
+ add_library(subsurface_models_mobile STATIC ${SUBSURFACE_GENERIC_MODELS_LIB_SRCS}
+ ${SUBSURFACE_MOBILE_MODELS_LIB_SRCS})
+ target_link_libraries(subsurface_models_mobile ${QT_LIBRARIES})
+endif()