From 5246cf1750736f900b14013c8a0e8788b7271783 Mon Sep 17 00:00:00 2001 From: Marius Greuel Date: Wed, 29 Dec 2021 22:18:15 +0100 Subject: [PATCH] Make Windows version resource accept fewer than four version numbers --- src/windows.rc.in | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/src/windows.rc.in b/src/windows.rc.in index 21c2b600..e90362f9 100644 --- a/src/windows.rc.in +++ b/src/windows.rc.in @@ -27,10 +27,34 @@ BEGIN 100 "AVRDUDE" END -#define VER_MAJOR @PROJECT_VERSION_MAJOR@ -#define VER_MINOR @PROJECT_VERSION_MINOR@ -#define VER_BUILD @PROJECT_VERSION_PATCH@ -#define VER_REVISION @PROJECT_VERSION_TWEAK@ +#cmakedefine PROJECT_VERSION_MAJOR @PROJECT_VERSION_MAJOR@ +#cmakedefine PROJECT_VERSION_MINOR @PROJECT_VERSION_MINOR@ +#cmakedefine PROJECT_VERSION_PATCH @PROJECT_VERSION_PATCH@ +#cmakedefine PROJECT_VERSION_TWEAK @PROJECT_VERSION_TWEAK@ + +#ifdef PROJECT_VERSION_MAJOR +#define VER_MAJOR PROJECT_VERSION_MAJOR +#else +#define VER_MAJOR 0 +#endif + +#ifdef PROJECT_VERSION_MINOR +#define VER_MINOR PROJECT_VERSION_MINOR +#else +#define VER_MINOR 0 +#endif + +#ifdef PROJECT_VERSION_PATCH +#define VER_BUILD PROJECT_VERSION_PATCH +#else +#define VER_BUILD 0 +#endif + +#ifdef PROJECT_VERSION_TWEAK +#define VER_REVISION PROJECT_VERSION_TWEAK +#else +#define VER_REVISION 0 +#endif #define _STR(s) #s #define _VER_STR(a, b, c, d) _STR(a) "." _STR(b) "." _STR(c) "." _STR(d)