From: ageay Date: Mon, 8 Jul 2013 10:41:26 +0000 (+0000) Subject: addition of numpy X-Git-Tag: B4KillOfAutomake~55 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=0921d3327acfb76c52e366c4fdf6cdd6b57bc6e6;p=modules%2Fmed.git addition of numpy --- diff --git a/adm_local_without_kernel/cmake_files/FindSalomePython.cmake b/adm_local_without_kernel/cmake_files/FindSalomePython.cmake index 754248dcf..bdc75473f 100644 --- a/adm_local_without_kernel/cmake_files/FindSalomePython.cmake +++ b/adm_local_without_kernel/cmake_files/FindSalomePython.cmake @@ -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 .") diff --git a/src/MEDCalculator/Swig/CMakeLists.txt b/src/MEDCalculator/Swig/CMakeLists.txt index 3634a39e0..33748f178 100644 --- a/src/MEDCalculator/Swig/CMakeLists.txt +++ b/src/MEDCalculator/Swig/CMakeLists.txt @@ -48,9 +48,9 @@ INSTALL(TARGETS medcalculatorspython DESTINATION ${SALOME_INSTALL_LIBS}) SET_SOURCE_FILES_PROPERTIES(MEDCalculator.i PROPERTIES CPLUSPLUS ON) SET_SOURCE_FILES_PROPERTIES(MEDCalculator.i PROPERTIES SWIG_DEFINITIONS "-shadow") -IF(NUMPY_STATUS) +IF(NUMPY_FOUND) SET(SWIG_MODULE_MEDCalculator_EXTRA_FLAGS -DWITH_NUMPY) -ENDIF(NUMPY_STATUS) +ENDIF(NUMPY_FOUND) SWIG_ADD_MODULE(MEDCalculator python MEDCalculator.i) SWIG_LINK_LIBRARIES(MEDCalculator ${PYTHON_LIBS} medcalculator) diff --git a/src/MEDCouplingCorba_Swig/CMakeLists.txt b/src/MEDCouplingCorba_Swig/CMakeLists.txt index 0af175e64..0ab95cd7a 100644 --- a/src/MEDCouplingCorba_Swig/CMakeLists.txt +++ b/src/MEDCouplingCorba_Swig/CMakeLists.txt @@ -25,9 +25,9 @@ INCLUDE(${SWIG_USE_FILE}) SET_SOURCE_FILES_PROPERTIES(MEDCouplingCorba.i PROPERTIES CPLUSPLUS ON) SET_SOURCE_FILES_PROPERTIES(MEDCouplingCorba.i PROPERTIES SWIG_DEFINITIONS "-shadow") -IF(NUMPY_STATUS) +IF(NUMPY_FOUND) SET(SWIG_MODULE_MEDCouplingCorba_EXTRA_FLAGS -DWITH_NUMPY) -ENDIF(NUMPY_STATUS) +ENDIF(NUMPY_FOUND) SET(MEDCouplingCorba_SWIG_DPYS_FILES MEDCouplingCorbaTypemaps.i) diff --git a/src/MEDCoupling_Swig/CMakeLists.txt b/src/MEDCoupling_Swig/CMakeLists.txt index 8e3e4a74d..0036a2081 100644 --- a/src/MEDCoupling_Swig/CMakeLists.txt +++ b/src/MEDCoupling_Swig/CMakeLists.txt @@ -21,9 +21,9 @@ INCLUDE(${SWIG_USE_FILE}) SET_SOURCE_FILES_PROPERTIES(MEDCoupling.i PROPERTIES CPLUSPLUS ON) SET_SOURCE_FILES_PROPERTIES(MEDCoupling.i PROPERTIES SWIG_DEFINITIONS "-shadow") -IF(NUMPY_STATUS) +IF(NUMPY_FOUND) SET(SWIG_MODULE_MEDCoupling_EXTRA_FLAGS -DWITH_NUMPY) -ENDIF(NUMPY_STATUS) +ENDIF(NUMPY_FOUND) SET (MEDCoupling_SWIG_DPYS_FILES MEDCouplingCommon.i