From c5e26cd3f2e75bee199dd946627f88924b205adf Mon Sep 17 00:00:00 2001 From: adam Date: Mon, 18 Oct 2010 12:15:27 +0000 Subject: [PATCH] numpy support. Contribution of Anthony. --- salome_adm/cmake_files/FindPYTHON.cmake | 20 ++++++++++++++++++++ salome_adm/cmake_files/FindSWIG.cmake | 6 ++++++ 2 files changed, 26 insertions(+) diff --git a/salome_adm/cmake_files/FindPYTHON.cmake b/salome_adm/cmake_files/FindPYTHON.cmake index dc643da1c..1748b93c3 100644 --- a/salome_adm/cmake_files/FindPYTHON.cmake +++ b/salome_adm/cmake_files/FindPYTHON.cmake @@ -199,6 +199,26 @@ ENDIF(PYTHON_STATUS) # ---- +SET(NUMPY_STATUS 0) +IF(PYTHON_STATUS) + 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_STATUS 1) + ENDIF(NUMPY_INCLUDE_DIR) + IF(NUMPY_STATUS) + SET(PYTHON_INCLUDES ${PYTHON_INCLUDES} -I${NUMPY_INCLUDE_DIR}) + MESSAGE(STATUS "numpy found : ${NUMPY_INCLUDE_DIR}") + ELSE(NUMPY_STATUS) + MESSAGE(STATUS "numpy not found") + ENDIF(NUMPY_STATUS) +ENDIF(PYTHON_STATUS) + +# ---- + IF(PYTHON_STATUS) SET(PYTHON_CPPFLAGS ${PYTHON_INCLUDES}) SET(PYLOGLEVEL WARNING) diff --git a/salome_adm/cmake_files/FindSWIG.cmake b/salome_adm/cmake_files/FindSWIG.cmake index 8f06c4e47..ed19d078f 100644 --- a/salome_adm/cmake_files/FindSWIG.cmake +++ b/salome_adm/cmake_files/FindSWIG.cmake @@ -91,3 +91,9 @@ ELSE(SWIG_STATUS) ENDIF(SWIG_STATUS) # ---- + +IF(NUMPY_STATUS) + SET(SWIG_FLAGS ${SWIG_FLAGS} -DWITH_NUMPY=WITH_NUMPY) +ENDIF(NUMPY_STATUS) + +# ---- -- 2.39.2