From ca937761f5e6cd915201d0691f6383fe52316c58 Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Tue, 27 Mar 2012 12:30:19 +0000 Subject: [PATCH] Add a resource file to vncviewer.exe so we can get an icon. git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4876 3789f03b-4d11-0410-bbf8-ca57d06f2519 --- vncviewer/CMakeLists.txt | 12 +++++- vncviewer/resource.h | 7 ++++ vncviewer/vncviewer.rc.in | 82 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 99 insertions(+), 2 deletions(-) create mode 100644 vncviewer/resource.h create mode 100644 vncviewer/vncviewer.rc.in diff --git a/vncviewer/CMakeLists.txt b/vncviewer/CMakeLists.txt index dbd2d026..f6b6d0be 100644 --- a/vncviewer/CMakeLists.txt +++ b/vncviewer/CMakeLists.txt @@ -16,10 +16,18 @@ set(VNCVIEWER_SOURCES vncviewer.cxx) if(WIN32) - set(VNCVIEWER_SOURCES ${VNCVIEWER_SOURCES} win32.c) + # Since vncviewer.rc is generated, local includes will be looking + # in the wrong directory. We need to help it out. + include_directories(${CMAKE_CURRENT_SOURCE_DIR}) + configure_file(vncviewer.rc.in vncviewer.rc) + set(VNCVIEWER_SOURCES + ${VNCVIEWER_SOURCES} + ${CMAKE_CURRENT_BINARY_DIR}/vncviewer.rc) endif() -if(APPLE) +if(WIN32) + set(VNCVIEWER_SOURCES ${VNCVIEWER_SOURCES} win32.c) +elseif(APPLE) set(VNCVIEWER_SOURCES ${VNCVIEWER_SOURCES} cocoa.mm) endif() diff --git a/vncviewer/resource.h b/vncviewer/resource.h new file mode 100644 index 00000000..e5998262 --- /dev/null +++ b/vncviewer/resource.h @@ -0,0 +1,7 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Developer Studio generated include file. +// Used by vncviewer.rc +// +#define IDR_MANIFEST 1 +#define IDI_ICON 101 + diff --git a/vncviewer/vncviewer.rc.in b/vncviewer/vncviewer.rc.in new file mode 100644 index 00000000..a538e4ba --- /dev/null +++ b/vncviewer/vncviewer.rc.in @@ -0,0 +1,82 @@ +//Microsoft Developer Studio generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "windows.h" + +///////////////////////////////////////////////////////////////////////////// +// English (U.K.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENG) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_UK +#pragma code_page(1252) +#endif //_WIN32 + +#ifndef _MAC +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +VS_VERSION_INFO VERSIONINFO + FILEVERSION @RCVERSION@ + PRODUCTVERSION @RCVERSION@ + FILEFLAGSMASK 0x3fL +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x40004L + FILETYPE 0x1L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "080904b0" + BEGIN + VALUE "Comments", "\0" + VALUE "CompanyName", "TigerVNC Project\0" + #ifdef WIN64 + VALUE "FileDescription", "TigerVNC Client for Win64\0" + VALUE "ProductName", "TigerVNC Client for Win64\0" + #else + VALUE "FileDescription", "TigerVNC Client for Win32\0" + VALUE "ProductName", "TigerVNC Client for Win32\0" + #endif + VALUE "FileVersion", "@RCVERSION@\0" + VALUE "InternalName", "vncviewer\0" + VALUE "LegalCopyright", "Copyright (C) 1999-2011 TigerVNC Team and many others (see README.txt)\0" + VALUE "LegalTrademarks", "TigerVNC\0" + VALUE "OriginalFilename", "vncviewer.exe\0" + VALUE "PrivateBuild", "\0" + VALUE "ProductVersion", "@VERSION@\0" + VALUE "SpecialBuild", "\0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x809, 1200 + END +END + +#endif // !_MAC + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +IDI_ICON ICON DISCARDABLE "@CMAKE_SOURCE_DIR@/media/tigervnc.ico" + +#endif // English (U.K.) resources +///////////////////////////////////////////////////////////////////////////// + -- 2.39.5