Add rsmi_version_get() function

Also, modify CMakeLists.txt to use git tags to determine the
shared library version for the SONAME and the ROCm build for the
package name.


[ROCm/amdsmi commit: 5a9a729b31]
This commit is contained in:
Chris Freehill
2018-12-06 13:48:59 -06:00
parent 0c669a84ae
commit 01ffc5f17f
6 changed files with 206 additions and 91 deletions
+2 -3
View File
@@ -85,15 +85,14 @@ endfunction ()
## using versioning tags and git describe.
## Passes back a packaging version string
## and a library version string.
function ( get_version DEFAULT_VERSION_STRING )
function(get_version DEFAULT_VERSION_STRING VERSION_PREFIX)
parse_version ( ${DEFAULT_VERSION_STRING} )
find_program ( GIT NAMES git )
if ( GIT )
execute_process ( COMMAND git describe --dirty --long --match [0-9]*
execute_process ( COMMAND git describe --dirty --long --match ${VERSION_PREFIX}-[0-9.]*
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
OUTPUT_VARIABLE GIT_TAG_STRING
OUTPUT_STRIP_TRAILING_WHITESPACE