diff options
author | Andrej Rode <andrej.rode@ettus.com> | 2017-04-13 14:07:04 -0700 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2017-04-13 15:52:16 -0700 |
commit | 6abf277470cae917042ce87e143d971f66e19257 (patch) | |
tree | 813c66d44693baaf44d3d412edbd6a3471d7ac92 /host | |
parent | fae9468c3a2c00c4390a50679b5ae176c5f9a2a5 (diff) | |
download | uhd-6abf277470cae917042ce87e143d971f66e19257.tar.gz uhd-6abf277470cae917042ce87e143d971f66e19257.tar.bz2 uhd-6abf277470cae917042ce87e143d971f66e19257.zip |
cmake: allow commandline override of UHD_GIT_{COUNT,HASH}
Diffstat (limited to 'host')
-rw-r--r-- | host/cmake/Modules/UHDVersion.cmake | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/host/cmake/Modules/UHDVersion.cmake b/host/cmake/Modules/UHDVersion.cmake index 79ba2d017..217769beb 100644 --- a/host/cmake/Modules/UHDVersion.cmake +++ b/host/cmake/Modules/UHDVersion.cmake @@ -109,26 +109,30 @@ EXECUTE_PROCESS( #only set the build info on success IF(_git_describe_result EQUAL 0) - EXECUTE_PROCESS( - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} - COMMAND ${PYTHON_EXECUTABLE} -c " + IF(NOT UHD_GIT_COUNT) + EXECUTE_PROCESS( + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} + COMMAND ${PYTHON_EXECUTABLE} -c " try: print('${_git_describe}'.split('-')[-2]) except IndexError: print('0') " - OUTPUT_VARIABLE UHD_GIT_COUNT OUTPUT_STRIP_TRAILING_WHITESPACE - ) - EXECUTE_PROCESS( - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} - COMMAND ${PYTHON_EXECUTABLE} -c " + OUTPUT_VARIABLE UHD_GIT_COUNT OUTPUT_STRIP_TRAILING_WHITESPACE + ) + ENDIF() + IF(NOT UHD_GIT_HASH) + EXECUTE_PROCESS( + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} + COMMAND ${PYTHON_EXECUTABLE} -c " try: print('${_git_describe}'.split('-')[-1]) except IndexError: print('unknown') " - OUTPUT_VARIABLE UHD_GIT_HASH OUTPUT_STRIP_TRAILING_WHITESPACE - ) + OUTPUT_VARIABLE UHD_GIT_HASH OUTPUT_STRIP_TRAILING_WHITESPACE + ) + ENDIF() ENDIF() ## Set default values if all fails. Make sure they're identical to the ones above. |