From: rnv Date: Mon, 15 Feb 2016 16:30:57 +0000 (+0300) Subject: Fix compilation with NumPy/SciPy. X-Git-Tag: V7_8_0a2~4 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=fa3a0a0a7b0730ef2742db42eedfa630e050af94;p=modules%2Fmed.git Fix compilation with NumPy/SciPy. --- diff --git a/CMakeLists.txt b/CMakeLists.txt index d101fc43e..9c44fa595 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -111,19 +111,12 @@ ENDIF(SALOME_BUILD_GUI) IF(SALOME_MED_ENABLE_PYTHON) FIND_PACKAGE(SalomePythonInterp) FIND_PACKAGE(SalomePythonLibs) + FIND_PACKAGE(SalomeNumPySciPy) FIND_PACKAGE(SalomeSWIG) SALOME_LOG_OPTIONAL_PACKAGE(PythonInterp SALOME_MED_ENABLE_PYTHON) SALOME_LOG_OPTIONAL_PACKAGE(PythonLibs SALOME_MED_ENABLE_PYTHON) SALOME_LOG_OPTIONAL_PACKAGE(SWIG SALOME_MED_ENABLE_PYTHON) FIND_PACKAGE(SalomeOmniORBPy REQUIRED) - # Set the extra flags for SWIG for numpy and scipy - SET(SWIG_EXTRA_FLAGS_FOR_NUMPYANDSCIPY) - IF(NUMPY_FOUND) - SET(SWIG_EXTRA_FLAGS_FOR_NUMPYANDSCIPY "-DWITH_NUMPY") - ENDIF(NUMPY_FOUND) - IF(SCIPY_FOUND) - SET(SWIG_EXTRA_FLAGS_FOR_NUMPYANDSCIPY "${SWIG_EXTRA_FLAGS_FOR_NUMPYANDSCIPY};-DWITH_SCIPY") - ENDIF(SCIPY_FOUND) ENDIF(SALOME_MED_ENABLE_PYTHON) IF(SALOME_BUILD_TESTS) diff --git a/src/MEDCalculator/Swig/CMakeLists.txt b/src/MEDCalculator/Swig/CMakeLists.txt index 09ecc549a..4d260a28d 100644 --- a/src/MEDCalculator/Swig/CMakeLists.txt +++ b/src/MEDCalculator/Swig/CMakeLists.txt @@ -18,13 +18,14 @@ # # Author : Anthony Geay (CEA/DEN) -ADD_DEFINITIONS(${PYTHON_DEFINITIONS}) +ADD_DEFINITIONS(${PYTHON_DEFINITIONS} ${NUMPY_DEFINITIONS} ${SCIPY_DEFINITIONS}) FIND_PACKAGE(SWIG REQUIRED) INCLUDE(${SWIG_USE_FILE}) INCLUDE_DIRECTORIES( ${PYTHON_INCLUDE_DIRS} + ${NUMPY_INCLUDE_DIR} ${MEDFILE_INCLUDE_DIRS} ${HDF5_INCLUDE_DIRS} ${MEDCOUPLING_INCLUDE_DIRS} @@ -43,7 +44,7 @@ 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") -SET(SWIG_MODULE_MEDCalculator_EXTRA_FLAGS ${SWIG_EXTRA_FLAGS_FOR_NUMPYANDSCIPY}) +SET(SWIG_MODULE_MEDCalculator_EXTRA_FLAGS "${NUMPY_DEFINITIONS};${SCIPY_DEFINITIONS}") SWIG_ADD_MODULE(MEDCalculator python MEDCalculator.i) SWIG_LINK_LIBRARIES(MEDCalculator ${PYTHON_LIBRARIES} medcalculator) diff --git a/src/MEDCouplingCorba_Swig/CMakeLists.txt b/src/MEDCouplingCorba_Swig/CMakeLists.txt index 169d2496b..da35ad5ce 100644 --- a/src/MEDCouplingCorba_Swig/CMakeLists.txt +++ b/src/MEDCouplingCorba_Swig/CMakeLists.txt @@ -20,20 +20,21 @@ ADD_SUBDIRECTORY(Client) -ADD_DEFINITIONS(${PYTHON_DEFINITIONS} ${OMNIORB_DEFINITIONS}) +ADD_DEFINITIONS(${PYTHON_DEFINITIONS} ${OMNIORB_DEFINITIONS} ${NUMPY_DEFINITIONS} ${SCIPY_DEFINITIONS}) FIND_PACKAGE(SWIG REQUIRED) INCLUDE(${SWIG_USE_FILE}) SET_SOURCE_FILES_PROPERTIES(MEDCouplingCorba.i PROPERTIES CPLUSPLUS ON) SET_SOURCE_FILES_PROPERTIES(MEDCouplingCorba.i PROPERTIES SWIG_DEFINITIONS "-shadow") -SET(SWIG_MODULE_MEDCouplingCorba_EXTRA_FLAGS ${SWIG_EXTRA_FLAGS_FOR_NUMPYANDSCIPY}) +SET(SWIG_MODULE_MEDCouplingCorba_EXTRA_FLAGS "${NUMPY_DEFINITIONS};${SCIPY_DEFINITIONS}") SET(MEDCouplingCorba_SWIG_DPYS_FILES MEDCouplingCorbaTypemaps.i) INCLUDE_DIRECTORIES( ${PYTHON_INCLUDE_DIRS} + ${NUMPY_INCLUDE_DIR} ${OMNIORB_INCLUDE_DIR} ${OMNIORB_INCLUDE_DIRS} ${MEDCOUPLING_INCLUDE_DIRS} ${CMAKE_CURRENT_BINARY_DIR}/../../idl diff --git a/src/MEDCouplingCorba_Swig/Client/CMakeLists.txt b/src/MEDCouplingCorba_Swig/Client/CMakeLists.txt index 2bcdd9559..ad0a32c7d 100644 --- a/src/MEDCouplingCorba_Swig/Client/CMakeLists.txt +++ b/src/MEDCouplingCorba_Swig/Client/CMakeLists.txt @@ -18,17 +18,18 @@ # # Author : Anthony Geay (CEA/DEN) -ADD_DEFINITIONS(${PYTHON_DEFINITIONS} ${OMNIORB_DEFINITIONS}) +ADD_DEFINITIONS(${PYTHON_DEFINITIONS} ${OMNIORB_DEFINITIONS} ${NUMPY_DEFINITIONS} ${SCIPY_DEFINITIONS}) FIND_PACKAGE(SWIG REQUIRED) INCLUDE(${SWIG_USE_FILE}) SET_SOURCE_FILES_PROPERTIES(MEDCouplingClient.i PROPERTIES CPLUSPLUS ON) SET_SOURCE_FILES_PROPERTIES(MEDCouplingClient.i PROPERTIES SWIG_DEFINITIONS "-shadow") -SET(SWIG_MODULE_MEDCouplingClient_EXTRA_FLAGS ${SWIG_EXTRA_FLAGS_FOR_NUMPYANDSCIPY}) +SET(SWIG_MODULE_MEDCouplingClient_EXTRA_FLAGS "${NUMPY_DEFINITIONS};${SCIPY_DEFINITIONS}") INCLUDE_DIRECTORIES( ${PYTHON_INCLUDE_DIRS} + ${NUMPY_INCLUDE_DIR} ${OMNIORB_INCLUDE_DIR} ${OMNIORB_INCLUDE_DIRS} ${MEDCOUPLING_INCLUDE_DIRS} ${CMAKE_CURRENT_BINARY_DIR}/../../../idl