From 781269f4a8cb6bf45d29c26287e0804482272122 Mon Sep 17 00:00:00 2001 From: Sebastian Pipping Date: Fri, 3 Nov 2023 21:46:38 +0100 Subject: [PATCH] win32|cmake: Fix FileVersion and ProductVersion in DLL version info Before: {'FileVersion': 'VER_FILEVERSION', 'ProductVersion': 'VER_FILEVERSION'} After: {'FileVersion': '2.5.0.0', 'ProductVersion': '2.5.0.0'} Thanks to @spookyahell for helpful gist "exe2version_info.py": https://gist.github.com/spookyahell/b317bdf0712aac5fd37dd79f70bfbe69 --- expat/CMakeLists.txt | 3 ++- expat/Makefile.am | 2 +- expat/win32/.gitignore | 1 + expat/win32/expat.iss | 2 +- expat/win32/{version.rc => version.rc.cmake} | 4 ++-- 5 files changed, 7 insertions(+), 5 deletions(-) rename expat/win32/{version.rc => version.rc.cmake} (69%) diff --git a/expat/CMakeLists.txt b/expat/CMakeLists.txt index ea32106b..325a4a72 100644 --- a/expat/CMakeLists.txt +++ b/expat/CMakeLists.txt @@ -403,7 +403,8 @@ if(EXPAT_SHARED_LIBS) # Add DLL version string(REPLACE "." "," _EXPAT_DLL_VERSION ${PROJECT_VERSION}.0) - set(_EXPAT_EXTRA_SOURCES ${_EXPAT_EXTRA_SOURCES} win32/version.rc) + configure_file("${CMAKE_CURRENT_SOURCE_DIR}/win32/version.rc.cmake" "${CMAKE_CURRENT_BINARY_DIR}/win32/version.rc") + set(_EXPAT_EXTRA_SOURCES ${_EXPAT_EXTRA_SOURCES} "${CMAKE_CURRENT_BINARY_DIR}/win32/version.rc") endif() else() set(_SHARED STATIC) diff --git a/expat/Makefile.am b/expat/Makefile.am index 37ae3738..b071fcfe 100644 --- a/expat/Makefile.am +++ b/expat/Makefile.am @@ -84,7 +84,7 @@ _EXTRA_DIST_WINDOWS = \ win32/expat.iss \ win32/MANIFEST.txt \ win32/README.txt \ - win32/version.rc + win32/version.rc.cmake EXTRA_DIST = \ $(_EXTRA_DIST_CMAKE) \ diff --git a/expat/win32/.gitignore b/expat/win32/.gitignore index e7546777..8c01fe20 100644 --- a/expat/win32/.gitignore +++ b/expat/win32/.gitignore @@ -8,3 +8,4 @@ expat.PR expat.PRI expat.PS expat.WK3 +version.rc diff --git a/expat/win32/expat.iss b/expat/win32/expat.iss index ce9f3bb6..4116aa5b 100644 --- a/expat/win32/expat.iss +++ b/expat/win32/expat.iss @@ -77,7 +77,7 @@ Flags: ignoreversion; Source: doc\*.css; DestDir: "{app}\Doc" Flags: ignoreversion; Source: doc\*.xml; DestDir: "{app}\Doc" Flags: ignoreversion; Source: win32\bin\Release\*.dll; DestDir: "{app}\Bin" Flags: ignoreversion; Source: win32\bin\Release\*.lib; DestDir: "{app}\Bin" -Flags: ignoreversion; Source: win32\version.rc; DestDir: "{app}\Source\win32" +Flags: ignoreversion; Source: win32\version.rc.cmake; DestDir: "{app}\Source\win32" Flags: ignoreversion; Source: win32\README.txt; DestDir: "{app}\Source" Flags: ignoreversion; Source: AUTHORS; DestDir: "{app}\Source" Flags: ignoreversion; Source: Changes; DestDir: "{app}\Source" diff --git a/expat/win32/version.rc b/expat/win32/version.rc.cmake similarity index 69% rename from expat/win32/version.rc rename to expat/win32/version.rc.cmake index 64a4dadf..4b883f37 100644 --- a/expat/win32/version.rc +++ b/expat/win32/version.rc.cmake @@ -6,8 +6,8 @@ BEGIN BEGIN BLOCK "040904E4" BEGIN - VALUE "FileVersion", "VER_FILEVERSION" - VALUE "ProductVersion", "VER_FILEVERSION" + VALUE "FileVersion", "${PROJECT_VERSION}.0" + VALUE "ProductVersion", "${PROJECT_VERSION}.0" END END BLOCK "VarFileInfo"