diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2015-07-20 09:35:00 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-07-20 09:35:00 -0700 |
commit | 43798702ff40586031f480b11a59c21cf7b4228b (patch) | |
tree | 248b77fcdf77b6d4c948fca7325a7231944e48b1 /CMakeLists.txt | |
parent | 947fda14c5d10916572ae1232987684205632c71 (diff) | |
download | subsurface-43798702ff40586031f480b11a59c21cf7b4228b.tar.gz |
Only enable Bluetooth support if building against Qt5.4 or newer
Also remove the quick hack from commit 947fda14c5d1 ("Bluetooth support:
quick build fix for Qt5.2"). I should have thought this through before
pushing that commit, but oh well.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index c3a2b8740..7b7f783b9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,6 +19,7 @@ option(USE_LIBGIT23_API "allow building with libgit2 master" OFF) option(FORCE_LIBSSH "force linking with libssh to workaround libgit2 bug" ON) option(SUBSURFACE_MOBILE "build the QtQuick version for mobile device" OFF) option(FBSUPPORT "allow posting to Facebook" ON) +option(BTSUPPORT "enable support for QtBluetooth (requires Qt5.4 or newer)" ON) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} @@ -177,6 +178,11 @@ find_package(Qt5 REQUIRED COMPONENTS Core Concurrent Widgets Network ${WEBKIT_PK set(QT_LIBRARIES Qt5::Core Qt5::Concurrent Qt5::Widgets Qt5::Network ${WEBKIT_LIB} ${PRINTING_LIB} Qt5::Svg ${QT_QUICK_LIB} ${ANDROID_LIB} Qt5::Bluetooth) set(QT_TEST_LIBRARIES ${QT_LIBRARIES} Qt5::Test) +if ("${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") +endif() + # Generate the ssrf-config.h every 'make' file(WRITE ${CMAKE_BINARY_DIR}/version.h.in "#define VERSION_STRING \"@VERSION_STRING@\" @@ -331,6 +337,11 @@ 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 @@ -360,7 +371,6 @@ source_group("Subsurface Models" FILES ${SUBSURFACE_MODELS}) set(SUBSURFACE_INTERFACE qt-ui/updatemanager.cpp qt-ui/about.cpp - qt-ui/btdeviceselectiondialog.cpp qt-ui/divecomputermanagementdialog.cpp qt-ui/divelistview.cpp qt-ui/diveplanner.cpp @@ -392,6 +402,7 @@ set(SUBSURFACE_INTERFACE qt-ui/qtwaitingspinner.cpp ${SUBSURFACE_PRINTING_SRCS} ${SOCIALNETWORKS} + ${BT_SRC_FILES} ) source_group("Subsurface Interface" FILES ${SUBSURFACE_INTERFACE}) |