feat: Add VERSIONINFO resource for windows (#4912)

This commit is contained in:
kornes 2023-11-03 17:19:50 +00:00 committed by GitHub
parent 8f99af5b7e
commit b3ed3285ee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 51 additions and 11 deletions

View file

@ -49,6 +49,7 @@
- Dev: Changed lifetime of context menus. (#4924) - Dev: Changed lifetime of context menus. (#4924)
- Dev: Refactor `ChannelView`, removing a bunch of clang-tidy warnings. (#4926) - Dev: Refactor `ChannelView`, removing a bunch of clang-tidy warnings. (#4926)
- Dev: Refactor `IrcMessageHandler`, removing a bunch of clang-tidy warnings & changing its public API. (#4927) - Dev: Refactor `IrcMessageHandler`, removing a bunch of clang-tidy warnings & changing its public API. (#4927)
- Dev: `Details` file properties tab is now populated on Windows. (#4912)
## 2.4.6 ## 2.4.6

View file

@ -36,7 +36,11 @@ if(BUILD_BENCHMARKS)
list(APPEND VCPKG_MANIFEST_FEATURES "benchmarks") list(APPEND VCPKG_MANIFEST_FEATURES "benchmarks")
endif() endif()
project(chatterino VERSION 2.4.6) project(chatterino
VERSION 2.4.6
DESCRIPTION "Chat client for twitch.tv"
HOMEPAGE_URL "https://chatterino.com/"
)
if(CHATTERINO_LTO) if(CHATTERINO_LTO)
include(CheckIPOSupported) include(CheckIPOSupported)

View file

@ -6,7 +6,6 @@ set(
qt.conf qt.conf
resources.qrc resources.qrc
resources_autogenerated.qrc resources_autogenerated.qrc
windows.rc
themes/ChatterinoTheme.schema.json themes/ChatterinoTheme.schema.json
) )
set(RES_IMAGE_EXCLUDE_FILTER ^linuxinstall/) set(RES_IMAGE_EXCLUDE_FILTER ^linuxinstall/)
@ -78,7 +77,16 @@ endforeach ()
list(JOIN RES_HEADER_CONTENT "\n" RES_HEADER_CONTENT) list(JOIN RES_HEADER_CONTENT "\n" RES_HEADER_CONTENT)
configure_file(${CMAKE_CURRENT_LIST_DIR}/ResourcesAutogen.hpp.in ${CMAKE_BINARY_DIR}/autogen/ResourcesAutogen.hpp @ONLY) configure_file(${CMAKE_CURRENT_LIST_DIR}/ResourcesAutogen.hpp.in ${CMAKE_BINARY_DIR}/autogen/ResourcesAutogen.hpp @ONLY)
set(RES_AUTOGEN_FILES if (WIN32)
if (NOT PROJECT_VERSION_TWEAK)
set(PROJECT_VERSION_TWEAK 0)
endif()
string(TIMESTAMP CURRENT_YEAR "%Y")
configure_file(${CMAKE_CURRENT_LIST_DIR}/windows.rc.in ${CMAKE_BINARY_DIR}/autogen/windows.rc @ONLY)
list(APPEND RES_AUTOGEN_FILES "${CMAKE_BINARY_DIR}/autogen/windows.rc")
endif ()
list(APPEND RES_AUTOGEN_FILES
"${CMAKE_SOURCE_DIR}/resources/resources_autogenerated.qrc" "${CMAKE_SOURCE_DIR}/resources/resources_autogenerated.qrc"
"${CMAKE_BINARY_DIR}/autogen/ResourcesAutogen.cpp" "${CMAKE_BINARY_DIR}/autogen/ResourcesAutogen.cpp"
"${CMAKE_BINARY_DIR}/autogen/ResourcesAutogen.hpp" "${CMAKE_BINARY_DIR}/autogen/ResourcesAutogen.hpp"

View file

@ -0,0 +1,34 @@
#include <winver.h>
IDI_ICON1 ICON "@RES_DIR@/icon.ico"
VS_VERSION_INFO VERSIONINFO
FILEVERSION @PROJECT_VERSION_MAJOR@,@PROJECT_VERSION_MINOR@,@PROJECT_VERSION_PATCH@,@PROJECT_VERSION_TWEAK@
PRODUCTVERSION @PROJECT_VERSION_MAJOR@,@PROJECT_VERSION_MINOR@,@PROJECT_VERSION_PATCH@,@PROJECT_VERSION_TWEAK@
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
FILEFLAGS VS_FF_SPECIALBUILD
FILEOS VOS__WINDOWS32
FILETYPE VFT_APP
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "ProductName", "Chatterino"
VALUE "ProductVersion", "@PROJECT_VERSION@"
VALUE "CompanyName", "Chatterino, @PROJECT_HOMEPAGE_URL@"
VALUE "FileDescription", "Chatterino"
VALUE "FileVersion", "@PROJECT_VERSION@"
VALUE "SpecialBuild", "@GIT_COMMIT@"
VALUE "InternalName", "Chatterino"
VALUE "OriginalFilename", "Chatterino"
VALUE "LegalCopyright", "Project contributors 2016-@CURRENT_YEAR@"
VALUE "Licence", "MIT"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END

View file

@ -1 +0,0 @@
IDI_ICON1 ICON DISCARDABLE "icon.ico"

View file

@ -646,13 +646,7 @@ set(SOURCE_FILES
${CMAKE_SOURCE_DIR}/resources/resources.qrc ${CMAKE_SOURCE_DIR}/resources/resources.qrc
) )
if (WIN32) if (APPLE)
# clang-cl doesn't support resource files
if (NOT CMAKE_CXX_COMPILER_ID MATCHES "Clang")
list(APPEND SOURCE_FILES "${CMAKE_SOURCE_DIR}/resources/windows.rc")
endif ()
elseif (APPLE)
set(MACOS_BUNDLE_ICON_FILE "${CMAKE_SOURCE_DIR}/resources/chatterino.icns") set(MACOS_BUNDLE_ICON_FILE "${CMAKE_SOURCE_DIR}/resources/chatterino.icns")
list(APPEND SOURCE_FILES "${MACOS_BUNDLE_ICON_FILE}") list(APPEND SOURCE_FILES "${MACOS_BUNDLE_ICON_FILE}")
set_source_files_properties(${MACOS_BUNDLE_ICON_FILE} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources") set_source_files_properties(${MACOS_BUNDLE_ICON_FILE} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources")