]> SALOME platform Git repositories - tools/libbatch.git/commitdiff
Salome HOME
Win32 compatibility BR_2_0_0_WIN V2_0_0_WIN
authorana <ana@opencascade.com>
Wed, 26 Jun 2013 15:29:04 +0000 (15:29 +0000)
committerana <ana@opencascade.com>
Wed, 26 Jun 2013 15:29:04 +0000 (15:29 +0000)
CMakeLists.txt
CMakeModules/FindLibbatchPYTHON.cmake [new file with mode: 0755]

index e9b6f933a6618e0514464bcb6e07e61319cea5a2..3903dccb4b4d3f33ae293bebf10aa088b9553a06 100644 (file)
@@ -39,27 +39,7 @@ IF (BUILD_LOCAL_SUBMISSION)
     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)
 
diff --git a/CMakeModules/FindLibbatchPYTHON.cmake b/CMakeModules/FindLibbatchPYTHON.cmake
new file mode 100755 (executable)
index 0000000..1a74a6c
--- /dev/null
@@ -0,0 +1,51 @@
+# 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)