summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tomaz.canabrava@intel.com>2015-11-23 12:13:24 -0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-12-16 08:00:56 -0800
commitb6eb8658039e74eb748914c77ce00ff87f2c982a (patch)
tree9afa011c8cccad25c20fdb1dff78601401b2d423 /CMakeLists.txt
parentaaafaade5ec645df2b48a3ef8c6e984d95d04636 (diff)
downloadsubsurface-b6eb8658039e74eb748914c77ce00ff87f2c982a.tar.gz
Issue an error when no platform is found
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt30
1 files changed, 19 insertions, 11 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4eaacde80..961efe8ba 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -36,17 +36,26 @@ option(FTDISUPPORT "enable support for libftdi based serial" OFF)
option(MAKE_TESTS "Make the tests" ON)
SET(SUBSURFACE_TARGET_PLATFORM "Desktop" CACHE STRING "The target that Subsurface will be build")
-SET_PROPERTY(CACHE SUBSURFACE_TARGET_PLATFORM PROPERTY STRINGS "Desktop" "Android" "iOS" "AndroidEmulator" "iOSEmulator")
+LIST(APPEND SUBSURFACE_ACCEPTED_PLATFORMS "Desktop" "Android" "iOS" "AndroidEmulator" "iOSEmulator")
+SET_PROPERTY(CACHE SUBSURFACE_TARGET_PLATFORM PROPERTY STRINGS ${SUBSURFACE_ACCEPTED_PLATFORMS})
#Extra features
option(SMARTTRAK_IMPORT "enable building SmartTrak divelogs import tool (requires glib2 and libmdb)" OFF)
-if (NOT FBSUPPORT)
- set(DISABLE_PLUGINS ON)
+#verify if Platform is correct and warn on wxit with example.
+list (FIND SUBSURFACE_ACCEPTED_PLATFORMS ${SUBSURFACE_TARGET_PLATFORM} _index)
+if (${_index} EQUAL -1)
+ message(FATAL_ERROR "Requested platform not supported, please use one of the following:
+ ${SUBSURFACE_ACCEPTED_PLATFORMS}
+
+ inputted value was: ${SUBSURFACE_TARGET_PLATFORM}
+
+ Example: -DSUBSURFACE_TARGET_PLATFORM=Desktop")
endif()
add_definitions(-DSUBSURFACE_SOURCE="${CMAKE_SOURCE_DIR}")
+#evenrything's correct, moving on.
set(CMAKE_MODULE_PATH
${CMAKE_MODULE_PATH}
${${PROJECT_NAME}_SOURCE_DIR}/cmake/Modules
@@ -112,24 +121,22 @@ if(ANDROID)
endif()
# configure Qt.
-if(SUBSURFACE_MOBILE)
- list(APPEND QT_EXTRA_COMPONENTS Quick)
- list(APPEND QT_EXTRA_LIBRARIES Qt5::Quick)
- add_definitions(-DSUBSURFACE_MOBILE)
-endif()
if(ANDROID)
- list(APPEND QT_EXTRA_COMPONENTS AndroidExtras)
- list(APPEND QT_EXTRA_LIBRARIES Qt5::AndroidExtras)
+ list(APPEND QT_EXTRA_COMPONENTS AndroidExtras Quick)
+ list(APPEND QT_EXTRA_LIBRARIES Qt5::AndroidExtras Qt5::Quick)
+ add_definitions(-DSUBSURFACE_MOBILE)
endif()
+
if(BTSUPPORT)
list(APPEND QT_EXTRA_COMPONENTS Bluetooth)
list(APPEND QT_EXTRA_LIBRARIES Qt5::Bluetooth)
endif()
-find_package(Qt5 REQUIRED COMPONENTS Core Concurrent Widgets Network Svg Test LinguistTools OOLCHAIN_LOCATION ${QT_EXTRA_COMPONENTS})
+find_package(Qt5 REQUIRED COMPONENTS Core Concurrent Widgets Network Svg Test LinguistTools Positioning ${QT_EXTRA_COMPONENTS})
set(QT_LIBRARIES Qt5::Core Qt5::Concurrent Qt5::Widgets Qt5::Network Qt5::Svg Qt5::Positioning ${QT_EXTRA_LIBRARIES})
set(QT_TEST_LIBRARIES ${QT_LIBRARIES} Qt5::Test)
+#disable bluetooth if Qt version is ancient.
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 insufficient for that")
@@ -140,6 +147,7 @@ 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})
# set up the different target platforms