aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Salvador Cuñat <salvador.cunat@gmail.com>2015-11-10 20:51:40 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-11-12 07:39:18 -0800
commit427c696c707ca8714b21e125bb2f1ccc7b7856c0 (patch)
treecbfe5d458d7f3b807f95bc6ec5a28e3c53b52c0f
parentddc77845142c19097b5c8094d7601f78719d3e53 (diff)
downloadsubsurface-427c696c707ca8714b21e125bb2f1ccc7b7856c0.tar.gz
SmartTrak import - Add build capability to cmake
This enables posibility of building standalone import tool via cmake. Adds an option SMARTRAK_IMPORT (defaults to OFF) which, if turned ON, will require glib-2.0 and libmdb libraries to be installed, and, calling will produce an executable with the highly original name of smtk2ssrf. I have no capability to cross-compile to windows, so I haven't even tried to put this in Win, less say in Mac. I expect linux users which may be actual users of SmartTrak, to test this before trying to build on windows, although the target public will probably be the windows users (or at least, ex windows user). Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--CMakeLists.txt19
-rw-r--r--smtk-import/CMakeLists.txt10
2 files changed, 29 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2c5981202..c59d13e55 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -24,6 +24,7 @@ option(FBSUPPORT "allow posting to Facebook" ON)
option(BTSUPPORT "enable support for QtBluetooth (requires Qt5.4 or newer)" ON)
option(FTDISUPPORT "enable support for libftdi based serial" OFF)
option(DISABLE_PLUGINS "disable support for social media plugins" OFF)
+option(SMARTTRAK_IMPORT "enable building SmartTrak divelogs import tool (requires glib2 and libmdb)" OFF)
add_definitions(-DSUBSURFACE_SOURCE="${CMAKE_SOURCE_DIR}")
@@ -75,6 +76,11 @@ pkg_config_library(LIBXSLT libxslt REQUIRED)
pkg_config_library(LIBZIP libzip REQUIRED)
pkg_config_library(LIBUSB libusb-1.0 QUIET)
+if(SMARTTRAK_IMPORT)
+ pkg_config_library(GLIB2 glib-2.0 REQUIRED)
+ pkg_config_library(LIBMDB libmdb REQUIRED)
+endif()
+
# more libraries with special handling in case we build them ourselves
if(LIBGIT2_FROM_PKGCONFIG)
pkg_config_library(LIBGIT2 libgit2 REQUIRED)
@@ -326,6 +332,10 @@ add_subdirectory(subsurface-core)
add_subdirectory(qt-models)
add_subdirectory(profile-widget)
+if(SMARTTRAK_IMPORT)
+ add_subdirectory(smtk-import)
+endif()
+
if (NOT SUBSURFACE_MOBILE)
add_subdirectory(desktop-widgets)
endif()
@@ -383,6 +393,12 @@ else()
add_executable(${SUBSURFACE_TARGET} MACOSX_BUNDLE WIN32 ${SUBSURFACE_PKG} ${SUBSURFACE_APP} ${SUBSURFACE_RESOURCES})
endif()
+ if(SMARTTRAK_IMPORT)
+ set(SMTK_IMPORT_TARGET smtk2ssrf)
+ add_executable(smtk2ssrf smtk-import/smtk_standalone.cpp ${SUBSURFACE_RESOURCES})
+ target_link_libraries(smtk2ssrf smtk_import)
+ endif()
+
target_link_libraries(
${SUBSURFACE_TARGET}
subsurface_generated_ui
@@ -639,6 +655,9 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
install(TARGETS subsurface-mobile DESTINATION bin)
else()
install(TARGETS ${SUBSURFACE_TARGET} DESTINATION bin)
+ if (SMARTTRAK_IMPORT)
+ install(TARGETS ${SMTK_IMPORT_TARGET} DESTINATION bin)
+ endif()
endif()
if(DEFINED LIBMARBLEDEVEL)
install(
diff --git a/smtk-import/CMakeLists.txt b/smtk-import/CMakeLists.txt
new file mode 100644
index 000000000..93fbb847d
--- /dev/null
+++ b/smtk-import/CMakeLists.txt
@@ -0,0 +1,10 @@
+set(SMTK_IMPORT_SRCS
+ smartrak.c
+ smrtk2ssrfc_window.ui
+ smrtk2ssrfc_window.h
+ smrtk2ssrfc_window.cpp
+)
+source_group("SmartTrak Import libs" FILES ${SMTK_IMPORT_SRCS})
+
+add_library(smtk_import STATIC ${SMTK_IMPORT_SRCS})
+target_link_libraries(smtk_import subsurface_corelib ${SUBSURFACE_LINK_LIBRARIES})