]> SALOME platform Git repositories - tools/libbatch.git/commitdiff
Salome HOME
Patch for MacOS (from SALOME forum)
authorvsr <vsr@opencascade.com>
Fri, 20 Jan 2017 11:10:12 +0000 (14:10 +0300)
committervsr <vsr@opencascade.com>
Fri, 20 Jan 2017 11:10:12 +0000 (14:10 +0300)
CMakeModules/FindLibbatchPython.cmake
src/Core/Couple.cxx

index 6c3ecdaea841631b5738bb449ecca6d1059aa8e8..fa2900c6b40be6b9564d7a5e2d4c6da66e299d81 100644 (file)
 # 1. Load environment or any previously detected Python
 IF(DEFINED ENV{PYTHON_ROOT_DIR})
   FILE(TO_CMAKE_PATH "$ENV{PYTHON_ROOT_DIR}" _PYTHON_ROOT_DIR_ENV)
-  SET(_dflt_value "${_PYTHON_ROOT_DIR_ENV}")
+  IF(APPLE)
+    SET(_dflt_value "${_PYTHON_ROOT_DIR_ENV}/Python.framework/Versions/Current")
+    SET(PYTHON_LIBRARY "${_PYTHON_ROOT_DIR_ENV}/Python.framework/Versions/Current/lib/libpython2.7.dylib")
+    SET(PYTHON_INCLUDE_DIR "${_PYTHON_ROOT_DIR_ENV}/Python.framework/Versions/Current/Headers")
+    LIST(APPEND CMAKE_PREFIX_PATH "${_dflt_value}")
+    FIND_PACKAGE(PythonLibs)
+    MESSAGE(STATUS "Mac Python: ${_dflt_value}")
+    MESSAGE(STATUS "Python libraries: ${PYTHON_LIBRARY}")
+    MESSAGE(STATUS "Python include dir: ${PYTHON_INCLUDE_DIR}")
+  ELSE(APPLE)
+    SET(_dflt_value "${_PYTHON_ROOT_DIR_ENV}")
+  ENDIF(APPLE)
 ELSE()
   # will be blank if no Python was previously loaded
   SET(_dflt_value "${PYTHON_ROOT_DIR_EXP}")
index dddf1c92c5600b806020d3815c744da0d96e6e5a..ec78b34aeae804efeb9adc7ed951bbc9c982f290 100644 (file)
@@ -30,6 +30,7 @@
  */
 
 #include "Couple.hxx"
+#include <iostream>
 using namespace std;
 
 namespace Batch {