From d7bba3dc3587d74df5a69c233cb0111486f763fe Mon Sep 17 00:00:00 2001
From: Martyn Gigg <martyn.gigg@stfc.ac.uk>
Date: Wed, 16 Mar 2011 12:54:39 +0000
Subject: [PATCH] Refs #2615. A couple of minor fixes to get qmake to build
 with Python 2.7 and remove some sip warnings.

---
 Code/Mantid/MantidPlot/qtiplot.pro | 52 +++---------------------------
 Code/Mantid/MantidPlot/src/qti.sip |  6 ++--
 2 files changed, 8 insertions(+), 50 deletions(-)

diff --git a/Code/Mantid/MantidPlot/qtiplot.pro b/Code/Mantid/MantidPlot/qtiplot.pro
index 005037890bc..77fcb033de0 100644
--- a/Code/Mantid/MantidPlot/qtiplot.pro
+++ b/Code/Mantid/MantidPlot/qtiplot.pro
@@ -185,8 +185,11 @@ CONFIG(debug, debug|release) {
 
 ##################### Windows ###############################################
 win32 {
-  LIBPATH += C:/Python25/libs
- 
+  PYTHONPREFIX=$$system(python -c "\"import sys; print sys.prefix\"")
+  PYTHONLIBPATH=$$join(PYTHONPREFIX,,,\\libs)
+  message(Python lib path $${PYTHONLIBPATH})
+  
+  LIBPATH += $${PYTHONLIBPATH}
   CONFIG(build64)  {
     THIRD_PARTY = ../../Third_Party/lib/win64
     message(SETTING FOR x64)
@@ -816,51 +819,6 @@ contains(SCRIPTING_LANGS, Python) {
 
 ##################### SIP generated files #####################
 
-#  HEADERS += $${SIP_DIR}/sipqtiApplicationWindow.h\
-#             $${SIP_DIR}/sipqtiGraph.h\
-#             $${SIP_DIR}/sipqtiGraph3D.h\
-#             $${SIP_DIR}/sipqtiArrowMarker.h\
-#			 $${SIP_DIR}/sipqtiImageMarker.h\
-#			 $${SIP_DIR}/sipqtiLegendWidget.h\
-#			 $${SIP_DIR}/sipqtiGrid.h\
-#             $${SIP_DIR}/sipqtiMultiLayer.h\
-#             $${SIP_DIR}/sipqtiTable.h\
-#             $${SIP_DIR}/sipqtiMatrix.h\
-#             $${SIP_DIR}/sipqtiMdiSubWindow.h\
-#             $${SIP_DIR}/sipqtiNote.h\
-#             $${SIP_DIR}/sipqtiPythonScript.h\
-#             $${SIP_DIR}/sipqtiPythonScripting.h\
-#             $${SIP_DIR}/sipqtiFolder.h\
-#             $${SIP_DIR}/sipqtiQList.h\
-#             $${SIP_DIR}/sipqtiFit.h \
-#             $${SIP_DIR}/sipqtiExponentialFit.h \
-#             $${SIP_DIR}/sipqtiTwoExpFit.h \
-#             $${SIP_DIR}/sipqtiThreeExpFit.h \
-#             $${SIP_DIR}/sipqtiSigmoidalFit.h \
-#			 $${SIP_DIR}/sipqtiLogisticFit.h \
-#             $${SIP_DIR}/sipqtiGaussAmpFit.h \
-#             $${SIP_DIR}/sipqtiLorentzFit.h \
-#             $${SIP_DIR}/sipqtiNonLinearFit.h \
-#             $${SIP_DIR}/sipqtiPluginFit.h \
-#             $${SIP_DIR}/sipqtiMultiPeakFit.h \
-#             $${SIP_DIR}/sipqtiPolynomialFit.h \
-#             $${SIP_DIR}/sipqtiLinearFit.h \
-#             $${SIP_DIR}/sipqtiGaussFit.h \
-#             $${SIP_DIR}/sipqtiFilter.h \
-#             $${SIP_DIR}/sipqtiDifferentiation.h \
-#             $${SIP_DIR}/sipqtiIntegration.h \
-#			 $${SIP_DIR}/sipqtiInterpolation.h \
-#			 $${SIP_DIR}/sipqtiSmoothFilter.h \
-#			 $${SIP_DIR}/sipqtiFFTFilter.h \
-#			 $${SIP_DIR}/sipqtiFFT.h \
-#			 $${SIP_DIR}/sipqtiCorrelation.h \
-#			 $${SIP_DIR}/sipqtiConvolution.h \
-#			 $${SIP_DIR}/sipqtiDeconvolution.h \
-#             $${SIP_DIR}/sipqtiMantidMatrix.h\
-#             $${SIP_DIR}/sipqtiMantidUI.h\
-#             $${SIP_DIR}/sipqtiInstrumentWindow.h
-
-
   SOURCES += $${SIP_DIR}/sipqticmodule.cpp\
              $${SIP_DIR}/sipqtiApplicationWindow.cpp\
              $${SIP_DIR}/sipqtiGraph.cpp\
diff --git a/Code/Mantid/MantidPlot/src/qti.sip b/Code/Mantid/MantidPlot/src/qti.sip
index bf668ecd555..ee9b05d0a31 100644
--- a/Code/Mantid/MantidPlot/src/qti.sip
+++ b/Code/Mantid/MantidPlot/src/qti.sip
@@ -29,7 +29,7 @@
  *                                                                         *
  ***************************************************************************/
 
-%Module qti 0
+%Module(name=qti, version=0)
 %Import QtCore/QtCoremod.sip
 %Import QtGui/QtGuimod.sip
 
@@ -572,7 +572,7 @@ public:
   void removeTitle();
 
   LegendWidget* newLegend(const QString& = QString());
-  void setLegend(const QString&) /NoDerived/;
+  void setLegend(const QString&);
 %MethodCode
   sipCpp->legend()->setText(*a0);
 %End
@@ -875,7 +875,7 @@ public:
   MDIWindowList windowsList() /PyName=windows/;
 
   // folders
-  Folder *activeFolder() /NoDerived/;
+  Folder *activeFolder();
 %MethodCode
   sipRes = sipCpp->current_folder;
 %End
-- 
GitLab