-# Copyright (C) 2009-2015 EDF R&D
+# Copyright (C) 2009-2019 EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
"""
import os
-from gener import Component, Invalid
-from cpp_tmpl import initService, cxxService, hxxCompo, cxxCompo
-from cpp_tmpl import exeCPP, cmake_src_compo_cpp
-from yacstypes import corba_rtn_type, corba_in_type
-import mpi_tmpl
-from cppcompo import CPPComponent
+from module_generator.gener import Component, Invalid
+from module_generator.cpp_tmpl import initService, cxxService, hxxCompo, cxxCompo
+from module_generator.cpp_tmpl import exeCPP, cmake_src_compo_cpp
+from module_generator.yacstypes import corba_rtn_type, corba_in_type
+from module_generator import mpi_tmpl
+from module_generator.cppcompo import CPPComponent
try:
from string import Template
except:
- from compat import Template,set
+ from module_generator.compat import Template,set
class MPIComponent(CPPComponent):
"""
:param name: gives the name of the component.
:type name: str
:param services: the list of services (:class:`Service`) of the component.
- :param kind: If it is given and has the value "exe", the component will be built as a standalone
- component (executable or shell script). The default is to build the component as a dynamic library.
+ :param kind: For this type of component, "lib" is the unique valid option. The component is built as a dynamic library.
:param libs: list of the additional libraries. see *Library* class.
If you want to add "libmylib.so", installed in "/path/to/lib" you should use:
libs=[Library(name="mylib", path="/path/to/lib")]
cmake_vars = "${KERNEL_SalomeMPIContainer}\n " + cmake_vars
cxxfile = "%s.cxx" % self.name
hxxfile = "%s.hxx" % self.name
- if self.kind == "exe":
- exe_opt = 1
- else:
- exe_opt = 0
- ret = { cxxfile:self.makecxx(gen, exe_opt),
+ ret = { cxxfile:self.makecxx(gen),
hxxfile:self.makehxx(gen)
}
sources = " ".join(map(os.path.basename,self.sources))
servicesdef=servicesdef, inheritedclass=inheritedclass,
compodefs=compodefs)
- def makecxx(self, gen, exe=0):
+ def makecxx(self, gen):
"""return a string that is the content of .cxx file
"""
services = []
if self.interfacedefs:
idldefs = idldefs + self.interfacedefs
return idldefs
+
+ def additionalLibraries(self):
+ cmake_text, cmake_vars = Component.additionalLibraries(self)
+ if "MED" in self.getDependentModules():
+ cmake_vars = cmake_vars + """
+ ${MED_paramedmemcompo}
+ ${MED_paramedcouplingcorba}
+"""
+ return cmake_text, cmake_vars
+