diff --git a/SetVersion.cmake b/SetVersion.cmake index dd92a20cb..3adeec140 100644 --- a/SetVersion.cmake +++ b/SetVersion.cmake @@ -27,12 +27,12 @@ # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # Fallback values: -set(PF_VERSION_MAJOR 0 CACHE INTERNAL "Parameter Framework's version major number") -set(PF_VERSION_MINOR 0 CACHE INTERNAL "Parameter Framework's version minor number") -set(PF_VERSION_PATCH 0 CACHE INTERNAL "Parameter Framework's version patch number") -set(PF_VERSION_TWEAK 0 CACHE INTERNAL "Parameter Framework's version tweak (or build) number") -set(PF_VERSION_SHA1 "g0000000000" CACHE INTERNAL "Parameter Framework's sources git SHA1") -set(PF_VERSION_DIRTY "" CACHE INTERNAL "Parameter Framework's sources dirty marker") +set(PF_VERSION_MAJOR 0) +set(PF_VERSION_MINOR 0) +set(PF_VERSION_PATCH 0) +set(PF_VERSION_TWEAK 0) +set(PF_VERSION_SHA1 "g0000000000") +set(PF_VERSION_DIRTY "") # Find and set the Parameter Framework's version # First, let's see if the user forced a version (i.e. "vX.Y.Z-N") @@ -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}" CACHE INTERNAL "") -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"