2014-04-14 17:21:01 +00:00
|
|
|
project(Subsurface)
|
2015-02-02 15:52:35 +00:00
|
|
|
cmake_minimum_required(VERSION 2.8.11)
|
2014-04-14 19:47:12 +00:00
|
|
|
|
2014-04-14 17:21:01 +00:00
|
|
|
SET(CMAKE_AUTOMOC ON)
|
|
|
|
SET(CMAKE_AUTOUIC ON)
|
|
|
|
SET(CMAKE_MODULE_PATH ${${PROJECT_NAME}_SOURCE_DIR}/marbledata)
|
|
|
|
|
|
|
|
if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUXX)
|
|
|
|
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99 ")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
INCLUDE_DIRECTORIES( . ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_BINARY_DIR} qt-ui qt-ui/profile)
|
|
|
|
FIND_PACKAGE(PkgConfig)
|
|
|
|
|
|
|
|
MACRO(pkg_config_library LIBNAME pcfile)
|
2015-02-24 07:49:08 +00:00
|
|
|
pkg_check_modules(${LIBNAME} REQUIRED ${pcfile})
|
2014-04-14 17:21:01 +00:00
|
|
|
include_directories(${${LIBNAME}_INCLUDE_DIRS})
|
|
|
|
link_directories(${${LIBNAME}_LIBRARY_DIRS})
|
|
|
|
add_definitions(${${LIBNAME}_CFLAGS_OTHER})
|
|
|
|
set(SUBSURFACE_LINK_LIBRARIES ${SUBSURFACE_LINK_LIBRARIES} ${${LIBNAME}_LIBRARIES})
|
|
|
|
ENDMACRO()
|
|
|
|
|
|
|
|
pkg_config_library(LIBXML libxml-2.0)
|
|
|
|
pkg_config_library(LIBSQLITE3 sqlite3)
|
2015-02-24 07:49:08 +00:00
|
|
|
if(NOT DEFINED LIBGIT2DEVEL)
|
2015-02-23 17:04:52 +00:00
|
|
|
pkg_config_library(LIBGIT2 libgit2)
|
|
|
|
ELSE()
|
|
|
|
include_directories(${LIBGIT2DEVEL}/include)
|
|
|
|
link_directories(${LIBGIT2DEVEL}/build)
|
2015-03-26 19:24:19 +00:00
|
|
|
if(NOT DEFINED LIBGIT2STATIC)
|
2015-03-25 21:31:42 +00:00
|
|
|
set(SUBSURFACE_LINK_LIBRARIES ${SUBSURFACE_LINK_LIBRARIES} -lgit2 -lssl -lcrypto)
|
2015-02-23 17:04:52 +00:00
|
|
|
ELSE()
|
2015-03-25 21:31:42 +00:00
|
|
|
set(SUBSURFACE_LINK_LIBRARIES ${SUBSURFACE_LINK_LIBRARIES} libgit2.a -lssl -lcrypto)
|
2015-02-23 17:04:52 +00:00
|
|
|
ENDIF()
|
|
|
|
ENDIF()
|
2014-04-14 17:21:01 +00:00
|
|
|
pkg_config_library(LIBXSLT libxslt)
|
2015-03-25 21:48:02 +00:00
|
|
|
pkg_config_library(LIBZIP libzip)
|
2014-04-14 17:21:01 +00:00
|
|
|
|
2014-04-14 19:48:12 +00:00
|
|
|
SET(LIBDCDEVEL "" CACHE STRING "libraries")
|
2015-03-25 21:31:42 +00:00
|
|
|
IF(DEFINED LIBDCDEVEL)
|
2014-04-14 19:48:12 +00:00
|
|
|
cmake_policy(SET CMP0015 OLD)
|
|
|
|
include_directories(${LIBDCDEVEL}/include )
|
|
|
|
link_directories(${LIBDCDEVEL}/src/.libs)
|
2015-03-26 19:24:19 +00:00
|
|
|
if(NOT DEFINED LIBDCSTATIC)
|
|
|
|
set(SUBSURFACE_LINK_LIBRARIES ${SUBSURFACE_LINK_LIBRARIES} -ldivecomputer -lusb-1.0)
|
2015-03-25 21:31:42 +00:00
|
|
|
ELSE()
|
|
|
|
set(SUBSURFACE_LINK_LIBRARIES ${SUBSURFACE_LINK_LIBRARIES} libdivecomputer.a -lusb-1.0)
|
|
|
|
ENDIF()
|
|
|
|
ELSE()
|
|
|
|
set(SUBSURFACE_LINK_LIBRARIES ${SUBSURFACE_LINK_LIBRARIES} -ldivecomputer)
|
2014-04-14 19:48:12 +00:00
|
|
|
ENDIF()
|
|
|
|
|
2014-04-14 17:21:01 +00:00
|
|
|
STRING(COMPARE EQUAL "${${PROJECT_NAME}_SOURCE_DIR}" "${${PROJECT_NAME}_BINARY_DIR}" insource)
|
|
|
|
GET_FILENAME_COMPONENT(PARENTDIR ${${PROJECT_NAME}_SOURCE_DIR} PATH)
|
|
|
|
STRING(COMPARE EQUAL "${${PROJECT_NAME}_SOURCE_DIR}" "${PARENTDIR}" insourcesubdir)
|
|
|
|
IF(NOT (insource OR insourcedir))
|
|
|
|
add_custom_target(link_marble_data ALL COMMAND rm -f marbledata && ln -s ${${PROJECT_NAME}_SOURCE_DIR}/marbledata ${${PROJECT_NAME}_BINARY_DIR}/marbledata)
|
|
|
|
ENDIF()
|
|
|
|
|
2015-02-02 15:52:35 +00:00
|
|
|
#configure Qt.
|
|
|
|
FIND_PACKAGE(Qt5Core REQUIRED)
|
|
|
|
FIND_PACKAGE(Qt5Concurrent REQUIRED)
|
|
|
|
FIND_PACKAGE(Qt5Widgets REQUIRED)
|
|
|
|
FIND_PACKAGE(Qt5Network REQUIRED)
|
|
|
|
FIND_PACKAGE(Qt5WebKitWidgets REQUIRED)
|
|
|
|
FIND_PACKAGE(Qt5PrintSupport REQUIRED)
|
|
|
|
FIND_PACKAGE(Qt5Svg REQUIRED)
|
|
|
|
FIND_PACKAGE(Qt5Test REQUIRED)
|
|
|
|
SET(QT_LIBRARIES Qt5::Core Qt5::Concurrent Qt5::Widgets Qt5::Network Qt5::WebKitWidgets Qt5::PrintSupport Qt5::Svg)
|
|
|
|
SET(QT_TEST_LIBRARIES ${QT_LIBRARIES} Qt5::Test)
|
|
|
|
|
2015-02-24 07:49:08 +00:00
|
|
|
IF(NOT DEFINED LIBMARBLEDEVEL)
|
2015-02-23 15:29:27 +00:00
|
|
|
FIND_PACKAGE(Marble REQUIRED)
|
2015-03-25 22:02:21 +00:00
|
|
|
include_directories(${MARBLE_INCLUDE_DIR})
|
|
|
|
link_directories(${MARBLE_LIB_DIR})
|
2015-02-23 15:29:27 +00:00
|
|
|
ELSE()
|
2015-03-25 22:02:21 +00:00
|
|
|
include_directories(${LIBMARBLEDEVEL}/include)
|
|
|
|
link_directories(${LIBMARBLEDEVEL}/lib)
|
2015-03-25 21:31:42 +00:00
|
|
|
SET(MARBLE_LIBRARIES -L${LIBMARBLEDEVEL}/lib -lssrfmarblewidget)
|
2015-02-23 15:29:27 +00:00
|
|
|
ENDIF()
|
2014-04-14 17:21:01 +00:00
|
|
|
|
|
|
|
# Generate the ssrf-config.h every 'make'
|
2015-02-03 07:56:55 +00:00
|
|
|
FILE(WRITE ${CMAKE_BINARY_DIR}/version.h.in "
|
|
|
|
#define VERSION_STRING \"@VERSION_STRING@\"
|
|
|
|
#define GIT_VERSION_STRING \"@GIT_VERSION_STRING@\"
|
|
|
|
#define CANONICAL_VERSION_STRING \"@CANONICAL_VERSION_STRING@\"
|
|
|
|
")
|
|
|
|
FILE(WRITE ${CMAKE_BINARY_DIR}/version.cmake "
|
|
|
|
IF (\${APPLE})
|
|
|
|
SET(VER_OS darwin)
|
|
|
|
ELSEIF (\${WIN32})
|
|
|
|
SET(VER_OS win)
|
|
|
|
ELSE ()
|
|
|
|
SET(VER_OS linux)
|
|
|
|
ENDIF ()
|
|
|
|
EXECUTE_PROCESS(
|
|
|
|
COMMAND sh scripts/get-version \${VER_OS}
|
|
|
|
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
|
|
|
OUTPUT_VARIABLE VERSION_STRING
|
|
|
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
|
|
|
)
|
|
|
|
EXECUTE_PROCESS(
|
|
|
|
COMMAND sh scripts/get-version linux
|
|
|
|
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
|
|
|
OUTPUT_VARIABLE GIT_VERSION_STRING
|
|
|
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
|
|
|
)
|
|
|
|
EXECUTE_PROCESS(
|
|
|
|
COMMAND sh scripts/get-version full
|
|
|
|
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
|
|
|
OUTPUT_VARIABLE CANONICAL_VERSION_STRING
|
|
|
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
|
|
|
)
|
|
|
|
CONFIGURE_FILE(\${SRC} \${DST} @ONLY)
|
2014-04-14 17:21:01 +00:00
|
|
|
")
|
|
|
|
ADD_CUSTOM_TARGET(version ALL COMMAND
|
|
|
|
${CMAKE_COMMAND} -D SRC=${CMAKE_BINARY_DIR}/version.h.in
|
|
|
|
-D DST=${CMAKE_BINARY_DIR}/ssrf-version.h
|
|
|
|
-P ${CMAKE_BINARY_DIR}/version.cmake
|
|
|
|
)
|
|
|
|
|
2015-03-26 19:24:46 +00:00
|
|
|
SET(PLATFORM_SRC unknown_platform.c)
|
|
|
|
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
|
|
|
SET(PLATFORM_SRC linux.c)
|
|
|
|
ENDIF()
|
|
|
|
IF(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
|
|
|
|
SET(PLATFORM_SRC macos.c)
|
2015-03-26 19:52:48 +00:00
|
|
|
set(SUBSURFACE_LINK_LIBRARIES ${SUBSURFACE_LINK_LIBRARIES} -framework CoreServices)
|
2015-03-26 19:24:46 +00:00
|
|
|
ENDIF()
|
|
|
|
IF(CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
|
|
|
SET(PLATFORM_SRC windows.c)
|
|
|
|
set(SUBSURFACE_LINK_LIBRARIES ${SUBSURFACE_LINK_LIBRARIES} -lwsock32)
|
|
|
|
remove_definitions(-DUNICODE)
|
|
|
|
ENDIF()
|
|
|
|
|
2014-04-14 17:21:01 +00:00
|
|
|
# compile the core library, in C.
|
2014-04-14 19:47:12 +00:00
|
|
|
SET(SUBSURFACE_CORE_LIB_SRCS
|
2014-10-18 01:03:37 +00:00
|
|
|
cochran.c
|
Import Datatrak/WLog files
Sequentially parses a file, expected to be a Datatrak/WLog divelog, and
converts the dive info into Subsurface's dive structure.
As my first DC, back in 90s, was an Aladin Air X, the obvious choice of log
software was DTrak (Win version). After using it for some time we moved to WLog
(shareware software more user friendly than Dtrak, printing capable, and still
better, it runs under wine, which, as linux user, was definitive for me). Then,
some years later, my last Aladin died and I moved to an OSTC, forcing me to
look for a software that support this DC.
I found JDivelog which was capable of import Dtrak logs and used it for some
time until discovered Subsurface existence and devoted to it.
The fact was that importing Dtrak dives in JDivelog and then re-importing them
in Subsurface caused a significant data loss (mainly in the profile events and
alarms) and weird location of some other info in the dive notes (mostly tag
items in the original Dtrak software). This situation can't actually be solved
with tools like divelogs.de which causes similar if no greater data loss.
Although this won't be a core feature for Subsurface, I expect it can be useful
for some other divers as has been for me.
Comments and issues:
Datatrak/Wlog files include a lot of diving data which are not directly
supported in Subsurface, in these cases we choose mostly to use "tags".
The lack of some important info in Datatrak archives (e.g. tank's initial
pressure) forces us to do some arbitrary assumptions (e.g. initial pressure =
200 bar).
There might be archives coming directly from old DOS days, as first versions
of Datatrak run on that OS; they were coded CP437 or CP850, while dive logs
coming from Win versions seems to be coded CP1252. Finally, Wlog seems to use a
mixed confusing style. Program directly converts some of the old encoded chars
to iso8859 but is expected there be some issues with non alphabetic chars, e.g.
"ª".
There are two text fields: "Other activities" and "Dive notes", both limited to
256 char size. We have merged them in Subsurface's "Dive Notes" although the
first one could be "tagged", but we're unsure that the user had filled it in
a tag friendly way.
WLog adds some information to the dive and lets the user to write more than
256 chars notes. This is achieved, while keeping compatibility with DTrak
divelogs, by adding a complementary file named equally as the .log file and
with .add extension where all this info is stored. We have, still, not worked
with this complementary files.
This work is based on the paper referenced in butracker #194 which has some
errors (e.g. beginning of log and beginning of dive are changed) and a lot of
bytes of unknown meaning. Example.log shows, at least, one more byte than those
referred in the paper for the O2 Aladin computer, this could be a byte referred
to the use of SCR but the lack of an OC dive with O2 computer makes impossible
for us to compare.
The only way we have figured out to distinguish a priori between SCR and non
SCR dives with O2 computers is that the dives are tagged with a "rebreather"
tag. Obviously this is not a very trusty way of doing things. In SCR dives,
the O2% in mix means, probably, the maximum O2% in the circuit, not the O2%
of the EAN mix in the tanks, which would be unknown in this case.
The list of DCs related in bug #194 paper seems incomplete, we have added
one or two from WLog and discarded those which are known to exist but whose
model is unknown, grouping them under the imaginative name of "unknown". The
list can easily be increased in the future if we ever know the models
identifiers.
BTW, in Example.log, 0x00 identifier is used for some DC dives and from my own
divelogs is inferred that 0x00 is used for manually entered dives, this could
easily be an error in Example.log coming from a preproduction DC model.
Example.log which is shipped in datatrak package is included in dives
directory for testing pourposes.
[Dirk Hohndel: some small cleanups, merged with latest master, support
divesites, remove the pointless memset() before free() calls
add to cmake build]
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-05 18:38:27 +00:00
|
|
|
datatrak.c
|
2014-04-14 19:47:12 +00:00
|
|
|
deco.c
|
|
|
|
device.c
|
|
|
|
dive.c
|
2015-02-23 16:15:30 +00:00
|
|
|
divesite.c
|
2014-04-14 19:47:12 +00:00
|
|
|
divelist.c
|
|
|
|
equipment.c
|
|
|
|
file.c
|
2015-01-23 03:40:01 +00:00
|
|
|
git-access.c
|
2014-04-14 19:47:12 +00:00
|
|
|
libdivecomputer.c
|
2014-11-07 16:30:44 +00:00
|
|
|
liquivision.c
|
2014-04-14 19:47:12 +00:00
|
|
|
load-git.c
|
|
|
|
membuffer.c
|
|
|
|
parse-xml.c
|
|
|
|
planner.c
|
|
|
|
profile.c
|
2014-08-27 12:43:54 +00:00
|
|
|
gaspressures.c
|
2014-04-14 19:47:12 +00:00
|
|
|
worldmap-save.c
|
|
|
|
save-git.c
|
|
|
|
save-xml.c
|
2014-05-30 02:42:15 +00:00
|
|
|
save-html.c
|
2014-04-14 19:47:12 +00:00
|
|
|
sha1.c
|
|
|
|
statistics.c
|
|
|
|
strtod.c
|
|
|
|
subsurfacestartup.c
|
|
|
|
time.c
|
|
|
|
uemis.c
|
|
|
|
uemis-downloader.c
|
2015-02-23 16:15:30 +00:00
|
|
|
version.c
|
2014-04-17 14:34:21 +00:00
|
|
|
#gettextfrommoc should be added because we are using it on the c-code.
|
|
|
|
gettextfromc.cpp
|
2014-04-17 15:21:39 +00:00
|
|
|
#dirk ported some core functionality to c++.
|
|
|
|
qthelper.cpp
|
2014-05-12 16:53:26 +00:00
|
|
|
divecomputer.cpp
|
2014-06-02 21:28:02 +00:00
|
|
|
exif.cpp
|
2014-06-19 15:21:16 +00:00
|
|
|
subsurfacesysinfo.cpp
|
2014-08-22 21:28:55 +00:00
|
|
|
devicedetails.cpp
|
|
|
|
configuredivecomputer.cpp
|
|
|
|
configuredivecomputerthreads.cpp
|
2015-03-10 21:27:14 +00:00
|
|
|
divesitehelpers.cpp
|
2015-03-26 19:24:46 +00:00
|
|
|
${PLATFORM_SRC}
|
2014-04-14 17:21:01 +00:00
|
|
|
)
|
|
|
|
|
2014-04-14 19:47:12 +00:00
|
|
|
#the interface, in C++
|
|
|
|
SET(SUBSURFACE_INTERFACE
|
|
|
|
qt-ui/updatemanager.cpp
|
|
|
|
qt-ui/about.cpp
|
|
|
|
qt-ui/completionmodels.cpp
|
|
|
|
qt-ui/divecomputermanagementdialog.cpp
|
|
|
|
qt-ui/divelistview.cpp
|
|
|
|
qt-ui/diveplanner.cpp
|
2014-10-28 19:40:33 +00:00
|
|
|
qt-ui/diveshareexportdialog.cpp
|
2014-04-14 19:47:12 +00:00
|
|
|
qt-ui/downloadfromdivecomputer.cpp
|
|
|
|
qt-ui/globe.cpp
|
|
|
|
qt-ui/graphicsview-common.cpp
|
|
|
|
qt-ui/kmessagewidget.cpp
|
|
|
|
qt-ui/maintab.cpp
|
|
|
|
qt-ui/mainwindow.cpp
|
|
|
|
qt-ui/modeldelegates.cpp
|
|
|
|
qt-ui/models.cpp
|
2014-10-28 19:40:33 +00:00
|
|
|
qt-ui/metrics.cpp
|
2015-03-10 17:25:57 +00:00
|
|
|
qt-ui/notificationwidget.cpp
|
2014-04-14 19:47:12 +00:00
|
|
|
qt-ui/preferences.cpp
|
|
|
|
qt-ui/printdialog.cpp
|
|
|
|
qt-ui/printlayout.cpp
|
|
|
|
qt-ui/printoptions.cpp
|
|
|
|
qt-ui/simplewidgets.cpp
|
|
|
|
qt-ui/starwidget.cpp
|
|
|
|
qt-ui/subsurfacewebservices.cpp
|
|
|
|
qt-ui/tableview.cpp
|
|
|
|
qt-ui/divelogimportdialog.cpp
|
|
|
|
qt-ui/tagwidget.cpp
|
|
|
|
qt-ui/groupedlineedit.cpp
|
|
|
|
qt-ui/usermanual.cpp
|
2014-05-21 14:24:22 +00:00
|
|
|
qt-ui/divelogexportdialog.cpp
|
2014-05-30 17:38:27 +00:00
|
|
|
qt-ui/divepicturewidget.cpp
|
2014-06-19 15:21:16 +00:00
|
|
|
qt-ui/usersurvey.cpp
|
2014-08-22 21:28:55 +00:00
|
|
|
qt-ui/configuredivecomputerdialog.cpp
|
2014-11-13 18:31:03 +00:00
|
|
|
qt-ui/filtermodels.cpp
|
2015-02-23 16:15:30 +00:00
|
|
|
qt-ui/undocommands.cpp
|
2014-04-14 19:47:12 +00:00
|
|
|
)
|
2014-04-14 17:21:01 +00:00
|
|
|
|
2014-04-14 19:47:12 +00:00
|
|
|
#the profile widget
|
|
|
|
SET(SUBSURFACE_PROFILE_LIB_SRCS
|
|
|
|
qt-ui/profile/profilewidget2.cpp
|
|
|
|
qt-ui/profile/diverectitem.cpp
|
|
|
|
qt-ui/profile/divepixmapitem.cpp
|
|
|
|
qt-ui/profile/divelineitem.cpp
|
|
|
|
qt-ui/profile/divetextitem.cpp
|
|
|
|
qt-ui/profile/animationfunctions.cpp
|
|
|
|
qt-ui/profile/divecartesianaxis.cpp
|
|
|
|
qt-ui/profile/diveplotdatamodel.cpp
|
|
|
|
qt-ui/profile/diveprofileitem.cpp
|
|
|
|
qt-ui/profile/diveeventitem.cpp
|
|
|
|
qt-ui/profile/divetooltipitem.cpp
|
|
|
|
qt-ui/profile/ruleritem.cpp
|
2014-08-22 21:28:55 +00:00
|
|
|
qt-ui/profile/tankitem.cpp
|
2014-04-14 19:47:12 +00:00
|
|
|
)
|
|
|
|
|
2014-08-25 17:52:45 +00:00
|
|
|
#the yearly statistics widget.
|
|
|
|
SET(SUBSURFACE_STATISTICS_LIB_SRCS
|
|
|
|
qt-ui/statistics/statisticswidget.cpp
|
|
|
|
qt-ui/statistics/yearstatistics.cpp
|
|
|
|
qt-ui/statistics/statisticsbar.cpp
|
|
|
|
qt-ui/statistics/monthstatistics.cpp
|
|
|
|
)
|
|
|
|
|
2014-04-14 19:47:12 +00:00
|
|
|
#the main app.
|
|
|
|
SET(SUBSURFACE_APP
|
|
|
|
main.cpp
|
|
|
|
qt-gui.cpp
|
|
|
|
qthelper.cpp
|
|
|
|
)
|
|
|
|
|
|
|
|
FILE(GLOB SUBSURFACE_UI qt-ui/*.ui)
|
2015-02-24 08:11:03 +00:00
|
|
|
QT5_WRAP_UI(SUBSURFACE_UI_HDRS ${SUBSURFACE_UI})
|
|
|
|
QT5_ADD_RESOURCES(SUBSURFACE_RESOURCES subsurface.qrc)
|
2014-04-14 17:21:01 +00:00
|
|
|
|
|
|
|
ADD_LIBRARY(subsurface_corelib STATIC ${SUBSURFACE_CORE_LIB_SRCS} )
|
2015-02-02 15:52:35 +00:00
|
|
|
TARGET_LINK_LIBRARIES(subsurface_corelib ${QT_LIBRARIES})
|
2014-04-14 17:21:01 +00:00
|
|
|
ADD_LIBRARY(subsurface_profile STATIC ${SUBSURFACE_PROFILE_LIB_SRCS})
|
2015-02-02 15:52:35 +00:00
|
|
|
TARGET_LINK_LIBRARIES(subsurface_profile ${QT_LIBRARIES})
|
2014-08-25 17:52:45 +00:00
|
|
|
ADD_LIBRARY(subsurface_statistics STATIC ${SUBSURFACE_STATISTICS_LIB_SRCS})
|
2015-02-02 15:52:35 +00:00
|
|
|
TARGET_LINK_LIBRARIES(subsurface_statistics ${QT_LIBRARIES})
|
2014-04-14 17:21:01 +00:00
|
|
|
ADD_LIBRARY(subsurface_generated_ui STATIC ${SUBSURFACE_UI_HDRS})
|
2015-02-24 08:11:03 +00:00
|
|
|
TARGET_LINK_LIBRARIES(subsurface_generated_ui ${QT_LIBRARIES})
|
2014-04-14 17:21:01 +00:00
|
|
|
ADD_LIBRARY(subsurface_interface STATIC ${SUBSURFACE_INTERFACE})
|
2015-02-02 15:52:35 +00:00
|
|
|
TARGET_LINK_LIBRARIES(subsurface_interface ${QT_LIBRARIES} ${MARBLE_LIBRARIES})
|
2014-04-14 17:21:01 +00:00
|
|
|
|
2015-02-24 08:11:03 +00:00
|
|
|
ADD_EXECUTABLE(subsurface ${SUBSURFACE_APP} ${SUBSURFACE_RESOURCES})
|
2014-04-14 17:21:01 +00:00
|
|
|
target_link_libraries( subsurface
|
|
|
|
subsurface_generated_ui
|
|
|
|
subsurface_interface
|
|
|
|
subsurface_profile
|
2014-08-25 17:52:45 +00:00
|
|
|
subsurface_statistics
|
2014-04-14 17:21:01 +00:00
|
|
|
subsurface_corelib
|
|
|
|
${SUBSURFACE_LINK_LIBRARIES}
|
|
|
|
)
|
|
|
|
|
2014-08-25 17:52:45 +00:00
|
|
|
ADD_DEPENDENCIES(subsurface_statistics subsurface_generated_ui)
|
2014-04-14 17:21:01 +00:00
|
|
|
ADD_DEPENDENCIES(subsurface_profile subsurface_generated_ui)
|
|
|
|
ADD_DEPENDENCIES(subsurface_interface subsurface_generated_ui)
|
|
|
|
ADD_DEPENDENCIES(subsurface_generated_ui version)
|
2014-04-14 19:47:12 +00:00
|
|
|
ADD_DEPENDENCIES(subsurface_corelib version)
|
2014-04-14 17:21:01 +00:00
|
|
|
|
2015-02-04 08:30:24 +00:00
|
|
|
MACRO(test NAME FILE)
|
2015-03-15 01:04:53 +00:00
|
|
|
ADD_EXECUTABLE(${NAME} tests/${FILE} ${SUBSURFACE_RESOURCES})
|
2015-03-25 21:48:02 +00:00
|
|
|
TARGET_LINK_LIBRARIES(${NAME} subsurface_corelib ${QT_TEST_LIBRARIES} ${SUBSURFACE_LINK_LIBRARIES})
|
2015-02-04 08:30:24 +00:00
|
|
|
ADD_TEST(NAME ${NAME} COMMAND ${NAME})
|
|
|
|
ENDMACRO()
|
2014-04-17 14:34:21 +00:00
|
|
|
|
2015-02-04 08:30:24 +00:00
|
|
|
ENABLE_TESTING()
|
2015-03-10 21:27:14 +00:00
|
|
|
ADD_DEFINITIONS(-DSUBSURFACE_SOURCE="${CMAKE_SOURCE_DIR}")
|
|
|
|
ADD_DEFINITIONS(-g)
|
2015-02-04 08:30:24 +00:00
|
|
|
test(TestUnitConversion testunitconversion.cpp)
|
|
|
|
test(TestProfile testprofile.cpp)
|
|
|
|
test(TestGpsCoords testgpscoords.cpp)
|
2015-03-10 21:27:14 +00:00
|
|
|
test(TestParse testparse.cpp)
|