]> SALOME platform Git repositories - tools/yacsgen.git/commitdiff
Salome HOME
Integration of a patch in the V7_8_BR by CEA request V7_8_BR V7_8_2
authorrnv <rnv@opencascade.com>
Wed, 1 Feb 2017 13:03:40 +0000 (16:03 +0300)
committerrnv <rnv@opencascade.com>
Wed, 1 Feb 2017 13:03:40 +0000 (16:03 +0300)
module_generator/gener.py
module_generator/hxxcompo.py

index 3a001dfb7d1960386058eb863569d301c3d56848..f03d79947e6bfa6c138c249f7ea16c19e9dd4a31 100644 (file)
@@ -438,8 +438,30 @@ class Generator(object):
     prefix = os.path.abspath(self.module.prefix)
     component_libs = "".join(map(lambda x: x.libraryName()+" ",
                                            module.components))
-    add_modules = "".join(map(lambda x:cmake_find_module.substitute(module=x),
-                                       self.used_modules))
+    add_modules = ""
+    for x in self.used_modules:
+      cmake_text = cmake_find_module.substitute(module=x)
+      if x == "MED":
+        cmake_text += """
+
+#####################################
+# FIND MEDCOUPLING
+#####################################
+SET(MEDCOUPLING_ROOT_DIR $ENV{MEDCOUPLING_ROOT_DIR} CACHE PATH "Path to MEDCOUPLING module")
+IF(EXISTS ${MEDCOUPLING_ROOT_DIR})
+  LIST(APPEND CMAKE_MODULE_PATH "${MEDCOUPLING_ROOT_DIR}/cmake_files")
+  FIND_PACKAGE(SalomeMEDCoupling REQUIRED)
+  ADD_DEFINITIONS(${MEDCOUPLING_DEFINITIONS})
+  INCLUDE_DIRECTORIES(${MEDCOUPLING_INCLUDE_DIRS})
+ELSE(EXISTS ${MEDCOUPLING_ROOT_DIR})
+  MESSAGE(FATAL_ERROR "We absolutely need MEDCOUPLING module, please define MEDCOUPLING_ROOT_DIR")
+ENDIF(EXISTS ${MEDCOUPLING_ROOT_DIR})
+#####################################
+
+"""
+      add_modules = add_modules + cmake_text
+      pass
+
     self.makeFiles({"CMakeLists.txt":cmake_root_cpp.substitute(
                                                  module=self.module.name,
                                                  module_min=self.module.name.lower(),
@@ -801,7 +823,10 @@ class Generator(object):
     """
     for name, content in dic.items():
       filename = os.path.join(basedir, name)
-      if isinstance(content, str):
+      if isinstance(content, basestring):
+        if isinstance(content, unicode): 
+            # encodage to utf-8 if unicode string
+            content=content.encode('utf8')
         fil =  open(filename, 'w')
         fil.write(content)
         fil.close()
index 738052ebb5448cbdacf7422854e8c2e61f556512..46d2f1344f4500d97c41b626d059eef7810f1c0e 100644 (file)
@@ -459,7 +459,8 @@ class HXX2SALOMEComponent(Component):
       gui_xml_fr=hxxgui_xml_fr.substitute(component_name=self.name)
       gui_xml_en=hxxgui_xml_en.substitute(component_name=self.name)
       gui_salomeapp_gen=cppsalomeapp.substitute(module=self.name,
-                                                lmodule=self.name.lower())
+                                                lmodule=self.name.lower(),
+                                                version="V0")
       # for a salome component generated by hxx2salome from a c++ component, 
       # the documentation points at the c++ component documentation
       salome_doc_path=os.path.join("%"+self.name+"_ROOT_DIR%","share",