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>
This commit is contained in:
Salvador Cuñat 2017-06-16 16:40:47 +02:00 committed by Dirk Hohndel
parent 5f5e52fb46
commit 6e2e363c57
2 changed files with 7 additions and 2 deletions

View file

@ -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

View file

@ -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);