From 4ab5272a44cf6e6f52eaf4fd3525f18fa615eec7 Mon Sep 17 00:00:00 2001
From: Steven Hahn <hahnse@ornl.gov>
Date: Fri, 19 Dec 2014 18:23:33 -0500
Subject: [PATCH] Refs #10840. MantidPlot starts, but still has issues with
 python.

---
 Code/Mantid/Build/CMake/DarwinSetup.cmake              | 10 ++++++++--
 .../PythonInterface/mantid/api/CMakeLists.txt          |  2 +-
 .../PythonInterface/mantid/geometry/CMakeLists.txt     |  2 +-
 .../PythonInterface/mantid/kernel/CMakeLists.txt       |  2 +-
 Code/Mantid/MantidPlot/CMakeLists.txt                  |  1 +
 5 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/Code/Mantid/Build/CMake/DarwinSetup.cmake b/Code/Mantid/Build/CMake/DarwinSetup.cmake
index 8e519bc7ecd..40ad7f3382b 100644
--- a/Code/Mantid/Build/CMake/DarwinSetup.cmake
+++ b/Code/Mantid/Build/CMake/DarwinSetup.cmake
@@ -102,6 +102,10 @@ endif()
 ###########################################################################
 # Mac-specific installation setup
 ###########################################################################
+
+set(CMAKE_MACOSX_RPATH 1)
+
+#set ( CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/${LIB_DIR};${CMAKE_INSTALL_PREFIX}/${PLUGINS_DIR};${CMAKE_INSTALL_PREFIX}/${PVPLUGINS_DIR} )
 set ( CMAKE_INSTALL_PREFIX "" )
 set ( CPACK_PACKAGE_EXECUTABLES MantidPlot )
 set ( INBUNDLE MantidPlot.app/ )
@@ -127,8 +131,10 @@ else()
  set ( CMAKE_OSX_SYSROOT /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk )
  set ( CMAKE_OSX_ARCHITECTURES x86_64 )
  set ( CMAKE_OSX_DEPLOYMENT_TARGET 10.8 )
- set ( PYQT4_PYTHONPATH /usr/local/lib/python${PY_VER}/site-packages/PyQt4 )
- set ( SITEPACKAGES /usr/local/lib/python${PY_VER}/site-packages )
+ #set ( PYQT4_PYTHONPATH /usr/local/lib/python${PY_VER}/site-packages/PyQt4 )
+ set  ( PYQT4_PYTHONPATH /usr/local/Cellar/pyqt/4.11.1/lib/python${PY_VER}/site-packages/PyQt4 )
+ #set ( SITEPACKAGES /usr/local/lib/python${PY_VER}/site-packages )
+ set  ( SITEPACKAGES /usr/local/Cellar/sip/4.16.3_1/lib/python${PY_VER}/site-packages )
  # use homebrew OpenSSL package
  set ( OPENSSL_ROOT_DIR /usr/local/opt/openssl )
 endif()
diff --git a/Code/Mantid/Framework/PythonInterface/mantid/api/CMakeLists.txt b/Code/Mantid/Framework/PythonInterface/mantid/api/CMakeLists.txt
index 278e1ff5abd..20d6dd2df29 100644
--- a/Code/Mantid/Framework/PythonInterface/mantid/api/CMakeLists.txt
+++ b/Code/Mantid/Framework/PythonInterface/mantid/api/CMakeLists.txt
@@ -130,7 +130,7 @@ set_target_output_directory ( PythonAPIModule ${OUTPUT_DIR} .pyd )
 
 # Add the required dependencies
 target_link_libraries ( PythonAPIModule PythonGeometryModule PythonKernelModule API )
-
+set_target_properties( PythonAPIModule PROPERTIES INSTALL_RPATH "@loader_path/../../;@loader_path/../kernel/")
 ###########################################################################
 # Installation settings
 ###########################################################################
diff --git a/Code/Mantid/Framework/PythonInterface/mantid/geometry/CMakeLists.txt b/Code/Mantid/Framework/PythonInterface/mantid/geometry/CMakeLists.txt
index 88a59fc6d3a..43dd2bebddd 100644
--- a/Code/Mantid/Framework/PythonInterface/mantid/geometry/CMakeLists.txt
+++ b/Code/Mantid/Framework/PythonInterface/mantid/geometry/CMakeLists.txt
@@ -71,7 +71,7 @@ set_python_properties( PythonGeometryModule _geometry )
 set_target_output_directory ( PythonGeometryModule ${OUTPUT_DIR} .pyd )
 # Add the required dependencies
 target_link_libraries ( PythonGeometryModule PythonKernelModule Geometry )
-
+set_target_properties ( PythonGeometryModule PROPERTIES INSTALL_RPATH "@loader_path/../../;@loader_path/../kernel/")
 ###########################################################################
 # Installation settings
 ###########################################################################
diff --git a/Code/Mantid/Framework/PythonInterface/mantid/kernel/CMakeLists.txt b/Code/Mantid/Framework/PythonInterface/mantid/kernel/CMakeLists.txt
index a04a8ca737d..72b5ee7a7e3 100644
--- a/Code/Mantid/Framework/PythonInterface/mantid/kernel/CMakeLists.txt
+++ b/Code/Mantid/Framework/PythonInterface/mantid/kernel/CMakeLists.txt
@@ -158,7 +158,7 @@ set_python_properties( PythonKernelModule _kernel )
 set_target_output_directory ( PythonKernelModule ${OUTPUT_DIR} .pyd )
 # Add the required dependencies
 target_link_libraries ( PythonKernelModule Kernel ${Boost_LIBRARIES} ${PYTHON_LIBRARIES} ${PYTHON_DEPS} )
-
+set_target_properties ( PythonKernelModule PROPERTIES INSTALL_RPATH "@loader_path/../../")
 ###########################################################################
 # Installation settings
 ###########################################################################
diff --git a/Code/Mantid/MantidPlot/CMakeLists.txt b/Code/Mantid/MantidPlot/CMakeLists.txt
index 8f22c8fb8b5..622c6640f5f 100644
--- a/Code/Mantid/MantidPlot/CMakeLists.txt
+++ b/Code/Mantid/MantidPlot/CMakeLists.txt
@@ -903,6 +903,7 @@ target_link_libraries ( MantidPlot
 )
 # Plugin dependencies
 add_dependencies( MantidPlot mantidqtpython )
+set_target_properties(MantidPlot PROPERTIES INSTALL_RPATH "@executable_path/")
 
 
 ###########################################################################
-- 
GitLab