From 632344a27aafb55ee43ead360846b79821f1c79e Mon Sep 17 00:00:00 2001
From: Roman Tolchenov <roman.tolchenov@stfc.ac.uk>
Date: Fri, 28 Jul 2017 16:33:37 +0100
Subject: [PATCH] Moved widget factory.

---
 qt/CMakeLists.txt                               |  5 +++--
 qt/widgets/CMakeLists.txt                       |  2 +-
 .../widgets/factory}/CMakeLists.txt             | 17 +++++++++--------
 .../inc/MantidQtWidgets/Factory}/DllOption.h    |  0
 .../MantidQtWidgets/Factory}/WidgetFactory.h    |  4 ++--
 .../widgets/factory}/src/WidgetFactory.cpp      |  6 +++---
 .../widgets/factory}/test/WidgetFactoryTest.h   |  0
 7 files changed, 18 insertions(+), 16 deletions(-)
 rename {MantidQt/Factory => qt/widgets/factory}/CMakeLists.txt (65%)
 rename {MantidQt/Factory/inc/MantidQtFactory => qt/widgets/factory/inc/MantidQtWidgets/Factory}/DllOption.h (100%)
 rename {MantidQt/Factory/inc/MantidQtFactory => qt/widgets/factory/inc/MantidQtWidgets/Factory}/WidgetFactory.h (95%)
 rename {MantidQt/Factory => qt/widgets/factory}/src/WidgetFactory.cpp (96%)
 rename {MantidQt/Factory => qt/widgets/factory}/test/WidgetFactoryTest.h (100%)

diff --git a/qt/CMakeLists.txt b/qt/CMakeLists.txt
index 429e087f9f8..be66008747e 100644
--- a/qt/CMakeLists.txt
+++ b/qt/CMakeLists.txt
@@ -22,18 +22,19 @@ if ( MSVC_IDE )
   set_property ( TARGET qtwidgetssliceviewer PROPERTY FOLDER "MantidQt" )
   set_property ( TARGET qtwidgetsspectrumviewer PROPERTY FOLDER "MantidQt" )
   set_property ( TARGET qtwidgetsrefdetectorview PROPERTY FOLDER "MantidQt" )
+  set_property ( TARGET qtwidgetsfactory PROPERTY FOLDER "MantidQt" )
 #  set_property ( TARGET MantidWidgets PROPERTY FOLDER "MantidQt" )
 #  set_property ( TARGET CustomDialogs PROPERTY FOLDER "MantidQt" )
 #  set_property ( TARGET CustomInterfaces PROPERTY FOLDER "MantidQt" )
 #  set_property ( TARGET DesignerPlugins PROPERTY FOLDER "MantidQt" )
-#  set_property ( TARGET MantidQtFactory PROPERTY FOLDER "MantidQt" )
 #  set_property ( TARGET mantidqtpython PROPERTY FOLDER "MantidQt" )
 else ()
   add_custom_target ( MantidQt DEPENDS qtwidgetscommon 
                                        qtwidgetssliceviewer
                                        qtwidgetsspectrumviewer
                                        qtwidgetsrefdetectorview
+                                       qtwidgetsfactory
 #                                       CustomDialogs CustomInterfaces
-#                                       MantidQtFactory mantidqtpython
+#                                       mantidqtpython
   )
 endif ()
diff --git a/qt/widgets/CMakeLists.txt b/qt/widgets/CMakeLists.txt
index 992d20dc3cf..2eeba9eab89 100644
--- a/qt/widgets/CMakeLists.txt
+++ b/qt/widgets/CMakeLists.txt
@@ -6,10 +6,10 @@ add_subdirectory ( instrumentview )
 add_subdirectory ( sliceviewer )
 add_subdirectory ( spectrumviewer )
 add_subdirectory ( refdetectorview)
+add_subdirectory ( factory )
 
 #add_subdirectory ( CustomDialogs )
 #add_subdirectory ( CustomInterfaces )
-#add_subdirectory ( Factory )
 #add_subdirectory ( Python )
 #add_subdirectory ( DesignerPlugins )
 
diff --git a/MantidQt/Factory/CMakeLists.txt b/qt/widgets/factory/CMakeLists.txt
similarity index 65%
rename from MantidQt/Factory/CMakeLists.txt
rename to qt/widgets/factory/CMakeLists.txt
index 255d9e3eb61..992d37c1117 100644
--- a/MantidQt/Factory/CMakeLists.txt
+++ b/qt/widgets/factory/CMakeLists.txt
@@ -3,11 +3,11 @@ set ( SRC_FILES
 )
 
 set ( INC_FILES
-	inc/MantidQtFactory/WidgetFactory.h
+	inc/MantidQtWidgets/Factory/WidgetFactory.h
 )
 
 set ( MOC_FILES 
-	inc/MantidQtFactory/WidgetFactory.h
+	inc/MantidQtWidgets/Factory/WidgetFactory.h
 )
 
 set ( UI_FILES 
@@ -18,7 +18,7 @@ set ( TEST_FILES
 )
 
 include_directories ( inc )
-include_directories ( ../SliceViewer/inc )
+include_directories ( ../sliceviewer/inc )
 
 ###########################################################################
 # Main Library Target
@@ -31,21 +31,22 @@ set ( ALL_SRC ${SRC_FILES} ${MOCCED_FILES} )
 qt4_wrap_ui ( UI_HDRS ${UI_FILES} ) 
 
 include_directories ( ${CMAKE_CURRENT_BINARY_DIR} )
-include_directories ( ${CMAKE_CURRENT_BINARY_DIR}/../SliceViewer )
+include_directories ( ${CMAKE_CURRENT_BINARY_DIR}/../sliceviewer )
 
 # For Windows:
 add_definitions ( -DIN_MANTIDQT_FACTORY )
 
 # This creates the target library
-add_library ( MantidQtFactory ${ALL_SRC} ${INC_FILES} ${UI_HDRS} )
+add_library ( qtwidgetsfactory ${ALL_SRC} ${INC_FILES} ${UI_HDRS} )
 
 if (OSX_VERSION VERSION_GREATER 10.8)
-  set_target_properties ( MantidQtFactory PROPERTIES INSTALL_RPATH "@loader_path/../MacOS")
+  set_target_properties ( qtwidgetsfactory PROPERTIES INSTALL_RPATH "@loader_path/../MacOS")
 endif ()
 
 # ... and links to other required libs
-target_link_libraries ( MantidQtFactory LINK_PRIVATE ${TCMALLOC_LIBRARIES_LINKTIME} 
+target_link_libraries ( qtwidgetsfactory LINK_PRIVATE ${TCMALLOC_LIBRARIES_LINKTIME} 
             qtwidgetscommon
+            qtwidgetssliceviewer
             ${CORE_MANTIDLIBS}
             ${POCO_LIBRARIES}
             ${Boost_LIBRARIES}
@@ -56,6 +57,6 @@ target_link_libraries ( MantidQtFactory LINK_PRIVATE ${TCMALLOC_LIBRARIES_LINKTI
 # Installation settings
 ###########################################################################
 
-install ( TARGETS MantidQtFactory ${SYSTEM_PACKAGE_TARGET} DESTINATION ${LIB_DIR} )
+install ( TARGETS qtwidgetsfactory ${SYSTEM_PACKAGE_TARGET} DESTINATION ${LIB_DIR} )
 
 
diff --git a/MantidQt/Factory/inc/MantidQtFactory/DllOption.h b/qt/widgets/factory/inc/MantidQtWidgets/Factory/DllOption.h
similarity index 100%
rename from MantidQt/Factory/inc/MantidQtFactory/DllOption.h
rename to qt/widgets/factory/inc/MantidQtWidgets/Factory/DllOption.h
diff --git a/MantidQt/Factory/inc/MantidQtFactory/WidgetFactory.h b/qt/widgets/factory/inc/MantidQtWidgets/Factory/WidgetFactory.h
similarity index 95%
rename from MantidQt/Factory/inc/MantidQtFactory/WidgetFactory.h
rename to qt/widgets/factory/inc/MantidQtWidgets/Factory/WidgetFactory.h
index f2cf079ae4f..17e4aa6de87 100644
--- a/MantidQt/Factory/inc/MantidQtFactory/WidgetFactory.h
+++ b/qt/widgets/factory/inc/MantidQtWidgets/Factory/WidgetFactory.h
@@ -4,8 +4,8 @@
 #include "DllOption.h"
 #include "MantidKernel/System.h"
 #include "MantidKernel/SingletonHolder.h"
-#include "MantidQtSliceViewer/SliceViewer.h"
-#include "MantidQtSliceViewer/SliceViewerWindow.h"
+#include "MantidQtWidgets/SliceViewer/SliceViewer.h"
+#include "MantidQtWidgets/SliceViewer/SliceViewerWindow.h"
 #include "qapplication.h"
 #include <Qsci/qscilexer.h>
 #include <QtCore/QtCore>
diff --git a/MantidQt/Factory/src/WidgetFactory.cpp b/qt/widgets/factory/src/WidgetFactory.cpp
similarity index 96%
rename from MantidQt/Factory/src/WidgetFactory.cpp
rename to qt/widgets/factory/src/WidgetFactory.cpp
index 4862cac4720..91c872f5f70 100644
--- a/MantidQt/Factory/src/WidgetFactory.cpp
+++ b/qt/widgets/factory/src/WidgetFactory.cpp
@@ -1,7 +1,7 @@
-#include "MantidQtFactory/WidgetFactory.h"
+#include "MantidQtWidgets/Factory/WidgetFactory.h"
 #include "MantidKernel/System.h"
-#include "MantidQtSliceViewer/SliceViewerWindow.h"
-#include "MantidQtSliceViewer/SliceViewer.h"
+#include "MantidQtWidgets/SliceViewer/SliceViewerWindow.h"
+#include "MantidQtWidgets/SliceViewer/SliceViewer.h"
 
 using namespace MantidQt::SliceViewer;
 
diff --git a/MantidQt/Factory/test/WidgetFactoryTest.h b/qt/widgets/factory/test/WidgetFactoryTest.h
similarity index 100%
rename from MantidQt/Factory/test/WidgetFactoryTest.h
rename to qt/widgets/factory/test/WidgetFactoryTest.h
-- 
GitLab