From 1e6e4a262d94fb21e06c8381ba3bd0f6fa553154 Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Wed, 18 Feb 2015 15:55:41 +0100 Subject: cmake: Fixed trimmed version --- host/cmake/Modules/UHDVersion.cmake | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'host/cmake/Modules/UHDVersion.cmake') 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}") ######################################################################## -- cgit v1.2.3