From 6e2e363c5799bb9cbaf77818344e33aeebcdbc16 Mon Sep 17 00:00:00 2001 From: Salvador Cuñat Date: Fri, 16 Jun 2017 16:40:47 +0200 Subject: smtk-import: partially revert and complete 6963b52d MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- smtk-import/CMakeLists.txt | 8 +++++++- smtk-import/smtk_standalone.cpp | 1 - 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 #include -#define COMMANDLINE 1 extern "C" void smartrak_import(const char *file, struct dive_table *table); -- cgit v1.2.3-70-g09d2