aboutsummaryrefslogtreecommitdiffstats
path: root/host
diff options
context:
space:
mode:
authorAndrej Rode <andrej.rode@ettus.com>2017-02-27 10:14:27 -0800
committerMartin Braun <martin.braun@ettus.com>2018-03-07 16:21:51 -0800
commit4aca39fdca5ca160d2294f16877db1fdc60cc6b5 (patch)
tree4fee3402a5cf675c8ea02b2115659667da03d07a /host
parent3645139e7d51d92f4bfe4148eefad2c22b40147a (diff)
downloaduhd-4aca39fdca5ca160d2294f16877db1fdc60cc6b5.tar.gz
uhd-4aca39fdca5ca160d2294f16877db1fdc60cc6b5.tar.bz2
uhd-4aca39fdca5ca160d2294f16877db1fdc60cc6b5.zip
cmake: add manual override option to UHD_VERSION
Diffstat (limited to 'host')
-rw-r--r--host/CMakeLists.txt3
-rw-r--r--host/cmake/Modules/UHDVersion.cmake4
2 files changed, 6 insertions, 1 deletions
diff --git a/host/CMakeLists.txt b/host/CMakeLists.txt
index 55f78ac30..ab7f41fb5 100644
--- a/host/CMakeLists.txt
+++ b/host/CMakeLists.txt
@@ -14,6 +14,9 @@
# Project setup
########################################################################
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
+IF(POLICY CMP0048)
+ CMAKE_POLICY(SET CMP0048 NEW) # Suppress Version warnings
+ENDIF(POLICY CMP0048)
PROJECT(UHD CXX C)
ENABLE_TESTING()
diff --git a/host/cmake/Modules/UHDVersion.cmake b/host/cmake/Modules/UHDVersion.cmake
index a15d03ddf..a4ad23188 100644
--- a/host/cmake/Modules/UHDVersion.cmake
+++ b/host/cmake/Modules/UHDVersion.cmake
@@ -125,7 +125,9 @@ ENDIF()
########################################################################
-IF(TRIM_UHD_VERSION STREQUAL "True")
+IF(DEFINED UHD_VERSION)
+ SET(UHD_VERSION "${UHD_VERSION}" CACHE STRING "Set UHD_VERSION to a custom value")
+ELSEIF(TRIM_UHD_VERSION STREQUAL "True")
SET(UHD_VERSION "${UHD_VERSION_MAJOR}.${UHD_VERSION_API}.${UHD_VERSION_ABI}.${UHD_VERSION_PATCH}-${UHD_GIT_HASH}")
ELSE()
SET(UHD_VERSION "${UHD_VERSION_MAJOR}.${UHD_VERSION_API}.${UHD_VERSION_ABI}.${UHD_VERSION_PATCH}-${UHD_GIT_COUNT}-${UHD_GIT_HASH}")