From 973e965c3f62b941cc3afac1729b1d99a96795cc Mon Sep 17 00:00:00 2001 From: vsr Date: Fri, 20 Jan 2017 14:10:12 +0300 Subject: [PATCH] Patch for MacOS (from SALOME forum) --- CMakeModules/FindLibbatchPython.cmake | 13 ++++++++++++- src/Core/Couple.cxx | 1 + 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/CMakeModules/FindLibbatchPython.cmake b/CMakeModules/FindLibbatchPython.cmake index 6c3ecda..fa2900c 100644 --- a/CMakeModules/FindLibbatchPython.cmake +++ b/CMakeModules/FindLibbatchPython.cmake @@ -27,7 +27,18 @@ # 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}") diff --git a/src/Core/Couple.cxx b/src/Core/Couple.cxx index dddf1c9..ec78b34 100644 --- a/src/Core/Couple.cxx +++ b/src/Core/Couple.cxx @@ -30,6 +30,7 @@ */ #include "Couple.hxx" +#include using namespace std; namespace Batch { -- 2.39.2