the Calcium Extended Interface defined by header CalciumInterface.hxx.
),
],
includes="-I/usr/include",
+ calciumextendedinterface=1,
)
#include <unistd.h>
#include <Calcium.hxx>
-#include <calcium.h>
+#include <CalciumException.hxx>
+${CalciumInterface}
#include <signal.h>
#include <SALOME_NamingService.hxx>
#include <Utils_SALOME_Exception.hxx>
${servicesdef}
//ENDDEF
+#include <calcium.h>
+
extern "C" void cp_exit(int err);
extern "C" void F_FUNC(cpexit,CPEXIT)(int *err)
:param addmethods: 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
+ set this parameter to 1. By default its value is 0 so to not use extended interface. The extended interface requires boost as a dependency.
For example, the following call defines a standalone component named "mycompo" with one service s1 (it must have been defined before)::
"""
def __init__(self, name, services=None, libs="", rlibs="", includes="", kind="lib",
exe_path=None, sources=None, inheritedclass="", compodefs="",
- idls=None,interfacedefs="",inheritedinterface="",addedmethods=""):
+ idls=None,interfacedefs="",inheritedinterface="",addedmethods="",
+ calciumextendedinterface=0):
self.exe_path = exe_path
+ self.calciumextendedinterface=calciumextendedinterface
Component.__init__(self, name, services, impl="CPP", libs=libs, rlibs=rlibs,
includes=includes, kind=kind, sources=sources,
inheritedclass=inheritedclass, compodefs=compodefs, idls=idls,
instream=instream, outstream=outstream)
services.append(service)
inits.append(init)
+
+ CalciumInterface=""
+ if self.calciumextendedinterface:
+ CalciumInterface="#include <CalciumInterface.hxx>"
+
return cxxCompo.substitute(component=self.name, module=gen.module.name,
exe=exe, exe_path=self.exe_path,
servicesdef="\n".join(defs),
servicesimpl="\n".join(services),
- initservice='\n'.join(inits))
+ initservice='\n'.join(inits),
+ CalciumInterface=CalciumInterface)
#for catalog files
catalogfile = "%sCatalog.xml" % module.name
+ need_boost=0
+ for compo in module.components:
+ if hasattr(compo,"calciumextendedinterface") and compo.calciumextendedinterface:
+ need_boost=1
+ break
+
#add makefile definitions to make_common_starter.am
- common_starter = makecommon
+ other_includes=""
+ common_starter = makecommon.substitute(other_includes=other_includes)
for mod in self.used_modules:
common_starter = common_starter + salome_modules[mod]["makefiledefs"] + '\n'
other_summary=""
other_require=""
+ if need_boost:
+ other_check=other_check+"""CHECK_BOOST
+"""
+ other_summary=other_summary+"""echo " Boost ................. : $boost_ok"
+"""
+
if module.gui:
other_check=other_check + """CHECK_SALOME_GUI
CHECK_QT
for fidl in glob.glob(idl):
shutil.copyfile(fidl, os.path.join(namedir, "idl", os.path.basename(fidl)))
- for m4file in ("check_Kernel.m4", "check_omniorb.m4",
- "ac_linker_options.m4", "ac_cxx_option.m4",
- "python.m4", "enable_pthreads.m4", "check_f77.m4",
- "acx_pthread.m4", "check_boost.m4", "check_paco++.m4",
- "check_mpi.m4", "check_lam.m4", "check_openmpi.m4", "check_mpich.m4"):
+ checks= ("check_Kernel.m4", "check_omniorb.m4", "ac_linker_options.m4", "ac_cxx_option.m4",
+ "python.m4", "enable_pthreads.m4", "check_f77.m4", "acx_pthread.m4", "check_paco++.m4",
+ "check_mpi.m4", "check_lam.m4", "check_openmpi.m4", "check_mpich.m4")
+ if need_boost:
+ checks=checks+("check_boost.m4",)
+ for m4file in checks:
shutil.copyfile(os.path.join(self.kernel, "salome_adm", "unix", "config_files", m4file),
os.path.join(namedir, "adm_local", m4file))
AC_PROG_CC
AC_PROG_CXX
CHECK_F77
-CHECK_BOOST
CHECK_OMNIORB
CHECK_PACO
CHECK_MPI
echo " OmniOrb (CORBA) ........ : $$omniORB_ok"
echo " OmniOrbpy (CORBA) ...... : $$omniORBpy_ok"
echo " Python ................. : $$python_ok"
-echo " Boost ................. : $$boost_ok"
echo " SALOME KERNEL .......... : $$Kernel_ok"
echo " PaCO++ ................. : $$PaCO_ok"
echo " MPI .................... : $$mpi_ok"
makecommon="""
# Standard directory for installation
-salomeincludedir = $(includedir)/salome
-libdir = $(prefix)/lib/salome
-bindir = $(prefix)/bin/salome
-salomescriptdir = $(bindir)
-salomepythondir = $(prefix)/lib/python$(PYTHON_VERSION)/site-packages/salome
+salomeincludedir = $$(includedir)/salome
+libdir = $$(prefix)/lib/salome
+bindir = $$(prefix)/bin/salome
+salomescriptdir = $$(bindir)
+salomepythondir = $$(prefix)/lib/python$$(PYTHON_VERSION)/site-packages/salome
# Directory for installing idl files
-salomeidldir = $(prefix)/idl/salome
+salomeidldir = $$(prefix)/idl/salome
# Directory for installing resource files
-salomeresdir = $(prefix)/share/salome/resources/${MODULE_NAME}
+salomeresdir = $$(prefix)/share/salome/resources/$${MODULE_NAME}
# Directories for installing admin files
-admlocaldir = $(prefix)/adm_local
-admlocalunixdir = $(admlocaldir)/unix
-admlocalm4dir = $(admlocaldir)/unix/config_files
+admlocaldir = $$(prefix)/adm_local
+admlocalunixdir = $$(admlocaldir)/unix
+admlocalm4dir = $$(admlocaldir)/unix/config_files
# Shared modules installation directory
-sharedpkgpythondir =$(pkgpythondir)/shared_modules
+sharedpkgpythondir =$$(pkgpythondir)/shared_modules
# Documentation directory
-salomedocdir = $(prefix)/share/doc/salome/gui/${MODULE_NAME}
+salomedocdir = $$(prefix)/share/doc/salome/gui/$${MODULE_NAME}
-IDL_INCLUDES = -I$(KERNEL_ROOT_DIR)/idl/salome
-KERNEL_LIBS= -L$(KERNEL_ROOT_DIR)/lib/salome -lSalomeContainer -lOpUtil -lSalomeDSCContainer -lSalomeDSCSuperv -lSalomeDatastream -lSalomeDSCSupervBasic -lCalciumC
-KERNEL_INCLUDES= -I$(KERNEL_ROOT_DIR)/include/salome $(OMNIORB_INCLUDES) $(BOOST_CPPFLAGS)
+IDL_INCLUDES = -I$$(KERNEL_ROOT_DIR)/idl/salome
+KERNEL_LIBS= -L$$(KERNEL_ROOT_DIR)/lib/salome -lSalomeContainer -lOpUtil -lSalomeDSCContainer -lSalomeDSCSuperv -lSalomeDatastream -lSalomeDSCSupervBasic -lCalciumC
+KERNEL_INCLUDES= -I$$(KERNEL_ROOT_DIR)/include/salome $$(OMNIORB_INCLUDES) ${other_includes}
-SALOME_LIBS= ${KERNEL_LIBS}
-SALOME_IDL_LIBS= -L$(KERNEL_ROOT_DIR)/lib/salome -lSalomeIDLKernel
-SALOME_INCLUDES= ${KERNEL_INCLUDES}
+SALOME_LIBS= $${KERNEL_LIBS}
+SALOME_IDL_LIBS= -L$$(KERNEL_ROOT_DIR)/lib/salome -lSalomeIDLKernel
+SALOME_INCLUDES= $${KERNEL_INCLUDES}
"""
+makecommon=Template(makecommon)
resMakefile="""
include $$(top_srcdir)/adm_local/make_common_starter.am