Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgreshilov <slovaricheg@gmail.com>2017-11-13 17:05:42 +0300
committermpimenov <mpimenov@users.noreply.github.com>2017-11-14 12:53:36 +0300
commit1452800af55e44c9ab503918466cfc8349adf8a1 (patch)
treea3667dbbfb155ed83941c9657068551e1f04e69e /CMakeLists.txt
parent53d7a87af1d00d43b439ee46534646e7a823e0b3 (diff)
Qt version check added, and some styling remarks fixed
UPATE: Build designer option block moved down UPDATE 2: Build type block moved up, right after platform block
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt52
1 files changed, 29 insertions, 23 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2174c993d0..7d3acdd3a4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -4,15 +4,6 @@ project(omim C CXX)
set(CMAKE_CXX_STANDARD 11)
-# Options
-option(BUILD_DESIGNER "Build application as design tool" OFF)
-if (BUILD_DESIGNER)
- message("Designer tool building is enabled")
- add_definitions(-DBUILD_DESIGNER)
-else()
- message("Designer tool building is disabled")
-endif()
-
# Set target platform:
function(omim_set_platform_var PLATFORM_VAR pattern)
set(${PLATFORM_VAR} FALSE PARENT_SCOPE)
@@ -58,7 +49,29 @@ else()
endif()
# End of setting the target platform
+# Set build type:
+if (NOT CMAKE_BUILD_TYPE)
+ set(CMAKE_BUILD_TYPE "Release")
+endif()
+
+if ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
+ add_definitions(-DDEBUG)
+elseif ("${CMAKE_BUILD_TYPE}" STREQUAL "Release")
+ add_definitions(-DRELEASE)
+else()
+ message(FATAL_ERROR "Unknown build type: " ${CMAKE_BUILD_TYPE})
+endif()
+
+message("Build type: " ${CMAKE_BUILD_TYPE})
+# End of setting build type
+
# Options
+option(BUILD_DESIGNER "Build application as design tool" OFF)
+if (BUILD_DESIGNER)
+ message("Designer tool building is enabled")
+ add_definitions(-DBUILD_DESIGNER)
+endif()
+
option(USE_ASAN "Enable Address Sanitizer" OFF)
option(USE_TSAN "Enable Thread Sanitizer" OFF)
option(PYBINDINGS "Create makefiles for building python bindings" OFF)
@@ -76,6 +89,10 @@ if (USE_TSAN)
message("Thread Sanitizer is enabled")
endif()
+if (USE_ASAN AND USE_TSAN)
+ message(FATAL_ERROR "Can't use two different sanitizers together")
+endif()
+
if (USE_PPROF)
message("Google Profiler is enabled")
add_definitions(-DUSE_PPROF)
@@ -93,20 +110,6 @@ else()
set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} "/usr/local/opt/qt5")
endif()
-if (NOT CMAKE_BUILD_TYPE)
- set(CMAKE_BUILD_TYPE "Release")
-endif()
-
-if ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
- add_definitions(-DDEBUG)
-elseif ("${CMAKE_BUILD_TYPE}" STREQUAL "Release")
- add_definitions(-DRELEASE)
-else()
- message(FATAL_ERROR "Unknown build type: " ${CMAKE_BUILD_TYPE})
-endif()
-
-message("Build type: " ${CMAKE_BUILD_TYPE})
-
if (NOT SKIP_TESTS)
set(SKIP_TESTS FALSE)
endif()
@@ -171,6 +174,9 @@ if (NOT PLATFORM_IPHONE AND NOT PLATFORM_ANDROID)
if (NOT Qt5Core_FOUND)
message(FATAL_ERROR "Qt5 cmake files were not found, please set QT_PATH environment variable")
endif()
+ if (Qt5Core_VERSION VERSION_LESS 5.5.0)
+ message(FATAL_ERROR "Minimum supported Qt5 version is 5.5")
+ endif()
find_package(Qt5Network REQUIRED)
if (NOT SKIP_DESKTOP)
find_qt5_desktop_package(Qt5Gui)