Improved win32 file version information
authorsapier <Sapier at GMX dot net>
Sun, 2 Mar 2014 22:49:19 +0000 (23:49 +0100)
committersapier <Sapier at GMX dot net>
Sun, 2 Mar 2014 22:49:19 +0000 (23:49 +0100)
CMakeLists.txt
misc/winresource.rc
src/CMakeLists.txt
src/cmake_config.h.in
src/config.h

index 8883896e7a6305902efae955050e80a09753760c..aae3a5932248eab2ac5a2fa753224029558bd69b 100644 (file)
@@ -13,6 +13,8 @@ set(VERSION_EXTRA "" CACHE STRING "Stuff to append to version string")
 set(VERSION_MAJOR 0)
 set(VERSION_MINOR 4)
 set(VERSION_PATCH 9)
+set(VERSION_PATCH_ORIG ${VERSION_PATCH})
+
 if(VERSION_EXTRA)
        set(VERSION_PATCH ${VERSION_PATCH}-${VERSION_EXTRA})
 else()
index 8913ff57204c99f3201474fb3f544fd8174bc694..ecb314c12b6ce1e1ecc28d46d4a870a99eda753b 100644 (file)
@@ -1,5 +1,57 @@
 #include <windows.h>\r
 #include <commctrl.h>\r
 #include <richedit.h>\r
+#define USE_CMAKE_CONFIG_H\r
+#include "config.h"\r
+#undef USE_CMAKE_CONFIG_H\r
+\r
+#if RUN_IN_PLACE == 1\r
+       #define BUILDMODE "RUN_IN_PLACE=1\0"\r
+#else\r
+       #define BUILDMODE "RUN_IN_PLACE=0\0"\r
+#endif\r
+\r
 LANGUAGE 0, SUBLANG_NEUTRAL\r
 130        ICON         "minetest-icon.ico"\r
+\r
+/////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Version\r
+//\r
+\r
+1 VERSIONINFO\r
+ FILEVERSION VERSION_MAJOR,VERSION_MINOR,VERSION_PATCH_ORIG,0\r
+ PRODUCTVERSION VERSION_MAJOR,VERSION_MINOR,VERSION_PATCH_ORIG,0\r
+ FILEFLAGSMASK 0x3fL\r
+#ifndef NDEBUG\r
+ FILEFLAGS 0x1L\r
+#else\r
+ FILEFLAGS 0x0L\r
+#endif\r
+ FILEOS VOS_NT_WINDOWS32\r
+ FILETYPE VFT_APP\r
+ FILESUBTYPE 0x0L\r
+BEGIN\r
+    BLOCK "StringFileInfo"\r
+    BEGIN\r
+        BLOCK "040904b0"\r
+    BEGIN\r
+        VALUE "Comments", "\0"\r
+        VALUE "CompanyName", "Minetest Community\0"\r
+        VALUE "FileDescription", "Minetest engine core main application\0"\r
+        VALUE "FileVersion", VERSION_STRING\r
+        VALUE "InternalName", "Minetest engine\0"\r
+        VALUE "LegalCopyright", "(c) 2014 celeron55\0"\r
+        VALUE "LegalTrademarks", """Minetest"" is property of Minetest community, don't use the name for your application without permission!\0"\r
+        VALUE "OriginalFilename", "minetest.exe\0"\r
+        VALUE "PrivateBuild", VERSION_EXTRA_STRING\r
+        VALUE "ProductName", "Minetest\0"\r
+        VALUE "ProductVersion", PRODUCT_VERSION_STRING\r
+        VALUE "SpecialBuild", BUILDMODE\r
+    END\r
+END\r
+BLOCK "VarFileInfo"\r
+BEGIN\r
+    VALUE "Translation", 0x409, 1200\r
+END\r
+END\r
index a5cad8fc11bb70d13689d1006b14076b53921b65..562306e101c83f0d6f61575b54f8615daafec7fe 100644 (file)
@@ -385,7 +385,7 @@ set(common_SRCS
        ${UTIL_SRCS}
 )
 
-# This gives us the icon
+# This gives us the icon and file version information
 if(WIN32)
        set(WINRESOURCE_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../misc/winresource.rc)
        if(MINGW)
@@ -396,7 +396,8 @@ if(WIN32)
                        COMMAND ${CMAKE_RC_COMPILER} -I${CMAKE_CURRENT_SOURCE_DIR}
                        -i${WINRESOURCE_FILE}
                        -o ${CMAKE_CURRENT_BINARY_DIR}/winresource_rc.o
-                       WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
+                       WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+                       DEPENDS ${WINRESOURCE_FILE})
                SET(common_SRCS ${common_SRCS} ${CMAKE_CURRENT_BINARY_DIR}/winresource_rc.o)
        else(MINGW) # Probably MSVC
                set(common_SRCS ${common_SRCS} ${WINRESOURCE_FILE})
index 75e448f79b0c414fe634c50fe1b774a061cef290..17d3c2249d51c84bae71a0575192b52dae19c4b2 100644 (file)
@@ -5,6 +5,7 @@
 
 #define CMAKE_PROJECT_NAME "@PROJECT_NAME@"
 #define CMAKE_VERSION_STRING "@VERSION_STRING@"
+#define CMAKE_PRODUCT_VERSION_STRING "@VERSION_MAJOR@.@VERSION_MINOR@"
 #define CMAKE_RUN_IN_PLACE @RUN_IN_PLACE@
 #define CMAKE_USE_GETTEXT @USE_GETTEXT@
 #define CMAKE_USE_CURL @USE_CURL@
 #define CMAKE_STATIC_SHAREDIR "@SHAREDIR@"
 #define CMAKE_USE_LEVELDB @USE_LEVELDB@
 #define CMAKE_USE_LUAJIT @USE_LUAJIT@
+#define CMAKE_VERSION_MAJOR @VERSION_MAJOR@
+#define CMAKE_VERSION_MINOR @VERSION_MINOR@
+#define CMAKE_VERSION_PATCH @VERSION_PATCH@
+#define CMAKE_VERSION_PATCH_ORIG @VERSION_PATCH_ORIG@
+#define CMAKE_VERSION_EXTRA_STRING "@VERSION_EXTRA@"
 
 #ifdef NDEBUG
        #define CMAKE_BUILD_TYPE "Release"
index 1c0aac4f2d5f4652843fb563ec4a0cb54dc2d5db..55bbb5beecd2420a3280202050af36778a1e9ffa 100644 (file)
        #define USE_LEVELDB CMAKE_USE_LEVELDB
        #undef USE_LUAJIT
        #define USE_LUAJIT CMAKE_USE_LUAJIT
+       #undef VERSION_MAJOR
+       #define VERSION_MAJOR CMAKE_VERSION_MAJOR
+       #undef VERSION_MINOR
+       #define VERSION_MINOR CMAKE_VERSION_MINOR
+       #undef VERSION_PATCH
+       #define VERSION_PATCH CMAKE_VERSION_PATCH
+       #undef VERSION_PATCH_ORIG
+       #define VERSION_PATCH_ORIG CMAKE_VERSION_PATCH_ORIG
+       #undef VERSION_STRING
+       #define VERSION_STRING CMAKE_VERSION_STRING
+       #undef PRODUCT_VERSION_STRING
+       #define PRODUCT_VERSION_STRING CMAKE_PRODUCT_VERSION_STRING
+       #undef VERSION_EXTRA_STRING
+       #define VERSION_EXTRA_STRING CMAKE_VERSION_EXTRA_STRING
 #endif
 
 #endif