From d29cd0585c7dacc64d204c8393a66e641bcf4391 Mon Sep 17 00:00:00 2001 From: rnv Date: Wed, 1 Feb 2017 16:03:40 +0300 Subject: [PATCH] Integration of a patch in the V7_8_BR by CEA request --- module_generator/gener.py | 31 ++++++++++++++++++++++++++++--- module_generator/hxxcompo.py | 3 ++- 2 files changed, 30 insertions(+), 4 deletions(-) diff --git a/module_generator/gener.py b/module_generator/gener.py index 3a001df..f03d799 100644 --- a/module_generator/gener.py +++ b/module_generator/gener.py @@ -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() diff --git a/module_generator/hxxcompo.py b/module_generator/hxxcompo.py index 738052e..46d2f13 100644 --- a/module_generator/hxxcompo.py +++ b/module_generator/hxxcompo.py @@ -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", -- 2.39.2