]> SALOME platform Git repositories - modules/med.git/commitdiff
Salome HOME
Fix compilation with NumPy/SciPy.
authorrnv <rnv@opencascade.com>
Mon, 15 Feb 2016 16:30:57 +0000 (19:30 +0300)
committerrnv <rnv@opencascade.com>
Mon, 15 Feb 2016 16:30:57 +0000 (19:30 +0300)
CMakeLists.txt
src/MEDCalculator/Swig/CMakeLists.txt
src/MEDCouplingCorba_Swig/CMakeLists.txt
src/MEDCouplingCorba_Swig/Client/CMakeLists.txt

index d101fc43e4bc7fc30e0d7499c6524be93779eb34..9c44fa5955fc22e91b4182510893d3e22cbb51ef 100644 (file)
@@ -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)
index 09ecc549a3d166213399a2b819b8a505da9c4d67..4d260a28d76fc42c86dfb4f2370081893c3b38af 100644 (file)
 #
 # 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)
 
index 169d2496b6d2be829ef82612a29f2dba664693fe..da35ad5ce50c0c2cec61ca2e77bfaeaff7c9dfc2 100644 (file)
 
 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
index 2bcdd9559dfe52f30ff66e3c5802c8ef8533bf30..ad0a32c7d29f58201cbddbca177ac103b02c3876 100644 (file)
 #
 # 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