Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add VERSIONINFO resource for windows #4912

Merged
merged 1 commit into from
Nov 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
- Dev: Changed lifetime of context menus. (#4924)
- 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: `Details` file properties tab is now populated on Windows. (#4912)

## 2.4.6

Expand Down
6 changes: 5 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@ if(BUILD_BENCHMARKS)
list(APPEND VCPKG_MANIFEST_FEATURES "benchmarks")
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)
include(CheckIPOSupported)
Expand Down
12 changes: 10 additions & 2 deletions cmake/resources/generate_resources.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ set(
qt.conf
resources.qrc
resources_autogenerated.qrc
windows.rc
themes/ChatterinoTheme.schema.json
)
set(RES_IMAGE_EXCLUDE_FILTER ^linuxinstall/)
Expand Down Expand Up @@ -78,7 +77,16 @@ endforeach ()
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)

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_BINARY_DIR}/autogen/ResourcesAutogen.cpp"
"${CMAKE_BINARY_DIR}/autogen/ResourcesAutogen.hpp"
Expand Down
34 changes: 34 additions & 0 deletions cmake/resources/windows.rc.in
Original file line number Diff line number Diff line change
@@ -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
1 change: 0 additions & 1 deletion resources/windows.rc

This file was deleted.

8 changes: 1 addition & 7 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -646,13 +646,7 @@ set(SOURCE_FILES
${CMAKE_SOURCE_DIR}/resources/resources.qrc
)

if (WIN32)
# 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)
if (APPLE)
set(MACOS_BUNDLE_ICON_FILE "${CMAKE_SOURCE_DIR}/resources/chatterino.icns")
list(APPEND SOURCE_FILES "${MACOS_BUNDLE_ICON_FILE}")
set_source_files_properties(${MACOS_BUNDLE_ICON_FILE} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources")
Expand Down
Loading