From ae6f63f98e2d160c8a2777d081e8a3d0add59be5 Mon Sep 17 00:00:00 2001 From: David Wagner Date: Wed, 3 Feb 2016 18:22:55 +0100 Subject: [PATCH] Windows/Resource.rc: use user-provided version as "nice" fileversion There are two instances of FileVersion (resp. ProductVersion): a numerical one and a literal one. If the user forced a version string, use it as-is as the literal one. Signed-off-by: David Wagner --- SetVersion.cmake | 9 ++++++--- support/windows/Resource.rc.in | 4 ++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/SetVersion.cmake b/SetVersion.cmake index fc1c3065a..3adeec140 100644 --- a/SetVersion.cmake +++ b/SetVersion.cmake @@ -55,6 +55,9 @@ if(NOT DEFINED PF_VERSION) set(PF_VERSION "${CMAKE_MATCH_1}-0") endif() endif() +else() + # Set the "nice version string" to the one forced by the user + set(NICE_PF_VERSION "${PF_VERSION}") endif() # Parse the version number to extract the various fields @@ -68,8 +71,8 @@ if(PF_VERSION MATCHES ${REGEX}) set(PF_VERSION_DIRTY ${CMAKE_MATCH_8}) # Skip the 7th: it is a superset of the 8th endif() -# If we are precisely on a tag, make a nicer version string -set(NICE_PF_VERSION "${PF_VERSION}") -if((PF_VERSION_TWEAK EQUAL 0) AND (NOT PF_VERSION_DIRTY)) +# If we are precisely on a tag, make a nicer version string (unless otherwise +# forced by the user - see above) +if((NOT DEFINED NICE_PF_VERSION) AND (PF_VERSION_TWEAK EQUAL 0) AND (NOT PF_VERSION_DIRTY)) set(NICE_PF_VERSION "v${PF_VERSION_MAJOR}.${PF_VERSION_MINOR}.${PF_VERSION_PATCH}") endif() diff --git a/support/windows/Resource.rc.in b/support/windows/Resource.rc.in index 3a38333b8..9ed0078df 100644 --- a/support/windows/Resource.rc.in +++ b/support/windows/Resource.rc.in @@ -60,12 +60,12 @@ BEGIN BEGIN VALUE "CompanyName", "Intel Corporation" VALUE "FileDescription", "@WINRC_FILE_DESCRIPTION@" - VALUE "FileVersion", "v@WINRC_MAJOR@.@WINRC_MINOR@.@WINRC_PATCH@.@WINRC_TWEAK@" + VALUE "FileVersion", "@NICE_PF_VERSION@" VALUE "InternalName", WINRC_FILENAME VALUE "LegalCopyright", "Copyright (c) 2011-2016 Intel Corporation" VALUE "OriginalFilename", WINRC_FILENAME VALUE "ProductName", "Parameter Framework" - VALUE "ProductVersion", "v@WINRC_MAJOR@.@WINRC_MINOR@.@WINRC_PATCH@.@WINRC_TWEAK@" + VALUE "ProductVersion", "@NICE_PF_VERSION@" END END BLOCK "VarFileInfo"