aboutsummaryrefslogtreecommitdiffstats
path: root/smtk-import
diff options
context:
space:
mode:
authorGravatar Salvador Cuñat <salvador.cunat@gmail.com>2017-06-16 16:40:47 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2017-06-22 10:40:04 +0900
commit6e2e363c5799bb9cbaf77818344e33aeebcdbc16 (patch)
tree8c7a9942a6dd4a1fd6983b09c5f3790212f9666d /smtk-import
parent5f5e52fb46d226fb6a38343276db4c542e2be2d1 (diff)
downloadsubsurface-6e2e363c5799bb9cbaf77818344e33aeebcdbc16.tar.gz
smtk-import: partially revert and complete 6963b52d
6963b52d introduced a cmake option, COMMANDLINE to enable building a pure command line version of smtk2ssrf importer, but then the #define COMMANDLINE=1 forces building CLI mode. This patch allows building GUI or CLI versions depending on selection of the COMMANDLINE option. Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Diffstat (limited to 'smtk-import')
-rw-r--r--smtk-import/CMakeLists.txt8
-rw-r--r--smtk-import/smtk_standalone.cpp1
2 files changed, 7 insertions, 2 deletions
diff --git a/smtk-import/CMakeLists.txt b/smtk-import/CMakeLists.txt
index 785c23887..1720b2eb1 100644
--- a/smtk-import/CMakeLists.txt
+++ b/smtk-import/CMakeLists.txt
@@ -3,7 +3,7 @@
project(smtk2ssrf)
cmake_minimum_required(VERSION 2.8.11)
-option(COMMANDLINE "Build command line version")
+option(COMMANDLINE "Build command line version" OFF)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
@@ -105,6 +105,12 @@ set(SMTK_IMPORT_TARGET smtk2ssrf)
add_library(smtk_import STATIC ${SMTK_IMPORT_SRCS})
add_executable(${SMTK_IMPORT_TARGET} smtk_standalone.cpp ${SUBSURFACE_RESOURCES})
+# We just want CLI mode on Linux. Silently drop it if cross building to Windows.
+if (COMMANDLINE AND CMAKE_SYSTEM_NAME STREQUAL "Linux")
+ message(WARNING "Building Command Line mode.")
+ target_compile_definitions(${SMTK_IMPORT_TARGET} PRIVATE COMMANDLINE=1)
+endif()
+
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
add_custom_command(
OUTPUT ${CMAKE_BINARY_DIR}/qt.conf
diff --git a/smtk-import/smtk_standalone.cpp b/smtk-import/smtk_standalone.cpp
index 2442d70d4..dc152f42f 100644
--- a/smtk-import/smtk_standalone.cpp
+++ b/smtk-import/smtk_standalone.cpp
@@ -5,7 +5,6 @@
#include "smrtk2ssrfc_window.h"
#include <QApplication>
#include <QDebug>
-#define COMMANDLINE 1
extern "C" void smartrak_import(const char *file, struct dive_table *table);