From 72dc660f75649f5f7f6c501318517b86bc4473e8 Mon Sep 17 00:00:00 2001 From: kornes <28986062+kornes@users.noreply.github.com> Date: Fri, 3 Nov 2023 16:31:48 +0100 Subject: [PATCH] feat: Add VERSIONINFO resource for windows --- CHANGELOG.md | 1 + CMakeLists.txt | 6 ++++- cmake/resources/generate_resources.cmake | 12 +++++++-- cmake/resources/windows.rc.in | 34 ++++++++++++++++++++++++ resources/windows.rc | 1 - src/CMakeLists.txt | 8 +----- 6 files changed, 51 insertions(+), 11 deletions(-) create mode 100644 cmake/resources/windows.rc.in delete mode 100644 resources/windows.rc diff --git a/CHANGELOG.md b/CHANGELOG.md index 4555e262795..5cfa3bee851 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/CMakeLists.txt b/CMakeLists.txt index 58ffbffb383..7e74581b692 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) diff --git a/cmake/resources/generate_resources.cmake b/cmake/resources/generate_resources.cmake index d9ceccad26c..e6c8c8d816e 100644 --- a/cmake/resources/generate_resources.cmake +++ b/cmake/resources/generate_resources.cmake @@ -6,7 +6,6 @@ set( qt.conf resources.qrc resources_autogenerated.qrc - windows.rc themes/ChatterinoTheme.schema.json ) set(RES_IMAGE_EXCLUDE_FILTER ^linuxinstall/) @@ -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" diff --git a/cmake/resources/windows.rc.in b/cmake/resources/windows.rc.in new file mode 100644 index 00000000000..a43cb8810e2 --- /dev/null +++ b/cmake/resources/windows.rc.in @@ -0,0 +1,34 @@ +#include + +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 \ No newline at end of file diff --git a/resources/windows.rc b/resources/windows.rc deleted file mode 100644 index 8f9d9ca03e6..00000000000 --- a/resources/windows.rc +++ /dev/null @@ -1 +0,0 @@ -IDI_ICON1 ICON DISCARDABLE "icon.ico" diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 6ed4bf4c7e6..a4586c50e7f 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -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")