summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tomaz.canabrava@intel.com>2015-12-16 14:55:53 -0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-12-16 09:21:28 -0800
commitc3493fa141f497a394c2e872cbdbb3e1959dc02b (patch)
tree773d806100b9fd3a598428adb0afb76e06de1ff8 /CMakeLists.txt
parent27bf6f68f6237dea4bd5de27e4c12ac8d685f882 (diff)
downloadsubsurface-c3493fa141f497a394c2e872cbdbb3e1959dc02b.tar.gz
Fix some broken-by-design code
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt16
1 files changed, 7 insertions, 9 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 484d1bd03..ffe13a3d3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -171,6 +171,7 @@ endif()
if(BTSUPPORT)
list(APPEND QT_EXTRA_COMPONENTS Bluetooth)
list(APPEND QT_EXTRA_LIBRARIES Qt5::Bluetooth)
+ add_definitions(-DBT_SUPPORT)
endif()
find_package(Qt5 REQUIRED COMPONENTS Core Concurrent Widgets Network Svg Test LinguistTools Positioning ${QT_EXTRA_COMPONENTS})
@@ -184,10 +185,6 @@ if (BTSUPPORT AND "${Qt5Core_VERSION_STRING}" STRLESS "5.4.0")
list(REMOVE_ITEM QT_LIBRARIES Qt5::Bluetooth)
endif()
-if(BTSUPPORT)
- add_definitions(-DBT_SUPPORT)
-endif()
-
#set up the subsurface_link_libraries variable
set(SUBSURFACE_LINK_LIBRARIES ${SUBSURFACE_LINK_LIBRARIES} ${LIBDIVECOMPUTER_LIBRARIES} ${LIBGIT2_LIBRARIES} ${LIBUSB_LIBRARIES})
qt5_add_resources(SUBSURFACE_RESOURCES subsurface.qrc)
@@ -202,7 +199,7 @@ if(SMARTTRAK_IMPORT)
add_subdirectory(smtk-import)
endif()
-if (NOT SUBSURFACE_MOBILE)
+if (${SUBSURFACE_TARGET_EXECUTABLE} MATCHES "DesktopApplication")
add_subdirectory(desktop-widgets)
endif()
@@ -212,7 +209,7 @@ if(FBSUPPORT)
endif()
# create the executables
-if(${SUBSURFACE_TARGET_PLATFORM} MATCHES "Android")
+if(${SUBSURFACE_TARGET_EXECUTABLE} MATCHES "MobileApplication")
set(SUBSURFACE_TARGET subsurface-mobile)
set(MOBILE_SRC
qt-mobile/qmlmanager.cpp
@@ -222,8 +219,9 @@ if(${SUBSURFACE_TARGET_PLATFORM} MATCHES "Android")
subsurface-mobile-helper.cpp
)
qt5_add_resources(MOBILE_RESOURCES qt-mobile/qml/mobile-resources.qrc)
- if(${SUBSURFACE_TARGET_EXECUTABLE} MATCHES "MobileExecutable")
- add_library(subsurface-mobile SHARED ${MOBILE_SRC} ${SUBSURFACE_PKG} ${SUBSURFACE_RESOURCES} ${MOBILE_RESOURCES})
+ # When building the mobile application in Android, link it and Qt will do the rest, when doing the mobile application on Desktop, create an executable.
+ if(ANDROID)
+ add_library(subsurface-mobile SHARED ${SUBSURFACE_PKG} ${MOBILE_SRC} ${SUBSURFACE_RESOURCES} ${MOBILE_RESOURCES})
else()
add_executable(${SUBSURFACE_TARGET} ${SUBSURFACE_PKG} ${MOBILE_SRC} ${SUBSURFACE_RESOURCES} ${MOBILE_RESOURCES})
endif()
@@ -234,7 +232,7 @@ if(${SUBSURFACE_TARGET_PLATFORM} MATCHES "Android")
subsurface_corelib
${SUBSURFACE_LINK_LIBRARIES}
)
-elseif(SUBSURFACE_TARGET_PLATFORM MATCHES "Desktop")
+elseif(${SUBSURFACE_TARGET_EXECUTABLE} MATCHES "DesktopApplication")
set(SUBSURFACE_APP
subsurface-desktop-main.cpp
subsurface-desktop-helper.cpp