mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-01 09:43:24 +00:00
634152ae43
Adds a filter constraint object to the core, which represents one constraint the user can filter dives with. The plan is to write these constraints to the XML and git logs. Therefore, this code is written in C-style except when it comes to handling strings and dates, which is just too painful in plain C. There is one pointer to QStringList in the class, though when compiled with C, this is simply transformed into a pointer to void. Granted, that smells of an ugly hack. However it's more pragmatic than self-flaggelation with C string and list handling. A filter constraint is supposed to be a very general thing, which can filter for strings, multiple-choice lists, numerical ranges and date ranges. Range constraints have a range mode: less-or-equal, greater-or-equal or in-range. Text constraints have a string mode: startswith, substring or exact. All the data are accessed via setter and getter functions for at least basic levels of isolation, despite being written with a C-interface in mind. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
246 lines
4.8 KiB
CMake
246 lines
4.8 KiB
CMake
set(PLATFORM_SRC unknown_platform.c)
|
|
message(STATUS "system name ${CMAKE_SYSTEM_NAME}")
|
|
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
|
if(ANDROID)
|
|
set(PLATFORM_SRC android.cpp serial_usb_android.cpp)
|
|
else()
|
|
set(PLATFORM_SRC unix.c)
|
|
endif()
|
|
elseif(CMAKE_SYSTEM_NAME STREQUAL "Android")
|
|
set(PLATFORM_SRC android.cpp serial_usb_android.cpp)
|
|
elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
|
|
set(PLATFORM_SRC macos.c)
|
|
elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
|
set(PLATFORM_SRC windows.c)
|
|
elseif(CMAKE_SYSTEM_NAME STREQUAL "OpenBSD")
|
|
set(PLATFORM_SRC unix.c)
|
|
endif()
|
|
|
|
if(FTDISUPPORT)
|
|
set(SERIAL_FTDI serial_ftdi.c)
|
|
endif()
|
|
|
|
if(BTSUPPORT)
|
|
add_definitions(-DBT_SUPPORT)
|
|
set(BT_SRC_FILES desktop-widgets/btdeviceselectiondialog.cpp)
|
|
set(BT_CORE_SRC_FILES
|
|
btdiscovery.cpp
|
|
btdiscovery.h
|
|
qtserialbluetooth.cpp
|
|
)
|
|
endif()
|
|
|
|
if(BLESUPPORT)
|
|
add_definitions(-DBLE_SUPPORT)
|
|
list(APPEND BT_CORE_SRC_FILES qt-ble.cpp qt-ble.h)
|
|
endif()
|
|
|
|
# compile the core library part in C, part in C++
|
|
set(SUBSURFACE_CORE_LIB_SRCS
|
|
applicationstate.cpp
|
|
applicationstate.h
|
|
checkcloudconnection.cpp
|
|
checkcloudconnection.h
|
|
cloudstorage.cpp
|
|
cloudstorage.h
|
|
cochran.c
|
|
cochran.h
|
|
color.cpp
|
|
color.h
|
|
configuredivecomputer.cpp
|
|
configuredivecomputer.h
|
|
configuredivecomputerthreads.cpp
|
|
configuredivecomputerthreads.h
|
|
connectionlistmodel.cpp
|
|
connectionlistmodel.h
|
|
datatrak.c
|
|
datatrak.h
|
|
deco.c
|
|
deco.h
|
|
device.cpp
|
|
device.h
|
|
devicedetails.cpp
|
|
devicedetails.h
|
|
display.h
|
|
dive.c
|
|
dive.h
|
|
divefilter.cpp
|
|
divefilter.h
|
|
divelist.c
|
|
divelist.h
|
|
divelogexportlogic.cpp
|
|
divelogexportlogic.h
|
|
divesite-helper.cpp
|
|
divesite.c
|
|
divesite.h
|
|
divesitehelpers.cpp
|
|
divesitehelpers.h
|
|
downloadfromdcthread.cpp
|
|
downloadfromdcthread.h
|
|
equipment.c
|
|
equipment.h
|
|
errorhelper.c
|
|
exif.cpp
|
|
exif.h
|
|
file.c
|
|
file.h
|
|
filterconstraint.cpp
|
|
filterconstraint.h
|
|
format.cpp
|
|
format.h
|
|
fulltext.cpp
|
|
fulltext.h
|
|
gas.c
|
|
gas.h
|
|
gas-model.c
|
|
gaspressures.c
|
|
gaspressures.h
|
|
gettext.h
|
|
gettextfromc.cpp
|
|
gettextfromc.h
|
|
git-access.c
|
|
git-access.h
|
|
gpslocation.cpp
|
|
gpslocation.h
|
|
imagedownloader.cpp
|
|
imagedownloader.h
|
|
import-cobalt.c
|
|
import-csv.c
|
|
import-csv.h
|
|
import-divinglog.c
|
|
import-shearwater.c
|
|
import-suunto.c
|
|
import-seac.c
|
|
libdivecomputer.c
|
|
libdivecomputer.h
|
|
liquivision.c
|
|
load-git.c
|
|
membuffer.c
|
|
membuffer.h
|
|
metadata.cpp
|
|
metadata.h
|
|
metrics.cpp
|
|
metrics.h
|
|
ostctools.c
|
|
parse-gpx.cpp
|
|
parse-xml.c
|
|
parse.c
|
|
parse.h
|
|
picture.c
|
|
picture.h
|
|
pictureobj.cpp
|
|
pictureobj.h
|
|
planner.c
|
|
planner.h
|
|
plannernotes.c
|
|
pref.h
|
|
profile.c
|
|
profile.h
|
|
qt-gui.h
|
|
qt-init.cpp
|
|
qthelper.cpp
|
|
qthelper.h
|
|
save-git.c
|
|
save-html.c
|
|
save-html.h
|
|
save-profiledata.c
|
|
save-xml.c
|
|
selection.cpp
|
|
selection.h
|
|
sha1.c
|
|
sha1.h
|
|
ssrf.h
|
|
statistics.c
|
|
statistics.h
|
|
strndup.h
|
|
strtod.c
|
|
subsurface-string.h
|
|
subsurfacestartup.c
|
|
subsurfacestartup.h
|
|
subsurfacesysinfo.cpp
|
|
subsurfacesysinfo.h
|
|
tag.c
|
|
tag.h
|
|
taxonomy.c
|
|
taxonomy.h
|
|
time.c
|
|
timer.c
|
|
timer.h
|
|
trip.c
|
|
trip.h
|
|
uemis-downloader.c
|
|
uemis.c
|
|
uemis.h
|
|
units.h
|
|
units.c
|
|
uploadDiveShare.cpp
|
|
uploadDiveShare.h
|
|
uploadDiveLogsDE.cpp
|
|
uploadDiveLogsDE.h
|
|
version.c
|
|
version.h
|
|
videoframeextractor.cpp
|
|
videoframeextractor.h
|
|
webservice.h
|
|
windowtitleupdate.cpp
|
|
windowtitleupdate.h
|
|
worldmap-options.h
|
|
worldmap-save.c
|
|
worldmap-save.h
|
|
xmp_parser.cpp
|
|
xmp_parser.h
|
|
|
|
# classes to manage struct preferences for QWidget and QML
|
|
settings/qPref.cpp
|
|
settings/qPref.h
|
|
settings/qPrefCloudStorage.cpp
|
|
settings/qPrefCloudStorage.h
|
|
settings/qPrefDisplay.cpp
|
|
settings/qPrefDisplay.h
|
|
settings/qPrefDiveComputer.cpp
|
|
settings/qPrefDiveComputer.h
|
|
settings/qPrefDivePlanner.cpp
|
|
settings/qPrefDivePlanner.h
|
|
settings/qPrefEquipment.cpp
|
|
settings/qPrefEquipment.h
|
|
settings/qPrefGeneral.cpp
|
|
settings/qPrefGeneral.h
|
|
settings/qPrefGeocoding.cpp
|
|
settings/qPrefGeocoding.h
|
|
settings/qPrefLanguage.cpp
|
|
settings/qPrefLanguage.h
|
|
settings/qPrefLocationService.cpp
|
|
settings/qPrefLocationService.h
|
|
settings/qPrefLog.cpp
|
|
settings/qPrefLog.h
|
|
settings/qPrefMedia.cpp
|
|
settings/qPrefMedia.h
|
|
settings/qPrefPartialPressureGas.cpp
|
|
settings/qPrefPartialPressureGas.h
|
|
settings/qPrefPrivate.cpp
|
|
settings/qPrefPrivate.h
|
|
settings/qPrefProxy.cpp
|
|
settings/qPrefProxy.h
|
|
settings/qPrefTechnicalDetails.cpp
|
|
settings/qPrefTechnicalDetails.h
|
|
settings/qPrefUnit.cpp
|
|
settings/qPrefUnit.h
|
|
settings/qPrefUpdateManager.cpp
|
|
settings/qPrefUpdateManager.h
|
|
|
|
#Subsurface Qt have the Subsurface structs QObjectified for easy access via QML.
|
|
subsurface-qt/cylinderobjecthelper.cpp
|
|
subsurface-qt/cylinderobjecthelper.h
|
|
subsurface-qt/divelistnotifier.cpp
|
|
subsurface-qt/divelistnotifier.h
|
|
subsurface-qt/diveobjecthelper.cpp
|
|
subsurface-qt/diveobjecthelper.h
|
|
|
|
${SERIAL_FTDI}
|
|
${PLATFORM_SRC}
|
|
${BT_CORE_SRC_FILES}
|
|
)
|
|
source_group("Subsurface Core" FILES ${SUBSURFACE_CORE_LIB_SRCS})
|
|
|
|
add_library(subsurface_corelib STATIC ${SUBSURFACE_CORE_LIB_SRCS} )
|
|
target_link_libraries(subsurface_corelib ${QT_LIBRARIES})
|