Cocoa, Win32: embed version info into distributable application.

This shows up in crash dumps, etc, and helps track them back to
a git commit.
pull/10/head
whitequark 2016-06-02 02:18:29 +00:00
parent 66746d151f
commit 14cbd0bbee
4 changed files with 42 additions and 2 deletions

View File

@ -73,6 +73,10 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL GNU OR CMAKE_CXX_COMPILER_ID STREQUAL Clang)
set(WARNING_FLAGS "${WARNING_FLAGS} -Werror=switch") set(WARNING_FLAGS "${WARNING_FLAGS} -Werror=switch")
endif() endif()
if(WIN32)
set(CMAKE_RC_FLAGS "${CMAKE_RC_FLAGS} -l0")
endif()
if(MINGW) if(MINGW)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -static-libgcc") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -static-libgcc")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-libgcc -static-libstdc++") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-libgcc -static-libstdc++")

View File

@ -13,11 +13,11 @@
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>APPL</string> <string>APPL</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>${solvespace_VERSION_MAJOR}.${solvespace_VERSION_MINOR}</string> <string>${solvespace_VERSION_MAJOR}.${solvespace_VERSION_MINOR}~${solvespace_GIT_HASH}</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>${solvespace_VERSION_MAJOR}.${solvespace_VERSION_MINOR}</string> <string>${solvespace_VERSION_MAJOR}.${solvespace_VERSION_MINOR}</string>
<key>NSHumanReadableCopyright</key> <key>NSHumanReadableCopyright</key>
<string>© 2008-2015 Jonathan Westhues and other authors</string> <string>© 2008-2016 Jonathan Westhues and other authors</string>
<key>NSPrincipalClass</key> <key>NSPrincipalClass</key>
<string>NSApplication</string> <string>NSApplication</string>
<key>NSMainNibFile</key> <key>NSMainNibFile</key>

View File

@ -2,8 +2,12 @@
set(resource_root ${CMAKE_CURRENT_SOURCE_DIR}/) set(resource_root ${CMAKE_CURRENT_SOURCE_DIR}/)
set(resource_list) set(resource_list)
if(WIN32) if(WIN32)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/win32/versioninfo.rc.in
${CMAKE_CURRENT_BINARY_DIR}/win32/versioninfo.rc)
set(rc_file ${CMAKE_CURRENT_BINARY_DIR}/resources.rc) set(rc_file ${CMAKE_CURRENT_BINARY_DIR}/resources.rc)
file(WRITE ${rc_file} "// Autogenerated; do not edit\n#include<windows.h>\n") file(WRITE ${rc_file} "// Autogenerated; do not edit\n#include<windows.h>\n")
file(WRITE ${rc_file} "#include \"${CMAKE_CURRENT_BINARY_DIR}/win32/versioninfo.rc\"\n")
function(add_resource name) function(add_resource name)
set(source ${CMAKE_CURRENT_SOURCE_DIR}/${name}) set(source ${CMAKE_CURRENT_SOURCE_DIR}/${name})

View File

@ -0,0 +1,32 @@
#define VOS_NT_WINDOWS32 0x00040004L
#define VFT_APP 0x00000001L
1 VERSIONINFO
FILEVERSION ${solvespace_VERSION_MAJOR},${solvespace_VERSION_MINOR},0,0
PRODUCTVERSION ${solvespace_VERSION_MAJOR},${solvespace_VERSION_MINOR},0,0
FILEFLAGSMASK 0
FILEFLAGS 0
FILEOS VOS_NT_WINDOWS32
FILETYPE VFT_APP
FILESUBTYPE 0
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "04090000"
BEGIN
VALUE "CompanyName", "The SolveSpace authors"
VALUE "ProductName", "SolveSpace"
VALUE "ProductVersion", "${solvespace_VERSION_MAJOR}.${solvespace_VERSION_MINOR}~${solvespace_GIT_HASH}"
VALUE "FileDescription", "SolveSpace, a parametric 2d/3d CAD"
VALUE "FileVersion", "${solvespace_VERSION_MAJOR}.${solvespace_VERSION_MINOR}~${solvespace_GIT_HASH}"
VALUE "OriginalFilename", "solvespace.exe"
VALUE "InternalName", "solvespace"
VALUE "LegalCopyright", "(c) 2008-2016 Jonathan Westhues and other authors"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 0
END
END