Fix some broken-by-design code

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
This commit is contained in:
Tomaz Canabrava 2015-12-16 14:55:53 -02:00 committed by Dirk Hohndel
parent 27bf6f68f6
commit c3493fa141

View file

@ -171,6 +171,7 @@ endif()
if(BTSUPPORT) if(BTSUPPORT)
list(APPEND QT_EXTRA_COMPONENTS Bluetooth) list(APPEND QT_EXTRA_COMPONENTS Bluetooth)
list(APPEND QT_EXTRA_LIBRARIES Qt5::Bluetooth) list(APPEND QT_EXTRA_LIBRARIES Qt5::Bluetooth)
add_definitions(-DBT_SUPPORT)
endif() endif()
find_package(Qt5 REQUIRED COMPONENTS Core Concurrent Widgets Network Svg Test LinguistTools Positioning ${QT_EXTRA_COMPONENTS}) 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) list(REMOVE_ITEM QT_LIBRARIES Qt5::Bluetooth)
endif() endif()
if(BTSUPPORT)
add_definitions(-DBT_SUPPORT)
endif()
#set up the subsurface_link_libraries variable #set up the subsurface_link_libraries variable
set(SUBSURFACE_LINK_LIBRARIES ${SUBSURFACE_LINK_LIBRARIES} ${LIBDIVECOMPUTER_LIBRARIES} ${LIBGIT2_LIBRARIES} ${LIBUSB_LIBRARIES}) set(SUBSURFACE_LINK_LIBRARIES ${SUBSURFACE_LINK_LIBRARIES} ${LIBDIVECOMPUTER_LIBRARIES} ${LIBGIT2_LIBRARIES} ${LIBUSB_LIBRARIES})
qt5_add_resources(SUBSURFACE_RESOURCES subsurface.qrc) qt5_add_resources(SUBSURFACE_RESOURCES subsurface.qrc)
@ -202,7 +199,7 @@ if(SMARTTRAK_IMPORT)
add_subdirectory(smtk-import) add_subdirectory(smtk-import)
endif() endif()
if (NOT SUBSURFACE_MOBILE) if (${SUBSURFACE_TARGET_EXECUTABLE} MATCHES "DesktopApplication")
add_subdirectory(desktop-widgets) add_subdirectory(desktop-widgets)
endif() endif()
@ -212,7 +209,7 @@ if(FBSUPPORT)
endif() endif()
# create the executables # create the executables
if(${SUBSURFACE_TARGET_PLATFORM} MATCHES "Android") if(${SUBSURFACE_TARGET_EXECUTABLE} MATCHES "MobileApplication")
set(SUBSURFACE_TARGET subsurface-mobile) set(SUBSURFACE_TARGET subsurface-mobile)
set(MOBILE_SRC set(MOBILE_SRC
qt-mobile/qmlmanager.cpp qt-mobile/qmlmanager.cpp
@ -222,8 +219,9 @@ if(${SUBSURFACE_TARGET_PLATFORM} MATCHES "Android")
subsurface-mobile-helper.cpp subsurface-mobile-helper.cpp
) )
qt5_add_resources(MOBILE_RESOURCES qt-mobile/qml/mobile-resources.qrc) qt5_add_resources(MOBILE_RESOURCES qt-mobile/qml/mobile-resources.qrc)
if(${SUBSURFACE_TARGET_EXECUTABLE} MATCHES "MobileExecutable") # 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.
add_library(subsurface-mobile SHARED ${MOBILE_SRC} ${SUBSURFACE_PKG} ${SUBSURFACE_RESOURCES} ${MOBILE_RESOURCES}) if(ANDROID)
add_library(subsurface-mobile SHARED ${SUBSURFACE_PKG} ${MOBILE_SRC} ${SUBSURFACE_RESOURCES} ${MOBILE_RESOURCES})
else() else()
add_executable(${SUBSURFACE_TARGET} ${SUBSURFACE_PKG} ${MOBILE_SRC} ${SUBSURFACE_RESOURCES} ${MOBILE_RESOURCES}) add_executable(${SUBSURFACE_TARGET} ${SUBSURFACE_PKG} ${MOBILE_SRC} ${SUBSURFACE_RESOURCES} ${MOBILE_RESOURCES})
endif() endif()
@ -234,7 +232,7 @@ if(${SUBSURFACE_TARGET_PLATFORM} MATCHES "Android")
subsurface_corelib subsurface_corelib
${SUBSURFACE_LINK_LIBRARIES} ${SUBSURFACE_LINK_LIBRARIES}
) )
elseif(SUBSURFACE_TARGET_PLATFORM MATCHES "Desktop") elseif(${SUBSURFACE_TARGET_EXECUTABLE} MATCHES "DesktopApplication")
set(SUBSURFACE_APP set(SUBSURFACE_APP
subsurface-desktop-main.cpp subsurface-desktop-main.cpp
subsurface-desktop-helper.cpp subsurface-desktop-helper.cpp