diff --git a/Code/Mantid/MantidPlot/CMakeLists.txt b/Code/Mantid/MantidPlot/CMakeLists.txt index 82652c782b0b4f40713c1db9c432685a666cb687..0e0a0e08725bd4f6bdf2a1c39b570323e356111d 100644 --- a/Code/Mantid/MantidPlot/CMakeLists.txt +++ b/Code/Mantid/MantidPlot/CMakeLists.txt @@ -143,7 +143,7 @@ set ( MANTID_SRCS src/Mantid/AbstractMantidLog.cpp src/Mantid/AlgMonitor.cpp src/Mantid/AlgorithmHistoryWindow.cpp src/Mantid/ExecuteAlgorithm.cpp - src/Mantid/FirstTimeSetup.cpp + src/Mantid/FirstTimeSetup.cpp src/Mantid/FitParameterTie.cpp src/Mantid/FitPropertyBrowser.cpp src/Mantid/IFunctionWrapper.cpp @@ -351,7 +351,7 @@ set ( MANTID_HDRS src/Mantid/AbstractMantidLog.h src/Mantid/AlgMonitor.h src/Mantid/AlgorithmHistoryWindow.h src/Mantid/ExecuteAlgorithm.h - src/Mantid/FirstTimeSetup.h + src/Mantid/FirstTimeSetup.h src/Mantid/FitParameterTie.h src/Mantid/FitPropertyBrowser.h src/Mantid/IFunctionWrapper.h @@ -421,7 +421,9 @@ find_package ( SIP REQUIRED ) separate_arguments ( PYQT4_SIP_FLAGS ) set ( SIP_SPEC ${CMAKE_CURRENT_SOURCE_DIR}/src/qti.sip ) -set ( SIP_SRC sipqtipart0.cpp ) +set ( SIP_SRC ${CMAKE_CURRENT_SOURCE_DIR}/src/sipqti.cpp ) +set ( SIP_SRC_AUTO sipqtipart0.cpp ) + # We need to manually add all the headers that are in qti.sip # so that the dependencies are known to CMake @@ -466,7 +468,16 @@ set ( SIP_HDRS src/MdiSubWindow.h set( SRC_UNITY_IGNORE_FILES ) -add_custom_command ( OUTPUT ${SIP_SRC} +########################################################################### +# Sip generated files +########################################################################### + +# The code generated by sip causes compiler warnings therefore the +# generated file is wrapped by ${SIP_SRC} and these warnings are +# disabled. In order for VS2010 to to this correctly the second +# custom command below is required along with the committed +# src/sipqti.cpp.rule file. +add_custom_command ( OUTPUT ${SIP_SRC_AUTO} COMMAND ${SIP_EXECUTABLE} -I ${PYQT4_SIP_DIR} ${PYQT4_SIP_FLAGS} -c ${CMAKE_CURRENT_BINARY_DIR} -j1 -w @@ -475,6 +486,11 @@ add_custom_command ( OUTPUT ${SIP_SRC} COMMENT "Generating python bindings using sip" ) +add_custom_command ( OUTPUT ${SIP_SRC} + COMMAND ${CMAKE_COMMAND} ARGS -E echo_append "" + DEPENDS ${SIP_SRC_AUTO} +) + # Needed for sip.h header that can end up in a different place to to the main Python include directory include_directories ( ${SIP_INCLUDE_DIR} ) # Needed for sip generated files to find includes in src @@ -592,7 +608,7 @@ set ( QTIPLOT_MOC_FILES src/ApplicationWindow.h set ( MANTID_MOC_FILES src/Mantid/AlgMonitor.h src/Mantid/AlgorithmHistoryWindow.h src/Mantid/ExecuteAlgorithm.h - src/Mantid/FirstTimeSetup.h + src/Mantid/FirstTimeSetup.h src/Mantid/FitPropertyBrowser.h src/Mantid/IFunctionWrapper.h src/Mantid/ImportWorkspaceDlg.h @@ -674,15 +690,9 @@ set ( SRC_FILES ${QTIPLOT_SRCS} ${MANTID_SRCS} ${SIP_SRC} ) set ( INC_FILES ${QTIPLOT_HDRS} ${MANTID_HDRS} ) ########################################################################### -# Windows console mode +# Application icon files ########################################################################### -# On Windows we need to distinguish between release and debug modes with -# respect to the console window, i.e we don't want the console in release -# 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 ) - # Also include the icon's rc file so that it is embedded in the exe set ( MANTID_RC_FILE icons/MantidPlotDesktop.rc ) endif( WIN32 ) @@ -691,12 +701,11 @@ if ( APPLE ) set_source_files_properties(MANTID_RC_FILE PROPERTIES MACOSX_PACKAGE_LOCATION Resources) endif () -add_executable ( MantidPlot MACOSX_BUNDLE ${EXE_FLAG} ${SRC_FILES} ${INC_FILES} +add_executable ( MantidPlot WIN32 MACOSX_BUNDLE ${SRC_FILES} ${INC_FILES} ${MOCCED_FILES} ${UI_HDRS} ${RES_FILES} - ${MANTID_RC_FILE} + ${MANTID_RC_FILE} ) -# Clean up -set ( EXE_FLAG ) + # Library dependencies target_link_libraries ( MantidPlot ${CORE_MANTIDLIBS} MantidQtAPI MantidWidgets @@ -706,6 +715,7 @@ target_link_libraries ( MantidPlot ${PYTHON_LIBRARIES} ${ZLIB_LIBRARIES} ) + ########################################################################### # Console and entry point flags for Windows ########################################################################### diff --git a/Code/Mantid/MantidPlot/src/sipqti.cpp.rule b/Code/Mantid/MantidPlot/src/sipqti.cpp.rule new file mode 100644 index 0000000000000000000000000000000000000000..c0c8cf055b2a7831d703e27f5bbefcffa8d4b95a --- /dev/null +++ b/Code/Mantid/MantidPlot/src/sipqti.cpp.rule @@ -0,0 +1 @@ +# 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