Salome HOME
Merge branch 'V9_2_2_BR'
[tools/yacsgen.git] / module_generator / cppcompo.py
index 4cc268d1c0ca2f971f599d436b08a6c7eeab6a3b..e670b3aefdc60e9e931dac294fee5890ca8ab2fe 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2009-2014  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
+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
 
 try:
   from string import Template
 except:
-  from compat import Template,set
+  from module_generator.compat import Template,set
 
 class CPPComponent(Component):
   """
@@ -59,7 +59,7 @@ class CPPComponent(Component):
    :param interfacedefs: can be used to add idl definitions (or includes of idl files) into the generated idl of the module.
    :param inheritedinterface: can be used to make the component inherit an extra idl interface that has been included through
       the *idls* and *interfacedefs* parameters. See the cppgui1 example for how to use these last parameters.
-   :param addmethods: is a C++ specific parameter that can be used to redefine a component method (DumpPython for example). This
+   :param addedmethods: is a C++ specific parameter that can be used to redefine a component method (DumpPython for example). This
       parameter is a string that must contain the definition and implementation code of the method. See the cppgui1 example
       for how to use it.
    :param calciumextendedinterface: if you want to use the Calcium extended interface for C++ as defined by the header CalciumInterface.hxx
@@ -121,6 +121,14 @@ class CPPComponent(Component):
        return a dict where key is the file name and value is the file content
     """
     (cmake_text, cmake_vars) = self.additionalLibraries()
+    # DSC_libs are needed for datastream ports only
+    DSC_libs = """${KERNEL_SalomeDSCContainer}
+  ${KERNEL_SalomeDSCSuperv}
+  ${KERNEL_SalomeDatastream}
+  ${KERNEL_SalomeDSCSupervBasic}
+  ${KERNEL_CalciumC}
+  """
+    cmake_vars = DSC_libs + cmake_vars
     cxxfile = "%s.cxx" % self.name
     hxxfile = "%s.hxx" % self.name
     if self.kind == "exe":