From 581da09f0c93d172cd07db2239c5458486c5c349 Mon Sep 17 00:00:00 2001 From: Martyn Gigg <martyn.gigg@stfc.ac.uk> Date: Tue, 10 May 2011 14:29:12 +0000 Subject: [PATCH] Refs #2897. Better fix for ignoring warnings from auto generated sipqtpart0.cpp file. It should fix the mac system test build as well. --- Code/Mantid/MantidPlot/CMakeLists.txt | 6 +++-- .../src/{sipqti.cpp => sipqti.cpp.in} | 26 +++++++++---------- Code/Mantid/MantidPlot/src/sipqti.cpp.rule | 1 - 3 files changed, 17 insertions(+), 16 deletions(-) rename Code/Mantid/MantidPlot/src/{sipqti.cpp => sipqti.cpp.in} (97%) delete mode 100644 Code/Mantid/MantidPlot/src/sipqti.cpp.rule diff --git a/Code/Mantid/MantidPlot/CMakeLists.txt b/Code/Mantid/MantidPlot/CMakeLists.txt index 1760e709801..5315185c5b2 100644 --- a/Code/Mantid/MantidPlot/CMakeLists.txt +++ b/Code/Mantid/MantidPlot/CMakeLists.txt @@ -421,7 +421,8 @@ find_package ( SIP REQUIRED ) separate_arguments ( PYQT4_SIP_FLAGS ) set ( SIP_SPEC ${CMAKE_CURRENT_SOURCE_DIR}/src/qti.sip ) -set ( SIP_SRC ${CMAKE_CURRENT_SOURCE_DIR}/src/sipqti.cpp ) +set ( SIP_SRC_IN ${CMAKE_CURRENT_SOURCE_DIR}/src/sipqti.cpp.in ) +set ( SIP_SRC ${CMAKE_CURRENT_BINARY_DIR}/sipqti.cpp ) set ( SIP_SRC_AUTO sipqtipart0.cpp ) @@ -487,8 +488,9 @@ add_custom_command ( OUTPUT ${SIP_SRC_AUTO} ) add_custom_command ( OUTPUT ${SIP_SRC} - COMMAND ${CMAKE_COMMAND} ARGS -E echo_append "" + COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${SIP_SRC_IN} ${SIP_SRC} DEPENDS ${SIP_SRC_AUTO} + COMMENT "Generating sip wrapper" ) # Needed for sip.h header that can end up in a different place to to the main Python include directory diff --git a/Code/Mantid/MantidPlot/src/sipqti.cpp b/Code/Mantid/MantidPlot/src/sipqti.cpp.in similarity index 97% rename from Code/Mantid/MantidPlot/src/sipqti.cpp rename to Code/Mantid/MantidPlot/src/sipqti.cpp.in index c70081dcd7d..865b2afdf0c 100644 --- a/Code/Mantid/MantidPlot/src/sipqti.cpp +++ b/Code/Mantid/MantidPlot/src/sipqti.cpp.in @@ -1,13 +1,13 @@ -//------------------------------------------------------------------------------ -// A wrapper for the auto-generated sipqtipart?.cpp files to disable warnings -// that we can't control -//------------------------------------------------------------------------------ -#ifdef __GNUC__ - #pragma GCC diagnostic ignored "-Wuninitialized" - #pragma GCC diagnostic ignored "-Wconversion" - #pragma GCC diagnostic ignored "-Wunused-variable" - #pragma GCC diagnostic ignored "-Wparentheses" - #pragma GCC diagnostic ignored "-Wcast-qual" -#endif - -#include "sipqtipart0.cpp" +//------------------------------------------------------------------------------ +// A wrapper for the auto-generated sipqtipart?.cpp files to disable warnings +// that we can't control +//------------------------------------------------------------------------------ +#ifdef __GNUC__ + #pragma GCC diagnostic ignored "-Wuninitialized" + #pragma GCC diagnostic ignored "-Wconversion" + #pragma GCC diagnostic ignored "-Wunused-variable" + #pragma GCC diagnostic ignored "-Wparentheses" + #pragma GCC diagnostic ignored "-Wcast-qual" +#endif + +#include "sipqtipart0.cpp" diff --git a/Code/Mantid/MantidPlot/src/sipqti.cpp.rule b/Code/Mantid/MantidPlot/src/sipqti.cpp.rule deleted file mode 100644 index c0c8cf055b2..00000000000 --- a/Code/Mantid/MantidPlot/src/sipqti.cpp.rule +++ /dev/null @@ -1 +0,0 @@ -# Fools Visual Studio into thinking it has generated the wrapper sipqti.cpp file which we need kill some compiler warnings from auto-generated code. \ No newline at end of file -- GitLab