summaryrefslogtreecommitdiffstats
path: root/core/CMakeLists.txt
blob: 87b27687249457125315fa6d19d49e838bdb4c9c (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
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 linux.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)
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 qtserialbluetooth.cpp btdiscovery.cpp)
endif()

if(BLESUPPORT)
	add_definitions(-DBLE_SUPPORT)
	set(BT_CORE_SRC_FILES ${BT_CORE_SRC_FILES} qt-ble.cpp)
endif()

# compile the core library, in C.
set(SUBSURFACE_CORE_LIB_SRCS
	cochran.c
	datatrak.c
	deco.c
	device.c
	dive.c
	divesite.c
	divesite-helper.cpp
	divelist.c
	equipment.c
	errorhelper.c
	file.c
	gas-model.c
	git-access.c
	libdivecomputer.c
	liquivision.c
	load-git.c
	membuffer.c
	ostctools.c
	parse-xml.c
	parse.c
	import-suunto.c
	import-shearwater.c
	import-cobalt.c
	import-divinglog.c
	planner.c
	plannernotes.c
	profile.c
	gaspressures.c
	worldmap-save.c
	save-git.c
	save-xml.c
	save-html.c
	sha1.c
	statistics.c
	strtod.c
	subsurfacestartup.c
	time.c
	uemis.c
	uemis-downloader.c
	version.c
	# gettextfrommoc should be added because we are using it on the c-code.
	gettextfromc.cpp
	# dirk ported some core functionality to c++.
	qthelper.cpp
	divecomputer.cpp
	exif.cpp
	subsurfacesysinfo.cpp
	devicedetails.cpp
	configuredivecomputer.cpp
	configuredivecomputerthreads.cpp
	divesitehelpers.cpp
	taxonomy.c
	checkcloudconnection.cpp
	windowtitleupdate.cpp
	divelogexportlogic.cpp
	qt-init.cpp
	qtserialbluetooth.cpp
	metrics.cpp
	color.cpp
	pluginmanager.cpp
	imagedownloader.cpp
	isocialnetworkintegration.cpp
	gpslocation.cpp
	cloudstorage.cpp
	downloadfromdcthread.cpp
	connectionlistmodel.cpp

	#Subsurface Qt have the Subsurface structs QObjectified for easy access via QML.
	subsurface-qt/DiveObjectHelper.cpp
	subsurface-qt/CylinderObjectHelper.cpp
	subsurface-qt/SettingsObjectWrapper.cpp

	${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})