summaryrefslogtreecommitdiffstats
path: root/core/CMakeLists.txt
blob: 3d58dded78ff4ea6a2e834d1434d4699536f52bd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
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)
	else()
		set(PLATFORM_SRC unix.c)
	endif()
elseif(CMAKE_SYSTEM_NAME STREQUAL "Android")
	set(PLATFORM_SRC 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.c
	device.h
	devicedetails.cpp
	devicedetails.h
	display.h
	dive.c
	dive.h
	divecomputer.cpp
	divecomputer.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
	format.cpp
	format.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
	libdivecomputer.c
	libdivecomputer.h
	liquivision.c
	load-git.c
	membuffer.c
	membuffer.h
	metadata.cpp
	metadata.h
	metrics.cpp
	metrics.h
	ostctools.c
	parse-xml.c
	parse.c
	parse.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
	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
	trip.c
	trip.h
	uemis-downloader.c
	uemis.c
	uemis.h
	units.h
	units.c
	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/qPrefGeneral.cpp
	settings/qPrefGeneral.h
	settings/qPrefGeocoding.cpp
	settings/qPrefGeocoding.h
	settings/qPrefLanguage.cpp
	settings/qPrefLanguage.h
	settings/qPrefLocationService.cpp
	settings/qPrefLocationService.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})