]> SALOME platform Git repositories - modules/med.git/commitdiff
Salome HOME
End of reorganization of MEDCoupling wrapper for Renumber
authorageay <ageay>
Tue, 24 Sep 2013 10:06:15 +0000 (10:06 +0000)
committerageay <ageay>
Tue, 24 Sep 2013 10:06:15 +0000 (10:06 +0000)
src/RENUMBER_Swig/CMakeLists.txt
src/RENUMBER_Swig/MEDRenumberCommon.i
src/RENUMBER_Swig/MEDRenumberTest.py

index 70d49b65092a3681f0733b7b4e34049c4d71986b..a879a874c07f83843d9f6d8b72004e0eab4b9454 100644 (file)
@@ -29,6 +29,14 @@ ELSE(NUMPY_FOUND)
   SET(SWIG_MODULE_MEDRenumber_EXTRA_FLAGS -DWITHOUT_AUTOFIELD)
 ENDIF(NUMPY_FOUND)
 
+IF(Boost_FOUND)
+  SET(SWIG_MODULE_MEDRenumber_EXTRA_FLAGS -DHAS_BOOST ${SWIG_MODULE_MEDRenumber_EXTRA_FLAGS})
+ENDIF(Boost_FOUND)
+
+IF(METIS_FOUND)
+  SET(SWIG_MODULE_MEDRenumber_EXTRA_FLAGS -DHAS_METIS ${SWIG_MODULE_MEDRenumber_EXTRA_FLAGS})
+ENDIF(METIS_FOUND)
+
 SET (MEDRenumber_SWIG_DPYS_FILES
     MEDRenumberCommon.i)   
 
index b099f70b618fb7421056cf1e6caec743520feac5..81814916c23076368aeb9d2711f33c6bed08dc4b 100644 (file)
@@ -83,6 +83,21 @@ namespace MED_RENUMBER
   Renumbering *RenumberingFactory(const std::string& s) throw(INTERP_KERNEL::Exception);
 }
 
+%inline
+{
+  std::vector<std::string> RenumberAvailableMethods()throw(INTERP_KERNEL::Exception)
+  {
+    std::vector<std::string> ret;
+#ifdef HAS_BOOST
+    ret.push_back(std::string("BOOST"));
+#endif
+#ifdef HAS_METIS
+    ret.push_back(std::string("METIS"));
+#endif
+    return ret;
+  }
+}
+
 %pythoncode %{
 import os
 __filename=os.environ.get('PYTHONSTARTUP')
index 1539adf611e3265e0742ea7cf8033ec38e08f272..b0d9c41a323b9f9b7427b4450ce3ff6f87c2d53e 100644 (file)
@@ -2,6 +2,8 @@ from MEDRenumber import *
 import unittest
 
 class MEDRenumberTest(unittest.TestCase):
+
+    @unittest.skipUnless("BOOST" in RenumberAvailableMethods(),"requires BOOST prerequisite !")
     def test1(self):
         from MEDCoupling import MEDCouplingCMesh
         ren=RenumberingFactory("BOOST")