mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2025-12-10 04:36:43 +00:00
GODT-1803: Added resource file with icon in Windows build.
GODT-1803: RC info is now automatically generated.
This commit is contained in:
1
internal/frontend/.gitignore
vendored
1
internal/frontend/.gitignore
vendored
@ -11,3 +11,4 @@ rcc_cgo_*.go
|
||||
|
||||
# Generated file
|
||||
bridge-gui/bridge-gui/Version.h
|
||||
bridge-gui/bridge-gui/Resources.rc
|
||||
|
||||
@ -119,6 +119,18 @@ add_executable(bridge-gui
|
||||
${DOCK_ICON_SRC_FILE} DockIcon/DockIcon.h
|
||||
)
|
||||
|
||||
if (WIN32) # on Windows, we add a (non-Qt) resource file that contains the application icon and version information.
|
||||
string(TIMESTAMP BRIDGE_BUILD_YEAR "%Y")
|
||||
set(REGEX_NUMBER "[0123456789]") # CMake matches does not support \d.
|
||||
if (${BRIDGE_APP_VERSION} MATCHES "^(${REGEX_NUMBER}+)\\.(${REGEX_NUMBER}+)\\.(${REGEX_NUMBER}+)")
|
||||
set(BRIDGE_APP_VERSION_COMMA "${CMAKE_MATCH_1},${CMAKE_MATCH_2},${CMAKE_MATCH_3},0")
|
||||
else()
|
||||
message(FATAL_ERROR "Could not extract comma-separated version number from ${BRIDGE_APP_VERSION}")
|
||||
endif()
|
||||
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/Resources.rc.in" "${CMAKE_CURRENT_SOURCE_DIR}/Resources.rc")
|
||||
target_sources(bridge-gui PRIVATE Resources.rc)
|
||||
endif()
|
||||
|
||||
target_precompile_headers(bridge-gui PRIVATE Pch.h)
|
||||
target_include_directories(bridge-gui PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
target_link_libraries(bridge-gui
|
||||
|
||||
26
internal/frontend/bridge-gui/bridge-gui/Resources.rc.in
Normal file
26
internal/frontend/bridge-gui/bridge-gui/Resources.rc.in
Normal file
@ -0,0 +1,26 @@
|
||||
IDI_ICON1 ICON DISCARDABLE "${BRIDGE_REPO_ROOT}/dist/bridge.ico"
|
||||
|
||||
1 VERSIONINFO
|
||||
FILEVERSION ${BRIDGE_APP_VERSION_COMMA}
|
||||
PRODUCTVERSION ${BRIDGE_APP_VERSION_COMMA}
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "040904b0"
|
||||
BEGIN
|
||||
VALUE "Comments", "The Bridge is an application that runs on your computer in the background and seamlessly encrypts and decrypts your mail as it enters and leaves your computer."
|
||||
VALUE "CompanyName", "${BRIDGE_VENDOR}"
|
||||
VALUE "FileDescription", "${BRIDGE_APP_FULL_NAME}"
|
||||
VALUE "FileVersion", "${BRIDGE_APP_VERSION_COMMA}"
|
||||
VALUE "InternalName", "${PROJECT_NAME}.exe"
|
||||
VALUE "LegalCopyright", "(C) ${BRIDGE_BUILD_YEAR} ${BRIDGE_VENDOR}"
|
||||
VALUE "OriginalFilename", "${PROJECT_NAME}.exe"
|
||||
VALUE "ProductName", "${BRIDGE_APP_FULL_NAME} for Windows"
|
||||
VALUE "ProductVersion", "${BRIDGE_APP_VERSION}"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x0409, 0x04B0
|
||||
END
|
||||
END
|
||||
Reference in New Issue
Block a user