<T>_MAKE_VERSION macro add in "set_version()" CMake generated header
This commit is contained in:
@@ -14,7 +14,9 @@ Create variable <target>_VERSION with full version name
|
||||
|
||||
If OUTPUT then generate header <file> with
|
||||
version macros - <target>_VERSION_<NAME>
|
||||
Also create macro <target>_VERSION_NAME with full string version
|
||||
Also create macro <target>_VERSION_NAME with full string version and
|
||||
macro <target>_MAKE_VERSION(major, minor, revision) that returns
|
||||
byte-packed integer version.
|
||||
Attention: macro <target>_VERSION is byte-packed integer version!
|
||||
|
||||
|
||||
@@ -165,7 +167,7 @@ set(_dt_delim "::")
|
||||
|
||||
|
||||
macro(set_version _T)
|
||||
set(_VERSION_ 1) # macro version
|
||||
set(_VERSION_ 2) # macro version
|
||||
set(_name)
|
||||
set(_is_name 1)
|
||||
set(_is_out 0)
|
||||
@@ -239,7 +241,8 @@ macro(set_version _T)
|
||||
#define ${_TN}_VERSION_BUILD ${${_T}_VERSION_BUILD}
|
||||
#define ${_TN}_VERSION_SUFFIX \"${${_T}_VERSION_SUFFIX}\"
|
||||
#define ${_TN}_VERSION_NAME \"${${_T}_VERSION}\"
|
||||
#define ${_TN}_VERSION ((${_TN}_VERSION_MAJOR << 16) | (${_TN}_VERSION_MINOR << 8) | ${_TN}_VERSION_REVISION)
|
||||
#define ${_TN}_MAKE_VERSION(major, minor, revision) ((major << 16) | (minor << 8) | revision)
|
||||
#define ${_TN}_VERSION ${_TN}_MAKE_VERSION(${_TN}_VERSION_MAJOR, ${_TN}_VERSION_MINOR, ${_TN}_VERSION_REVISION)
|
||||
|
||||
|
||||
// Tools
|
||||
|
||||
Reference in New Issue
Block a user