zephyr/version.h.in
Torsten Rasmussen 2c757f9e7a cmake: generalize VERSION infrastructure for better reuse
Generalize the VERSION and version.h generation so that the same
infrastructure can be reused for generating other version related
header files, such as an application version header.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2023-05-17 13:56:58 +02:00

22 lines
872 B
C

#ifndef _@VERSION_TYPE@_VERSION_H_
#define _@VERSION_TYPE@_VERSION_H_
/* @templates@ values come from cmake/version.cmake
* BUILD_VERSION related @template@ values will be 'git describe',
* alternatively user defined BUILD_VERSION.
*/
#cmakedefine ZEPHYR_VERSION_CODE @ZEPHYR_VERSION_CODE@
#cmakedefine ZEPHYR_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
#define @VERSION_TYPE@VERSION @@VERSION_TYPE@VERSION@
#define @VERSION_TYPE@_VERSION_NUMBER @@VERSION_TYPE@_VERSION_NUMBER@
#define @VERSION_TYPE@_VERSION_MAJOR @@VERSION_TYPE@_VERSION_MAJOR@
#define @VERSION_TYPE@_VERSION_MINOR @@VERSION_TYPE@_VERSION_MINOR@
#define @VERSION_TYPE@_PATCHLEVEL @@VERSION_TYPE@_PATCHLEVEL@
#define @VERSION_TYPE@_VERSION_STRING "@@VERSION_TYPE@_VERSION_STRING@"
#define @BUILD_VERSION_NAME@ @@BUILD_VERSION_NAME@@
#endif /* _@VERSION_TYPE@_VERSION_H_ */