From 7693541acf445d79c121f830d3658a7a7be6d704 Mon Sep 17 00:00:00 2001
From: Martyn Gigg <martyn.gigg@stfc.ac.uk>
Date: Tue, 12 Apr 2011 07:53:16 +0000
Subject: [PATCH] Refs #2800. Ensure that the Windows executable has an icon
 embedded within it.

---
 Code/Mantid/MantidPlot/CMakeLists.txt                       | 6 ++++--
 .../MantidPlot/icons/{qtiplot.rc => MantidPlotDesktop.rc}   | 0
 Code/Mantid/MantidPlot/qtiplot.pro                          | 2 +-
 3 files changed, 5 insertions(+), 3 deletions(-)
 rename Code/Mantid/MantidPlot/icons/{qtiplot.rc => MantidPlotDesktop.rc} (100%)

diff --git a/Code/Mantid/MantidPlot/CMakeLists.txt b/Code/Mantid/MantidPlot/CMakeLists.txt
index 7136f47fbf3..37b314d16d0 100644
--- a/Code/Mantid/MantidPlot/CMakeLists.txt
+++ b/Code/Mantid/MantidPlot/CMakeLists.txt
@@ -639,7 +639,7 @@ qt4_wrap_cpp ( MOCCED_FILES ${QTIPLOT_MOC_FILES} ${MANTID_MOC_FILES} )
 qt4_wrap_ui ( UI_HDRS ${UI_FILES} )
 # The generated ui headers will go here:
 include_directories ( ${CMAKE_CURRENT_BINARY_DIR} )
-
+# Internal icon links
 qt4_add_resources ( RES_FILES ${PROJECT_SOURCE_DIR}/Images/images.qrc )
 
 ###########################################################################
@@ -695,7 +695,9 @@ set ( INC_FILES ${QTIPLOT_HDRS} ${MANTID_HDRS} )
 # modes. On VS2010 this requires the WIN32 argument and the additional 
 # linker arguments as we don't use WinMain as an entry point.
 if( WIN32 )
-   set( EXE_FLAG WIN32 )
+   set ( EXE_FLAG WIN32 )
+   # Also include the icon's rc file so that it is embedded in the exe
+   set ( MANTID_SRCS "${MANTID_SRCS} icons/MantidPlotDesktop.rc" )
 endif( WIN32 )
 
 add_executable ( MantidPlot ${EXE_FLAG} ${SRC_FILES} ${INC_FILES} 
diff --git a/Code/Mantid/MantidPlot/icons/qtiplot.rc b/Code/Mantid/MantidPlot/icons/MantidPlotDesktop.rc
similarity index 100%
rename from Code/Mantid/MantidPlot/icons/qtiplot.rc
rename to Code/Mantid/MantidPlot/icons/MantidPlotDesktop.rc
diff --git a/Code/Mantid/MantidPlot/qtiplot.pro b/Code/Mantid/MantidPlot/qtiplot.pro
index 756eeadcb2f..838fa3fddec 100644
--- a/Code/Mantid/MantidPlot/qtiplot.pro
+++ b/Code/Mantid/MantidPlot/qtiplot.pro
@@ -309,7 +309,7 @@ CONFIG(debug, debug|release) {
 
 ###################### ICONS ################################################
 
-win32:RC_FILE = icons/qtiplot.rc
+win32:RC_FILE = icons/MantidPlotDesktop.rc
 mac:RC_FILE   = icons/qtiplot.icns
 
 ###################### TRANSLATIONS #########################################
-- 
GitLab