aboutsummaryrefslogtreecommitdiffstats
path: root/host/cmake/Modules
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2015-02-18 15:55:41 +0100
committerMartin Braun <martin.braun@ettus.com>2015-02-18 16:01:41 +0100
commit1e6e4a262d94fb21e06c8381ba3bd0f6fa553154 (patch)
tree0dd0ac472819fcca58adc7eba158024972fb0004 /host/cmake/Modules
parentacfac7385c6130df54c60aa5c31bee6d06fa3f6a (diff)
downloaduhd-1e6e4a262d94fb21e06c8381ba3bd0f6fa553154.tar.gz
uhd-1e6e4a262d94fb21e06c8381ba3bd0f6fa553154.tar.bz2
uhd-1e6e4a262d94fb21e06c8381ba3bd0f6fa553154.zip
cmake: Fixed trimmed version
Diffstat (limited to 'host/cmake/Modules')
-rw-r--r--host/cmake/Modules/UHDVersion.cmake8
1 files changed, 6 insertions, 2 deletions
diff --git a/host/cmake/Modules/UHDVersion.cmake b/host/cmake/Modules/UHDVersion.cmake
index 0fb8c0af3..014943b53 100644
--- a/host/cmake/Modules/UHDVersion.cmake
+++ b/host/cmake/Modules/UHDVersion.cmake
@@ -38,7 +38,7 @@ SET(UHD_VERSION_DEVEL FALSE)
FUNCTION(DEPAD_NUM input_num output_num)
EXECUTE_PROCESS(
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
- COMMAND ${PYTHON_EXECUTABLE} -c "print int('${input_num}') if isinstance('${input_num}', (int, long)) else '${input_num}'"
+ COMMAND ${PYTHON_EXECUTABLE} -c "print int('${input_num}')"
OUTPUT_VARIABLE depadded_num OUTPUT_STRIP_TRAILING_WHITESPACE
)
SET(${output_num} ${depadded_num} PARENT_SCOPE)
@@ -46,7 +46,11 @@ ENDFUNCTION(DEPAD_NUM)
DEPAD_NUM(${UHD_VERSION_MAJOR} TRIMMED_VERSION_MAJOR)
DEPAD_NUM(${UHD_VERSION_MINOR} TRIMMED_VERSION_MINOR)
-DEPAD_NUM(${UHD_VERSION_PATCH} TRIMMED_VERSION_PATCH)
+IF(UHD_VERSION_DEVEL)
+ SET(TRIMMED_VERSION_PATCH ${UHD_VERSION_PATCH})
+ELSE(UHD_VERSION_DEVEL)
+ DEPAD_NUM(${UHD_VERSION_PATCH} TRIMMED_VERSION_PATCH)
+ENDIF(UHD_VERSION_DEVEL)
SET(TRIMMED_UHD_VERSION "${TRIMMED_VERSION_MAJOR}.${TRIMMED_VERSION_MINOR}.${TRIMMED_VERSION_PATCH}")
########################################################################