diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2015-10-26 06:05:27 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-10-26 06:51:47 -0700 |
commit | 3b0f38f24a3c3d7ccadf8c0b0011dfc58c2f9d46 (patch) | |
tree | ef71eedd9499b3441da39ff5d0516c76f76bb7f4 /CMakeLists.txt | |
parent | 1d10a56bdf6823e8935729aef60b659dea550a6a (diff) | |
download | subsurface-3b0f38f24a3c3d7ccadf8c0b0011dfc58c2f9d46.tar.gz |
Fix building without BT support
I guess no one had tried this in a while.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 5e7c630a1..5e9321eee 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -203,13 +203,18 @@ if(ANDROID) set(ANDROID_PKG AndroidExtras) set(ANDROID_LIB Qt5::AndroidExtras) endif() -find_package(Qt5 REQUIRED COMPONENTS Core Concurrent Widgets Network ${WEBKIT_PKG} ${PRINTING_PKG} Svg Test LinguistTools ${QT_QUICK_PKG} ${ANDROID_PKG} Bluetooth) -set(QT_LIBRARIES Qt5::Core Qt5::Concurrent Qt5::Widgets Qt5::Network ${WEBKIT_LIB} ${PRINTING_LIB} Qt5::Svg ${QT_QUICK_LIB} ${ANDROID_LIB} Qt5::Bluetooth) +if(BTSUPPORT) + set(BLUETOOTH_PKG Bluetooth) + set(BLUETOOTH_LIB Qt5::Bluetooth) +endif() +find_package(Qt5 REQUIRED COMPONENTS Core Concurrent Widgets Network ${WEBKIT_PKG} ${PRINTING_PKG} Svg Test LinguistTools ${QT_QUICK_PKG} ${ANDROID_PKG} ${BLUETOOTH_PKG}) +set(QT_LIBRARIES Qt5::Core Qt5::Concurrent Qt5::Widgets Qt5::Network ${WEBKIT_LIB} ${PRINTING_LIB} Qt5::Svg ${QT_QUICK_LIB} ${ANDROID_LIB} ${BLUETOOTH_LIB}) set(QT_TEST_LIBRARIES ${QT_LIBRARIES} Qt5::Test) -if ("${Qt5Core_VERSION_STRING}" STRLESS "5.4.0") +if (BTSUPPORT AND "${Qt5Core_VERSION_STRING}" STRLESS "5.4.0") set(BTSUPPORT OFF) message(STATUS "Turning off Bluetooth support as Qt version ${Qt5Core_VERSION_STRING} is insufficiant for that") + string(REPLACE "Qt5::Bluetooth" "" QT_LIBRARIES ${QT_LIBRARIES}) endif() # Generate the ssrf-config.h every 'make' @@ -311,6 +316,12 @@ endif() # include translations add_subdirectory(translations) +if(BTSUPPORT) + add_definitions(-DBT_SUPPORT) + set(BT_SRC_FILES qt-ui/btdeviceselectiondialog.cpp) + set(BT_CORE_SRC_FILES qtserialbluetooth.cpp) +endif() + # compile the core library, in C. set(SUBSURFACE_CORE_LIB_SRCS cochran.c @@ -361,7 +372,7 @@ set(SUBSURFACE_CORE_LIB_SRCS windowtitleupdate.cpp divelogexportlogic.cpp qt-init.cpp - qtserialbluetooth.cpp + ${BT_CORE_SRC_FILES} ${SERIAL_FTDI} ${PLATFORM_SRC} ) @@ -372,11 +383,6 @@ if(FBSUPPORT) set(SOCIALNETWORKS qt-ui/socialnetworks.cpp) endif() -if(BTSUPPORT) - add_definitions(-DBT_SUPPORT) - set(BT_SRC_FILES qt-ui/btdeviceselectiondialog.cpp) -endif() - # the data models that will interface # with the views. set(SUBSURFACE_MODELS_LIB_SRCS |