find_package (Local)
ENDIF (BUILD_LOCAL_SUBMISSION)
IF (BUILD_PYTHON_WRAPPING)
- FIND_PACKAGE(PythonInterp)
- IF (PYTHONINTERP_FOUND)
- get_filename_component(PYTHON_BIN_DIR "${PYTHON_EXECUTABLE}" PATH)
- get_filename_component(CMAKE_INCLUDE_PATH "${PYTHON_BIN_DIR}/../include/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}" ABSOLUTE)
- get_filename_component(CMAKE_LIBRARY_PATH "${PYTHON_BIN_DIR}/../lib" ABSOLUTE)
- ENDIF (PYTHONINTERP_FOUND)
- # Set PythonLibs_FIND_VERSION To avoid problems when several versions are in the system
- SET(PythonLibs_FIND_VERSION ${PYTHON_VERSION_STRING})
- set(PYTHON_ROOT_DIR $ENV{PYTHON_ROOT_DIR} CACHE PATH "Path to Python directory")
- if(EXISTS ${PYTHON_ROOT_DIR})
- if(WINDOWS)
- if(CMAKE_BUILD_TYPE STREQUAL Debug)
- SET(PYTHON_LIB_SUFFIX _d)
- else(CMAKE_BUILD_TYPE STREQUAL Debug)
- SET(PYTHON_LIB_SUFFIX)
- endif(CMAKE_BUILD_TYPE STREQUAL Debug)
- set(PYTHON_INCLUDE_DIR ${PYTHON_ROOT_DIR}/include)
- set(PYTHON_LIBRARY ${PYTHON_ROOT_DIR}/libs/python${PYTHON_VERSION_MAJOR}${PYTHON_VERSION_MINOR}${PYTHON_LIB_SUFFIX}${CMAKE_IMPORT_LIBRARY_SUFFIX})
- endif(WINDOWS)
- endif(EXISTS ${PYTHON_ROOT_DIR})
- FIND_PACKAGE(PythonLibs)
+ FIND_PACKAGE(LibbatchPYTHON)
FIND_PACKAGE(SWIG)
ENDIF (BUILD_PYTHON_WRAPPING)
--- /dev/null
+# Copyright (C) 2013 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+# Python detection for Salome
+
+set(PYTHON_ROOT_DIR $ENV{PYTHON_ROOT_DIR} CACHE PATH "Path to Python directory")
+
+if(WINDOWS)
+ if(CMAKE_BUILD_TYPE STREQUAL Debug)
+ SET(PythonInterp_FIND_VERSION _d)
+ SET(PYTHON_DEFINITIONS "-DHAVE_DEBUG_PYTHON")
+ endif(CMAKE_BUILD_TYPE STREQUAL Debug)
+endif(WINDOWS)
+
+find_package(PythonInterp REQUIRED)
+IF (PYTHONINTERP_FOUND)
+ get_filename_component(PYTHON_BIN_DIR "${PYTHON_EXECUTABLE}" PATH)
+ get_filename_component(CMAKE_INCLUDE_PATH "${PYTHON_BIN_DIR}/../include/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}" ABSOLUTE)
+ get_filename_component(CMAKE_LIBRARY_PATH "${PYTHON_BIN_DIR}/../lib" ABSOLUTE)
+ENDIF (PYTHONINTERP_FOUND)
+
+# Set PythonLibs_FIND_VERSION To avoid problems when several versions are in the system
+SET(PythonLibs_FIND_VERSION ${PYTHON_VERSION_STRING})
+if(EXISTS ${PYTHON_ROOT_DIR})
+ if(WINDOWS)
+ if(CMAKE_BUILD_TYPE STREQUAL Debug)
+ SET(PYTHON_LIB_SUFFIX _d)
+ else(CMAKE_BUILD_TYPE STREQUAL Debug)
+ SET(PYTHON_LIB_SUFFIX)
+ endif(CMAKE_BUILD_TYPE STREQUAL Debug)
+ set(PYTHON_INCLUDE_DIR ${PYTHON_ROOT_DIR}/include)
+ set(PYTHON_LIBRARY ${PYTHON_ROOT_DIR}/libs/python${PYTHON_VERSION_MAJOR}${PYTHON_VERSION_MINOR}${PYTHON_LIB_SUFFIX}${CMAKE_IMPORT_LIBRARY_SUFFIX})
+ endif(WINDOWS)
+endif(EXISTS ${PYTHON_ROOT_DIR})
+find_package(PythonLibs REQUIRED)