From 6e6ffbc431abb06baa413c29f3f6d6ae4a834fe2 Mon Sep 17 00:00:00 2001
From: Owen Arnold <owen.arnold@stfc.ac.uk>
Date: Wed, 18 Apr 2012 13:23:27 +0100
Subject: [PATCH] refs #5013. Move PV Plugins.

Move PVPLUGINS to a subdirectory of PVPLUGINS. This has two advantages. Firstly it maintains the possiblity to keep the loading of PV related mantid components separate from those in Mantid Plugins. Secondly it means that Paraview standalone does not crash when PV_PLUGIN_PATH is used. Only Paraview plugins sit in the subdirectory, so the Paraview loader doesnt get confused by the presence of these other libraries
---
 Code/Mantid/Build/CMake/LinuxSetup.cmake               | 10 +++++-----
 Code/Mantid/Build/CMake/WindowsNSIS.cmake              |  4 ++--
 Code/Mantid/Framework/Kernel/src/ConfigService.cpp     |  4 ++--
 .../MDEWRebinningCutterOperator/CMakeLists.txt         |  4 ++--
 .../RebinningTransformOperator/CMakeLists.txt          |  4 ++--
 .../ParaViewFilters/ScaleWorkspace/CMakeLists.txt      |  4 ++--
 .../ParaViewFilters/SplatterPlot/CMakeLists.txt        |  4 ++--
 .../ParaViewReaders/EventNexusReader/CMakeLists.txt    |  4 ++--
 .../ParaViewReaders/MDEWNexusReader/CMakeLists.txt     |  4 ++--
 .../ParaViewReaders/PeaksReader/CMakeLists.txt         |  4 ++--
 .../ParaViewReaders/SQWEventReader/CMakeLists.txt      |  4 ++--
 .../ParaViewReaders/SQWReader/CMakeLists.txt           |  4 ++--
 .../ParaViewSources/MDEWSource/CMakeLists.txt          |  4 ++--
 .../ParaViewSources/MDHWSource/CMakeLists.txt          |  4 ++--
 .../ParaViewSources/PeaksSource/CMakeLists.txt         |  4 ++--
 .../RebinningCutterObjectPanel/CMakeLists.txt          |  4 ++--
 .../RebinningTransformObjectPanel/CMakeLists.txt       |  4 ++--
 .../Vates/VatesSimpleGui/StandAloneExec/CMakeLists.txt |  2 +-
 .../Vates/VatesSimpleGui/ViewWidgets/CMakeLists.txt    |  2 +-
 19 files changed, 39 insertions(+), 39 deletions(-)

diff --git a/Code/Mantid/Build/CMake/LinuxSetup.cmake b/Code/Mantid/Build/CMake/LinuxSetup.cmake
index 0a4fd2fb0a2..e9570ee1e02 100644
--- a/Code/Mantid/Build/CMake/LinuxSetup.cmake
+++ b/Code/Mantid/Build/CMake/LinuxSetup.cmake
@@ -47,21 +47,21 @@ set ( CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/${LIB_DIR};${CMAKE_INSTALL_PRE
 
 file ( WRITE ${CMAKE_CURRENT_BINARY_DIR}/mantid.sh  "#!/bin/sh\n"
                                                     "MANTIDPATH=${CMAKE_INSTALL_PREFIX}/${BIN_DIR}\n"
-                                                    "PV_PLUGIN_PATH=${CMAKE_INSTALL_PREFIX}/${PVPLUGINS_DIR}\n"
+                                                    "PV_PLUGIN_PATH=${CMAKE_INSTALL_PREFIX}/${PVPLUGINS_DIR}/${PVPLUGINS_DIR}\n"
 #                                                    "scriptpath=\"$(cd \"\${0%/*}\" 2> /dev/null;echo \"$PWD\"/\"\${0##*/}\")\"\n"
 #                                                    "scriptpath=`readlink -f $scriptpath`\n"
 #                                                    "scriptpath=`dirname $scriptpath`\n"
 #                                                    "echo \"script $scriptpath\"\n"
 #                                                    "MANTIDPATH=$scriptpath/${BIN_DIR}\n"
 #                                                    "echo $MANTIDPATH\n"
-#                                                    "PV_PLUGIN_PATH=$scriptpath/${PVPLUGINS_DIR}\n"
+#                                                    "PV_PLUGIN_PATH=$scriptpath/${PVPLUGINS_DIR}/${PVPLUGINS_DIR}\n"
                                                     "PATH=$PATH:$MANTIDPATH\n"
                                                     "export MANTIDPATH PV_PLUGIN_PATH PATH\n"
 )
 
 file ( WRITE ${CMAKE_CURRENT_BINARY_DIR}/mantid.csh  "#!/bin/csh\n"
                                                     "setenv MANTIDPATH \"${CMAKE_INSTALL_PREFIX}/${BIN_DIR}\"\n"
-                                                    "setenv PV_PLUGIN_PATH \"${CMAKE_INSTALL_PREFIX}/${PVPLUGINS_DIR}\"\n"
+                                                    "setenv PV_PLUGIN_PATH \"${CMAKE_INSTALL_PREFIX}/${PVPLUGINS_DIR}/${PVPLUGINS_DIR}\"\n"
                                                     "setenv PATH \"\${PATH}:\${MANTIDPATH}\"\n"
 )
 
@@ -80,7 +80,7 @@ file ( WRITE ${CMAKE_CURRENT_BINARY_DIR}/rpm_make_links.sh "#!/bin/sh\n"
 )
 
 file ( WRITE ${CMAKE_CURRENT_BINARY_DIR}/rpm_remove_all_links.sh "#!/bin/sh\n"
-                                                             "if [ ! -f $RPM_INSTALL_PREFIX0/${PVPLUGINS_DIR}/libMantidParaViewSplatterPlotSMPlugin.so ];then\n"
+                                                             "if [ ! -f $RPM_INSTALL_PREFIX0/${PVPLUGINS_DIR}/${PVPLUGINS_DIR}/libMantidParaViewSplatterPlotSMPlugin.so ];then\n"
                                                              "  rm -f $RPM_INSTALL_PREFIX0/${BIN_DIR}/mantidplot\n"
                                                              "fi\n"
                                                              "if [ -h /etc/profile.d/mantid.sh ]; then\n"
@@ -92,7 +92,7 @@ file ( WRITE ${CMAKE_CURRENT_BINARY_DIR}/rpm_remove_all_links.sh "#!/bin/sh\n"
 )
 
 file ( WRITE ${CMAKE_CURRENT_BINARY_DIR}/rpm_remove_links.sh "#!/bin/sh\n"
-                                                             "if [ ! -f $RPM_INSTALL_PREFIX0/${PVPLUGINS_DIR}/libMantidParaViewSplatterPlotSMPlugin.so ];then\n"
+                                                             "if [ ! -f $RPM_INSTALL_PREFIX0/${PVPLUGINS_DIR}/${PVPLUGINS_DIR}/libMantidParaViewSplatterPlotSMPlugin.so ];then\n"
                                                              "  rm -f $RPM_INSTALL_PREFIX0/${BIN_DIR}/mantidplot\n"
                                                              "fi\n"
 )
diff --git a/Code/Mantid/Build/CMake/WindowsNSIS.cmake b/Code/Mantid/Build/CMake/WindowsNSIS.cmake
index e0207b48bd2..fbc7d9cb7ed 100644
--- a/Code/Mantid/Build/CMake/WindowsNSIS.cmake
+++ b/Code/Mantid/Build/CMake/WindowsNSIS.cmake
@@ -84,7 +84,7 @@
 		    Push \\\"PV_PLUGIN_PATH\\\"
             Push \\\"A\\\"
             Push \\\"HKCU\\\"
-            Push \\\"$INSTDIR\\\\${PVPLUGINS_DIR}\\\"
+            Push \\\"$INSTDIR\\\\${PVPLUGINS_DIR}\\\\${PVPLUGINS_DIR}\\\"
             Call EnvVarUpdate
             Pop  \\\$0
 		
@@ -113,7 +113,7 @@
 		    Push \\\"PV_PLUGIN_PATH\\\"
             Push \\\"R\\\"
             Push \\\"HKCU\\\"
-            Push \\\"$INSTDIR\\\\${PVPLUGINS_DIR}\\\"
+            Push \\\"$INSTDIR\\\\${PVPLUGINS_DIR}\\\\${PVPLUGINS_DIR}\\\"
             Call un.EnvVarUpdate
             Pop  \\\$0
 		
diff --git a/Code/Mantid/Framework/Kernel/src/ConfigService.cpp b/Code/Mantid/Framework/Kernel/src/ConfigService.cpp
index 9373f77b15e..a2cd88e88d5 100644
--- a/Code/Mantid/Framework/Kernel/src/ConfigService.cpp
+++ b/Code/Mantid/Framework/Kernel/src/ConfigService.cpp
@@ -1367,13 +1367,13 @@ bool ConfigServiceImpl::isNetworkDrive(const std::string & path)
 void ConfigServiceImpl::setParaViewPluginPath() const
 {
   std::string mantid_loc = this->getDirectoryOfExecutable();
-  Poco::Path pv_plugin_path(mantid_loc + "/pvplugins");
+  Poco::Path pv_plugin_path(mantid_loc + "/pvplugins/pvplugins");
   pv_plugin_path = pv_plugin_path.absolute();
   Poco::File pv_plugin(pv_plugin_path.toString());
   if (!pv_plugin.exists() || !pv_plugin.isDirectory())
   {
     g_log.debug("ParaView plugin directory \"" + pv_plugin.path() + "\" does not exist");
-    pv_plugin_path = Poco::Path(mantid_loc + "/../pvplugins");
+    pv_plugin_path = Poco::Path(mantid_loc + "/../pvplugins/pvplugins");
     pv_plugin_path = pv_plugin_path.absolute();
     pv_plugin = Poco::File(pv_plugin_path.toString());
     if (!pv_plugin.exists() || !pv_plugin.isDirectory())
diff --git a/Code/Mantid/Vates/ParaviewPlugins/ParaViewFilters/MDEWRebinningCutterOperator/CMakeLists.txt b/Code/Mantid/Vates/ParaviewPlugins/ParaViewFilters/MDEWRebinningCutterOperator/CMakeLists.txt
index be004d14566..4ef31c801cb 100644
--- a/Code/Mantid/Vates/ParaviewPlugins/ParaViewFilters/MDEWRebinningCutterOperator/CMakeLists.txt
+++ b/Code/Mantid/Vates/ParaviewPlugins/ParaViewFilters/MDEWRebinningCutterOperator/CMakeLists.txt
@@ -15,7 +15,7 @@ target_link_libraries( MantidParaViewMDEWRebinningCutterSMPlugin
 ${MANTID_SUBPROJECT_LIBS} )
 
 # Put library into subfolder.
-SET_TARGET_OUTPUT_DIRECTORY(MantidParaViewMDEWRebinningCutterSMPlugin  ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/${PVPLUGINS_DIR})
+SET_TARGET_OUTPUT_DIRECTORY(MantidParaViewMDEWRebinningCutterSMPlugin  ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/${PVPLUGINS_DIR}/${PVPLUGINS_DIR})
 
-install( TARGETS MantidParaViewMDEWRebinningCutterSMPlugin ${TARGET_TYPE} DESTINATION ${PVPLUGINS_DIR} )
+install( TARGETS MantidParaViewMDEWRebinningCutterSMPlugin ${TARGET_TYPE} DESTINATION ${PVPLUGINS_DIR}/${PVPLUGINS_DIR} )
 
diff --git a/Code/Mantid/Vates/ParaviewPlugins/ParaViewFilters/RebinningTransformOperator/CMakeLists.txt b/Code/Mantid/Vates/ParaviewPlugins/ParaViewFilters/RebinningTransformOperator/CMakeLists.txt
index be6ec22c997..dc782e3a742 100644
--- a/Code/Mantid/Vates/ParaviewPlugins/ParaViewFilters/RebinningTransformOperator/CMakeLists.txt
+++ b/Code/Mantid/Vates/ParaviewPlugins/ParaViewFilters/RebinningTransformOperator/CMakeLists.txt
@@ -14,7 +14,7 @@ target_link_libraries( MantidParaViewRebinningTransformSMPlugin
 ${MANTID_SUBPROJECT_LIBS} )
 
 # Put library into subfolder.
-SET_TARGET_OUTPUT_DIRECTORY(MantidParaViewRebinningTransformSMPlugin  ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/${PVPLUGINS_DIR})
+SET_TARGET_OUTPUT_DIRECTORY(MantidParaViewRebinningTransformSMPlugin  ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/${PVPLUGINS_DIR}/${PVPLUGINS_DIR})
 
-install( TARGETS MantidParaViewRebinningTransformSMPlugin ${TARGET_TYPE} DESTINATION ${PVPLUGINS_DIR} )
+install( TARGETS MantidParaViewRebinningTransformSMPlugin ${TARGET_TYPE} DESTINATION ${PVPLUGINS_DIR}/${PVPLUGINS_DIR} )
 
diff --git a/Code/Mantid/Vates/ParaviewPlugins/ParaViewFilters/ScaleWorkspace/CMakeLists.txt b/Code/Mantid/Vates/ParaviewPlugins/ParaViewFilters/ScaleWorkspace/CMakeLists.txt
index 0f4cba7ea14..a7771153ad5 100644
--- a/Code/Mantid/Vates/ParaviewPlugins/ParaViewFilters/ScaleWorkspace/CMakeLists.txt
+++ b/Code/Mantid/Vates/ParaviewPlugins/ParaViewFilters/ScaleWorkspace/CMakeLists.txt
@@ -7,6 +7,6 @@ GUI_RESOURCE_FILES ScaleWorkspaceGUI.xml)
 # Add to the 'VatesParaViewPlugins' group in VS
 set_property( TARGET MantidParaViewScaleWorkspaceSMPlugin PROPERTY FOLDER "MantidVatesParaViewPlugins")
 # Put library into subfolder.
-SET_TARGET_OUTPUT_DIRECTORY(MantidParaViewScaleWorkspaceSMPlugin  ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/${PVPLUGINS_DIR})
+SET_TARGET_OUTPUT_DIRECTORY(MantidParaViewScaleWorkspaceSMPlugin  ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/${PVPLUGINS_DIR}/${PVPLUGINS_DIR})
 
-install( TARGETS MantidParaViewScaleWorkspaceSMPlugin ${TARGET_TYPE} DESTINATION ${PVPLUGINS_DIR})
+install( TARGETS MantidParaViewScaleWorkspaceSMPlugin ${TARGET_TYPE} DESTINATION ${PVPLUGINS_DIR}/${PVPLUGINS_DIR})
diff --git a/Code/Mantid/Vates/ParaviewPlugins/ParaViewFilters/SplatterPlot/CMakeLists.txt b/Code/Mantid/Vates/ParaviewPlugins/ParaViewFilters/SplatterPlot/CMakeLists.txt
index b1832f44428..34e449840a3 100644
--- a/Code/Mantid/Vates/ParaviewPlugins/ParaViewFilters/SplatterPlot/CMakeLists.txt
+++ b/Code/Mantid/Vates/ParaviewPlugins/ParaViewFilters/SplatterPlot/CMakeLists.txt
@@ -13,7 +13,7 @@ target_link_libraries( MantidParaViewSplatterPlotSMPlugin
 ${MANTID_SUBPROJECT_LIBS} )
 
 # Put library into subfolder.
-SET_TARGET_OUTPUT_DIRECTORY(MantidParaViewSplatterPlotSMPlugin ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/${PVPLUGINS_DIR})
+SET_TARGET_OUTPUT_DIRECTORY(MantidParaViewSplatterPlotSMPlugin ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/${PVPLUGINS_DIR}/${PVPLUGINS_DIR})
 
-install( TARGETS MantidParaViewSplatterPlotSMPlugin ${TARGET_TYPE} DESTINATION ${PVPLUGINS_DIR} )
+install( TARGETS MantidParaViewSplatterPlotSMPlugin ${TARGET_TYPE} DESTINATION ${PVPLUGINS_DIR}/${PVPLUGINS_DIR} )
 
diff --git a/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/EventNexusReader/CMakeLists.txt b/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/EventNexusReader/CMakeLists.txt
index f4e0e4e1555..c8685c44110 100644
--- a/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/EventNexusReader/CMakeLists.txt
+++ b/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/EventNexusReader/CMakeLists.txt
@@ -13,8 +13,8 @@ target_link_libraries( MantidParaViewEventNexusReaderSMPlugin
 ${MANTID_SUBPROJECT_LIBS} )
 
 # Put library into subfolder.
-SET_TARGET_OUTPUT_DIRECTORY(MantidParaViewEventNexusReaderSMPlugin ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/${PVPLUGINS_DIR})
+SET_TARGET_OUTPUT_DIRECTORY(MantidParaViewEventNexusReaderSMPlugin ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/${PVPLUGINS_DIR}/${PVPLUGINS_DIR})
 
-install( TARGETS MantidParaViewEventNexusReaderSMPlugin ${TARGET_TYPE} DESTINATION ${PVPLUGINS_DIR} )
+install( TARGETS MantidParaViewEventNexusReaderSMPlugin ${TARGET_TYPE} DESTINATION ${PVPLUGINS_DIR}/${PVPLUGINS_DIR} )
 
 
diff --git a/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/MDEWNexusReader/CMakeLists.txt b/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/MDEWNexusReader/CMakeLists.txt
index 17656472ff8..e77ed778d55 100644
--- a/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/MDEWNexusReader/CMakeLists.txt
+++ b/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/MDEWNexusReader/CMakeLists.txt
@@ -13,8 +13,8 @@ target_link_libraries( MantidParaViewMDEWNexusReaderSMPlugin
 ${MANTID_SUBPROJECT_LIBS} )
 
 # Put library into subfolder.
-SET_TARGET_OUTPUT_DIRECTORY(MantidParaViewMDEWNexusReaderSMPlugin ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/${PVPLUGINS_DIR})
+SET_TARGET_OUTPUT_DIRECTORY(MantidParaViewMDEWNexusReaderSMPlugin ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/${PVPLUGINS_DIR}/${PVPLUGINS_DIR})
 
-install( TARGETS MantidParaViewMDEWNexusReaderSMPlugin ${TARGET_TYPE} DESTINATION ${PVPLUGINS_DIR} )
+install( TARGETS MantidParaViewMDEWNexusReaderSMPlugin ${TARGET_TYPE} DESTINATION ${PVPLUGINS_DIR}/${PVPLUGINS_DIR} )
 
 
diff --git a/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/PeaksReader/CMakeLists.txt b/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/PeaksReader/CMakeLists.txt
index 06da2832d51..f66ee96cfa4 100644
--- a/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/PeaksReader/CMakeLists.txt
+++ b/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/PeaksReader/CMakeLists.txt
@@ -13,8 +13,8 @@ target_link_libraries( MantidParaViewPeaksReaderSMPlugin
 ${MANTID_SUBPROJECT_LIBS} )
 
 # Put library into subfolder.
-SET_TARGET_OUTPUT_DIRECTORY(MantidParaViewPeaksReaderSMPlugin ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/${PVPLUGINS_DIR})
+SET_TARGET_OUTPUT_DIRECTORY(MantidParaViewPeaksReaderSMPlugin ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/${PVPLUGINS_DIR}/${PVPLUGINS_DIR})
 
-install( TARGETS MantidParaViewPeaksReaderSMPlugin ${TARGET_TYPE} DESTINATION ${PVPLUGINS_DIR} )
+install( TARGETS MantidParaViewPeaksReaderSMPlugin ${TARGET_TYPE} DESTINATION ${PVPLUGINS_DIR}/${PVPLUGINS_DIR} )
 
 
diff --git a/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/SQWEventReader/CMakeLists.txt b/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/SQWEventReader/CMakeLists.txt
index 52a4955713f..03516a1c39c 100644
--- a/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/SQWEventReader/CMakeLists.txt
+++ b/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/SQWEventReader/CMakeLists.txt
@@ -13,8 +13,8 @@ target_link_libraries( MantidParaViewSQWEventReaderSMPlugin
 ${MANTID_SUBPROJECT_LIBS} )
 
 # Put library into subfolder.
-SET_TARGET_OUTPUT_DIRECTORY(MantidParaViewSQWEventReaderSMPlugin ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/${PVPLUGINS_DIR})
+SET_TARGET_OUTPUT_DIRECTORY(MantidParaViewSQWEventReaderSMPlugin ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/${PVPLUGINS_DIR}/${PVPLUGINS_DIR})
 
-install( TARGETS MantidParaViewSQWEventReaderSMPlugin ${TARGET_TYPE} DESTINATION ${PVPLUGINS_DIR} )
+install( TARGETS MantidParaViewSQWEventReaderSMPlugin ${TARGET_TYPE} DESTINATION ${PVPLUGINS_DIR}/${PVPLUGINS_DIR} )
 
 
diff --git a/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/SQWReader/CMakeLists.txt b/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/SQWReader/CMakeLists.txt
index 554e60d2447..b7fa6c5efbb 100644
--- a/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/SQWReader/CMakeLists.txt
+++ b/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/SQWReader/CMakeLists.txt
@@ -13,9 +13,9 @@ target_link_libraries( MantidParaViewSQWReaderSMPlugin
 ${MANTID_SUBPROJECT_LIBS} )
 
 # Put library into subfolder.
-SET_TARGET_OUTPUT_DIRECTORY( MantidParaViewSQWReaderSMPlugin ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/${PVPLUGINS_DIR})
+SET_TARGET_OUTPUT_DIRECTORY( MantidParaViewSQWReaderSMPlugin ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/${PVPLUGINS_DIR}/${PVPLUGINS_DIR})
 
-install( TARGETS MantidParaViewSQWReaderSMPlugin ${TARGET_TYPE} DESTINATION ${PVPLUGINS_DIR} )
+install( TARGETS MantidParaViewSQWReaderSMPlugin ${TARGET_TYPE} DESTINATION ${PVPLUGINS_DIR}/${PVPLUGINS_DIR} )
 
 
 
diff --git a/Code/Mantid/Vates/ParaviewPlugins/ParaViewSources/MDEWSource/CMakeLists.txt b/Code/Mantid/Vates/ParaviewPlugins/ParaViewSources/MDEWSource/CMakeLists.txt
index 42e0582fa9c..8666aef34c7 100644
--- a/Code/Mantid/Vates/ParaviewPlugins/ParaViewSources/MDEWSource/CMakeLists.txt
+++ b/Code/Mantid/Vates/ParaviewPlugins/ParaViewSources/MDEWSource/CMakeLists.txt
@@ -11,6 +11,6 @@ target_link_libraries( MantidParaViewMDEWSourceSMPlugin
 ${MANTID_SUBPROJECT_LIBS} )
 
 # Put library into subfolder.
-SET_TARGET_OUTPUT_DIRECTORY(MantidParaViewMDEWSourceSMPlugin ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/${PVPLUGINS_DIR})
+SET_TARGET_OUTPUT_DIRECTORY(MantidParaViewMDEWSourceSMPlugin ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/${PVPLUGINS_DIR}/${PVPLUGINS_DIR})
 
-install( TARGETS MantidParaViewMDEWSourceSMPlugin ${TARGET_TYPE} DESTINATION ${PVPLUGINS_DIR} )
+install( TARGETS MantidParaViewMDEWSourceSMPlugin ${TARGET_TYPE} DESTINATION ${PVPLUGINS_DIR}/${PVPLUGINS_DIR} )
diff --git a/Code/Mantid/Vates/ParaviewPlugins/ParaViewSources/MDHWSource/CMakeLists.txt b/Code/Mantid/Vates/ParaviewPlugins/ParaViewSources/MDHWSource/CMakeLists.txt
index 084a99050d0..8abc50b36fd 100644
--- a/Code/Mantid/Vates/ParaviewPlugins/ParaViewSources/MDHWSource/CMakeLists.txt
+++ b/Code/Mantid/Vates/ParaviewPlugins/ParaViewSources/MDHWSource/CMakeLists.txt
@@ -11,6 +11,6 @@ target_link_libraries( MantidParaViewMDHWSourceSMPlugin
 ${MANTID_SUBPROJECT_LIBS} )
 
 # Put library into subfolder.
-SET_TARGET_OUTPUT_DIRECTORY(MantidParaViewMDHWSourceSMPlugin ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/${PVPLUGINS_DIR})
+SET_TARGET_OUTPUT_DIRECTORY(MantidParaViewMDHWSourceSMPlugin ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/${PVPLUGINS_DIR}/${PVPLUGINS_DIR})
 
-install( TARGETS MantidParaViewMDHWSourceSMPlugin ${TARGET_TYPE} DESTINATION ${PVPLUGINS_DIR} )
+install( TARGETS MantidParaViewMDHWSourceSMPlugin ${TARGET_TYPE} DESTINATION ${PVPLUGINS_DIR}/${PVPLUGINS_DIR} )
diff --git a/Code/Mantid/Vates/ParaviewPlugins/ParaViewSources/PeaksSource/CMakeLists.txt b/Code/Mantid/Vates/ParaviewPlugins/ParaViewSources/PeaksSource/CMakeLists.txt
index 874c04c3dde..f1d34d87f11 100644
--- a/Code/Mantid/Vates/ParaviewPlugins/ParaViewSources/PeaksSource/CMakeLists.txt
+++ b/Code/Mantid/Vates/ParaviewPlugins/ParaViewSources/PeaksSource/CMakeLists.txt
@@ -11,6 +11,6 @@ target_link_libraries( MantidParaViewPeaksSourceSMPlugin
 ${MANTID_SUBPROJECT_LIBS} )
 
 # Put library into subfolder.
-SET_TARGET_OUTPUT_DIRECTORY(MantidParaViewPeaksSourceSMPlugin ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/${PVPLUGINS_DIR})
+SET_TARGET_OUTPUT_DIRECTORY(MantidParaViewPeaksSourceSMPlugin ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/${PVPLUGINS_DIR}/${PVPLUGINS_DIR})
 
-install( TARGETS MantidParaViewPeaksSourceSMPlugin ${TARGET_TYPE} DESTINATION ${PVPLUGINS_DIR} )
+install( TARGETS MantidParaViewPeaksSourceSMPlugin ${TARGET_TYPE} DESTINATION ${PVPLUGINS_DIR}/${PVPLUGINS_DIR} )
diff --git a/Code/Mantid/Vates/ParaviewPlugins/ParaViewWidgets/RebinningCutterObjectPanel/CMakeLists.txt b/Code/Mantid/Vates/ParaviewPlugins/ParaViewWidgets/RebinningCutterObjectPanel/CMakeLists.txt
index 2ed508f487f..9d8d4191a2b 100644
--- a/Code/Mantid/Vates/ParaviewPlugins/ParaViewWidgets/RebinningCutterObjectPanel/CMakeLists.txt
+++ b/Code/Mantid/Vates/ParaviewPlugins/ParaViewWidgets/RebinningCutterObjectPanel/CMakeLists.txt
@@ -19,8 +19,8 @@ target_link_libraries( MantidParaViewRebinningCutterObjectPanel
 MantidParaViewQtWidgets )
 
 # Put library into subfolder.
-SET_TARGET_OUTPUT_DIRECTORY( MantidParaViewRebinningCutterObjectPanel  ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/${PVPLUGINS_DIR})
+SET_TARGET_OUTPUT_DIRECTORY( MantidParaViewRebinningCutterObjectPanel  ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/${PVPLUGINS_DIR}/${PVPLUGINS_DIR})
 
-install( TARGETS MantidParaViewRebinningCutterObjectPanel ${TARGET_TYPE} DESTINATION ${PVPLUGINS_DIR} )
+install( TARGETS MantidParaViewRebinningCutterObjectPanel ${TARGET_TYPE} DESTINATION ${PVPLUGINS_DIR}/${PVPLUGINS_DIR} )
 
 
diff --git a/Code/Mantid/Vates/ParaviewPlugins/ParaViewWidgets/RebinningTransformObjectPanel/CMakeLists.txt b/Code/Mantid/Vates/ParaviewPlugins/ParaViewWidgets/RebinningTransformObjectPanel/CMakeLists.txt
index 58f4704e693..685736014f3 100644
--- a/Code/Mantid/Vates/ParaviewPlugins/ParaViewWidgets/RebinningTransformObjectPanel/CMakeLists.txt
+++ b/Code/Mantid/Vates/ParaviewPlugins/ParaViewWidgets/RebinningTransformObjectPanel/CMakeLists.txt
@@ -19,8 +19,8 @@ target_link_libraries( MantidParaViewRebinningTransformObjectPanel
 MantidParaViewQtWidgets )
 
 # Put library into subfolder.
-SET_TARGET_OUTPUT_DIRECTORY( MantidParaViewRebinningTransformObjectPanel  ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/${PVPLUGINS_DIR})
+SET_TARGET_OUTPUT_DIRECTORY( MantidParaViewRebinningTransformObjectPanel  ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/${PVPLUGINS_DIR}/${PVPLUGINS_DIR})
 
-install( TARGETS MantidParaViewRebinningTransformObjectPanel ${TARGET_TYPE} DESTINATION ${PVPLUGINS_DIR} )
+install( TARGETS MantidParaViewRebinningTransformObjectPanel ${TARGET_TYPE} DESTINATION ${PVPLUGINS_DIR}/${PVPLUGINS_DIR} )
 
 
diff --git a/Code/Mantid/Vates/VatesSimpleGui/StandAloneExec/CMakeLists.txt b/Code/Mantid/Vates/VatesSimpleGui/StandAloneExec/CMakeLists.txt
index e2ae33de92c..e3b94dab2d0 100644
--- a/Code/Mantid/Vates/VatesSimpleGui/StandAloneExec/CMakeLists.txt
+++ b/Code/Mantid/Vates/VatesSimpleGui/StandAloneExec/CMakeLists.txt
@@ -52,7 +52,7 @@ if( SQUISH_FOUND )
   set( auto_test_dir ${CMAKE_SOURCE_DIR} )
   string( REGEX REPLACE "Code/Mantid" "Test/AutoTestData" auto_test_dir ${auto_test_dir} )
   set( SQUISH_ENV_VARS
-    PV_PLUGIN_PATH=$<TARGET_FILE_DIR:${SQUISH_AUT}>/${PVPLUGINS_DIR}
+    PV_PLUGIN_PATH=$<TARGET_FILE_DIR:${SQUISH_AUT}>/${PVPLUGINS_DIR}/${PVPLUGINS_DIR}
     MANTID_AUTOTEST_DATA=${auto_test_dir}
     SQUISH_SCRIPT_DIR=${VSI_GLOBAL_SCRIPTS}
   )
diff --git a/Code/Mantid/Vates/VatesSimpleGui/ViewWidgets/CMakeLists.txt b/Code/Mantid/Vates/VatesSimpleGui/ViewWidgets/CMakeLists.txt
index 806f195f3ed..75e635b57fd 100644
--- a/Code/Mantid/Vates/VatesSimpleGui/ViewWidgets/CMakeLists.txt
+++ b/Code/Mantid/Vates/VatesSimpleGui/ViewWidgets/CMakeLists.txt
@@ -105,7 +105,7 @@ if( SQUISH_FOUND )
 
   # Need to set environmental variables next
   set( SQUISH_ENV_VARS
-    PV_PLUGIN_PATH=$<TARGET_FILE_DIR:${SQUISH_AUT}>/${PVPLUGINS_DIR}
+    PV_PLUGIN_PATH=$<TARGET_FILE_DIR:${SQUISH_AUT}>/${PVPLUGINS_DIR}/${PVPLUGINS_DIR}
     SCRIPTS_DIR=${CMAKE_CURRENT_SOURCE_DIR}/test/mp_scripts
     SQUISH_SCRIPT_DIR=${VSI_GLOBAL_SCRIPTS}:${CMAKE_CURRENT_SOURCE_DIR}/test/common/scripts
   )
-- 
GitLab