summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Jenssen <tim.jenssen@qt.io>2023-02-28 18:13:26 +0100
committerTim Jenssen <tim.jenssen@qt.io>2023-02-28 17:25:16 +0000
commit31ab5f40ff748def1c3918169c27200a0edbf0fe (patch)
tree72af1ce66504decca8cf29308d535dcb19e8c502
parentffc775e535dcd74e2dfb66e4828f47e2dee6293a (diff)
downloadqt-creator-31ab5f40ff748def1c3918169c27200a0edbf0fe.tar.gz
qml2puppet: add application icon
Task-number: QDS-694 Change-Id: Id8f75d34d81645e9d4ceccff25e57afb658f8777 Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io> (cherry picked from commit b35f14752a471b3e51a5444061facd6abea36e70) Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
-rw-r--r--src/tools/qml2puppet/CMakeLists.txt28
-rw-r--r--src/tools/qml2puppet/windows_application_icon/qml2puppet.rc30
2 files changed, 56 insertions, 2 deletions
diff --git a/src/tools/qml2puppet/CMakeLists.txt b/src/tools/qml2puppet/CMakeLists.txt
index d26cf95969..2f5d0d8292 100644
--- a/src/tools/qml2puppet/CMakeLists.txt
+++ b/src/tools/qml2puppet/CMakeLists.txt
@@ -27,7 +27,7 @@ find_package(Qt5
)
if (NOT TARGET QmlPuppetCommunication)
-include(../../libs/qmlpuppetcommunication/QmlPuppetCommunication.cmake)
+ include(../../libs/qmlpuppetcommunication/QmlPuppetCommunication.cmake)
endif()
add_qtc_executable(qml2puppet
@@ -193,7 +193,7 @@ extend_qtc_executable(qml2puppet
qmlprivategate.cpp qmlprivategate.h
)
-if(DEFINED MULTILANGUAGE_SUPPORT_SUBDIRECTORY AND Qt6_VERSION VERSION_GREATER_EQUAL 6.2.1)
+if (DEFINED MULTILANGUAGE_SUPPORT_SUBDIRECTORY AND Qt6_VERSION VERSION_GREATER_EQUAL 6.2.1)
add_subdirectory(${MULTILANGUAGE_SUPPORT_SUBDIRECTORY} multilanguagesupport_static_build)
endif()
@@ -244,3 +244,27 @@ extend_qtc_executable(qml2puppet
ENABLE_CRASHPAD
DEPENDS Crashpad::Crashpad
)
+
+# add application icon
+if (TARGET qml2puppet)
+ if (WIN32)
+ set(RC_APPLICATION_NAME "${IDE_DISPLAY_NAME}")
+ set(RC_VERSION "${IDE_VERSION}.0")
+ set(RC_VERSION_STRING "${IDE_VERSION_DISPLAY}")
+ set(RC_COPYRIGHT "2008-${IDE_COPYRIGHT_YEAR} The Qt Company Ltd")
+
+ string(REPLACE " " "\\x20" RC_APPLICATION_NAME "${RC_APPLICATION_NAME}")
+ string(REPLACE " " "\\x20" RC_COPYRIGHT "${RC_COPYRIGHT}")
+ string(REPLACE "." "," RC_VERSION "${RC_VERSION}")
+
+ target_compile_definitions(qml2puppet PRIVATE
+ RC_APPLICATION_NAME=${RC_APPLICATION_NAME}
+ RC_VERSION=${RC_VERSION}
+ RC_VERSION_STRING=${RC_VERSION_STRING}
+ RC_COPYRIGHT=${RC_COPYRIGHT}
+ RC_ICON_PATH=${IDE_ICON_PATH}
+ )
+
+ target_sources(qml2puppet PRIVATE windows_application_icon/qml2puppet.rc)
+ endif()
+endif()
diff --git a/src/tools/qml2puppet/windows_application_icon/qml2puppet.rc b/src/tools/qml2puppet/windows_application_icon/qml2puppet.rc
new file mode 100644
index 0000000000..b2d07923e3
--- /dev/null
+++ b/src/tools/qml2puppet/windows_application_icon/qml2puppet.rc
@@ -0,0 +1,30 @@
+#include <windows.h>
+
+#define STRINGIFY1(x) #x
+#define STRINGIFY(x) STRINGIFY1(x)
+
+#define ICON_PATH STRINGIFY(RC_ICON_PATH/qtcreator.ico)
+
+IDI_ICON1 ICON DISCARDABLE ICON_PATH
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION RC_VERSION
+ PRODUCTVERSION RC_VERSION
+{
+ BLOCK "StringFileInfo"
+ {
+ // U.S. English - Windows, Multilingual
+ BLOCK "040904E4"
+ {
+ VALUE "FileDescription", STRINGIFY(RC_APPLICATION_NAME)
+ VALUE "FileVersion", STRINGIFY(RC_VERSION_STRING)
+ VALUE "ProductName", STRINGIFY(RC_APPLICATION_NAME)
+ VALUE "ProductVersion", STRINGIFY(RC_VERSION_STRING)
+ VALUE "LegalCopyright", STRINGIFY(RC_COPYRIGHT)
+ }
+ }
+ BLOCK "VarFileInfo"
+ {
+ VALUE "Translation", 0x409, 1252 // 1252 = 0x04E4
+ }
+}