]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
addition of numpy
authorageay <ageay>
Mon, 8 Jul 2013 10:36:06 +0000 (10:36 +0000)
committerageay <ageay>
Mon, 8 Jul 2013 10:36:06 +0000 (10:36 +0000)
salome_adm/cmake_files/FindSalomePython.cmake

index 754248dcff10f81559e1a8ecba38d88ee6a353b6..bdc75473f25b31bebdf03871af6ce73602e85a0e 100644 (file)
@@ -132,6 +132,19 @@ IF (SALOMEPYTHON_FOUND)
   ENDIF()
 
   # 6. Specifics
+
+  EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c "import numpy ; import sys ; sys.stdout.write(numpy.get_include())" OUTPUT_VARIABLE NUMPY_INCLUDE_DIR ERROR_QUIET )
+  IF(NUMPY_INCLUDE_DIR)
+    SET(NUMPY_FOUND TRUE)
+  ENDIF(NUMPY_INCLUDE_DIR)
+  IF(NUMPY_FOUND)
+    SET(PYTHON_INCLUDE_DIRS ${NUMPY_INCLUDE_DIR} ${PYTHON_INCLUDE_DIRS})
+    SET(PYTHON_DEFINITIONS "${PYTHON_DEFINITIONS} -DWITH_NUMPY")
+    MESSAGE(STATUS "numpy found : ${NUMPY_INCLUDE_DIR}")
+  ELSE(NUMPY_FOUND)
+    MESSAGE(STATUS "numpy not found")
+  ENDIF(NUMPY_FOUND)
+
   ## None here    
 ELSE()
   MESSAGE(STATUS "Python was only partially (or not at all) found .")