Skip to content
This repository has been archived by the owner on Aug 5, 2022. It is now read-only.

Commit

Permalink
Windows/Resource.rc: use user-provided version as "nice" fileversion
Browse files Browse the repository at this point in the history
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 <david.wagner@intel.com>
  • Loading branch information
dawagner committed Feb 4, 2016
1 parent 507e080 commit ae6f63f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
9 changes: 6 additions & 3 deletions SetVersion.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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()
4 changes: 2 additions & 2 deletions support/windows/Resource.rc.in
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit ae6f63f

Please sign in to comment.