Salome HOME
spns #32926: backport KERNEL & CONFIGURATION fixes on more recent platforms to ensure...
[tools/sat_salome.git] / products / patches / yacsgen_7_8_portage.patch
1 diff --git a/module_generator/gener.py b/module_generator/gener.py
2 index 3a001df..f03d799 100644
3 --- a/module_generator/gener.py
4 +++ b/module_generator/gener.py
5 @@ -438,8 +438,30 @@ class Generator(object):
6      prefix = os.path.abspath(self.module.prefix)
7      component_libs = "".join(map(lambda x: x.libraryName()+" ",
8                                             module.components))
9 -    add_modules = "".join(map(lambda x:cmake_find_module.substitute(module=x),
10 -                                       self.used_modules))
11 +    add_modules = ""
12 +    for x in self.used_modules:
13 +      cmake_text = cmake_find_module.substitute(module=x)
14 +      if x == "MED":
15 +        cmake_text += """
16 +
17 +#####################################
18 +# FIND MEDCOUPLING
19 +#####################################
20 +SET(MEDCOUPLING_ROOT_DIR $ENV{MEDCOUPLING_ROOT_DIR} CACHE PATH "Path to MEDCOUPLING module")
21 +IF(EXISTS ${MEDCOUPLING_ROOT_DIR})
22 +  LIST(APPEND CMAKE_MODULE_PATH "${MEDCOUPLING_ROOT_DIR}/cmake_files")
23 +  FIND_PACKAGE(SalomeMEDCoupling REQUIRED)
24 +  ADD_DEFINITIONS(${MEDCOUPLING_DEFINITIONS})
25 +  INCLUDE_DIRECTORIES(${MEDCOUPLING_INCLUDE_DIRS})
26 +ELSE(EXISTS ${MEDCOUPLING_ROOT_DIR})
27 +  MESSAGE(FATAL_ERROR "We absolutely need MEDCOUPLING module, please define MEDCOUPLING_ROOT_DIR")
28 +ENDIF(EXISTS ${MEDCOUPLING_ROOT_DIR})
29 +#####################################
30 +
31 +"""
32 +      add_modules = add_modules + cmake_text
33 +      pass
34 +
35      self.makeFiles({"CMakeLists.txt":cmake_root_cpp.substitute(
36                                                   module=self.module.name,
37                                                   module_min=self.module.name.lower(),
38 @@ -801,7 +823,10 @@ class Generator(object):
39      """
40      for name, content in dic.items():
41        filename = os.path.join(basedir, name)
42 -      if isinstance(content, str):
43 +      if isinstance(content, basestring):
44 +        if isinstance(content, unicode): 
45 +            # encodage to utf-8 if unicode string
46 +            content=content.encode('utf8')
47          fil =  open(filename, 'w')
48          fil.write(content)
49          fil.close()
50 diff --git a/module_generator/hxxcompo.py b/module_generator/hxxcompo.py
51 index 738052e..46d2f13 100644
52 --- a/module_generator/hxxcompo.py
53 +++ b/module_generator/hxxcompo.py
54 @@ -459,7 +459,8 @@ class HXX2SALOMEComponent(Component):
55        gui_xml_fr=hxxgui_xml_fr.substitute(component_name=self.name)
56        gui_xml_en=hxxgui_xml_en.substitute(component_name=self.name)
57        gui_salomeapp_gen=cppsalomeapp.substitute(module=self.name,
58 -                                                lmodule=self.name.lower())
59 +                                                lmodule=self.name.lower(),
60 +                                                version="V0")
61        # for a salome component generated by hxx2salome from a c++ component, 
62        # the documentation points at the c++ component documentation
63        salome_doc_path=os.path.join("%"+self.name+"_ROOT_DIR%","share",