summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2017-02-03 15:59:42 -0800
committerJohn Firebaugh <john.firebaugh@gmail.com>2017-02-08 10:59:59 -0600
commit150b938b4922ec162bcb593c365e3d3616e0dbd7 (patch)
treeedc3cf391f8971e98752fe1c52f8513afeb71cef /CMakeLists.txt
parentd3ca6c67f1b8fbf5d71c307e71ba89a483ec75bc (diff)
downloadqtlocation-mapboxgl-150b938b4922ec162bcb593c365e3d3616e0dbd7.tar.gz
[build, ios, macos] Simplify version portion of user agent string
The X.Y.Z version portion was unreliable, as it pulled from the latest tag regardless of platform. Set version to 0.0.0 and retrieve only the hash, which allows us to drop the node/npm dependency.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt12
1 files changed, 12 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a48d544538..48c62007ee 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -27,6 +27,18 @@ if(IS_CI_BUILD)
add_compile_options(-DCI_BUILD=1)
endif()
+if(EXISTS ${CMAKE_SOURCE_DIR}/.git/HEAD)
+ exec_program(
+ "git"
+ ${CMAKE_SOURCE_DIR}
+ ARGS "rev-parse --short=8 HEAD"
+ OUTPUT_VARIABLE MBGL_VERSION_REV )
+else()
+ set(MBGL_VERSION_REV 00000000)
+endif()
+
+set_source_files_properties(src/mbgl/util/version.cpp PROPERTIES COMPILE_DEFINITIONS MBGL_VERSION_REV="${MBGL_VERSION_REV}")
+
mason_use(geometry VERSION 0.9.0 HEADER_ONLY)
mason_use(variant VERSION 1.1.4 HEADER_ONLY)
mason_use(unique_resource VERSION dev HEADER_ONLY)