mg = module_generator.Module(compo, components=[salome_compo],
prefix=generate_dir, gui=gui_files)
g = sat_generator(mg, context)
+ print "CNC generate component!"
g.generate()
if use_autotools:
{
project_file_paths :
[
+ "/volatile/crouzet/SAT/TEST/TUTORIAL_COUPLING/Workdir/YACS/TUTO_COUPLING_PROJECT/tutorial_coupling.pyconf",
+ "/volatile/crouzet/SAT/TEST/SAT_NURESIM/nuresim.pyconf",
+ "/volatile/crouzet/SAT/TEST/SAT_SALOME/salome.pyconf",
+ "/volatile/crouzet/SAT/TEST/SAT_CORPUS/corpus.pyconf",
+ "/data/tmpsalome/salome/SAT-PROJECTS/NUMODIS/numodis.pyconf",
+ "/home/salome/SPN_PRIVATE/SAT5/PPGP-PROJECT/ppgp.pyconf",
+ "/home/salome/SPN_PRIVATE/SAT5/OSCAR-PROJECT/oscar.pyconf",
+ "/home/uranietm/proJET/saTJOBS/saT5/uranie.pyconf",
]
}
--- /dev/null
+Nicolas Crouzet (nicolas.crouzet@cea.fr)
--- /dev/null
+
+SUBDIRS = src
+
+#install-exec-hook:
+# cp -rf idl/* $(pythondir)/$(PACKAGE)
--- /dev/null
+This directory contains the tree directories to compile a C++ components linked with MED library.
+
+
+Component is based on automake.
+
+To INSTALL it : source salome environement file (for MED), then
+
+ mkdir ../:sat:{Cpp_Template_}CPP_BUILD
+ mkdir ../:sat:{Cpp_Template_}CPP_INSTALL
+ ./build_configure
+ cd ../:sat:{Cpp_Template_}CPP_BUILD
+ ../:sat:{Cpp_Template_}CPP_SRC/configure --prefix=<absolute path of :sat:{Cpp_Template_}CPP_INSTALL>
+ make
+ make install
+
+
--- /dev/null
+This directory is required do not remove this file
--- /dev/null
+
+python_cmd = env \
+ SELF_ROOT_DIR=$(prefix) \
+ REP_TESTS=$(prefix)/tests \
+ REP_MAIL=$(prefix)/tests/maillages \
+ PATH=$(bindir)/$(PACKAGE):$(PATH) \
+ PYTHONPATH=$(bindir)/$(PACKAGE):$(libdir)/$(PACKAGE):$(pythondir)/$(PACKAGE):$(PYTHONPATH) \
+ python
+
+check-local:
+ for f in X $(scripts_SCRIPTS) ; do \
+ if test $f != X ; then \
+ ( cd $(scriptsdir) && $(python_cmd) $f ) || exit 1 ; \
+ fi ; \
+ done
--- /dev/null
+SUFFIXES =
+
+# --------------------------------------------
+# *.i --> *_wrap.cxx
+# --------------------------------------------
+
+SUFFIXES += .i _wrap.cxx
+
+.i_wrap.cxx :
+ $(SWIG) $(SWIG_FLAGS) $(SWIG_PYTHON_INCLUDES) -o $@ $<
+
+
+#----------------------------------------------
+# Post-installation rules
+#----------------------------------------------
+
+install-exec-hook: install-swig
+
+install-swig: $(patsubst lib%.la, $(libdir)/_%.so, \
+ $(filter lib%SWIG.la, $(lib_LTLIBRARIES)))
+
+$(libdir)/_%.so: $(libdir)/lib%.so
+ ln -s `basename $^` $@
--- /dev/null
+#! /bin/bash
+
+#
+DIR=`echo $0 | sed -e "s,[^/]*$,,;s,/$,,;s,^$,.,"`
+cd ${DIR}
+DIR=`pwd`
+
+REP=`basename $DIR`
+
+if [ -z "$USER" ]
+then
+ USER=`whoami 2> /dev/null` || true
+fi
+
+mkdir -p /tmp/${USER}
+\rm -rf /tmp/${USER}/${REP}
+
+cd ${DIR}/..
+cp -drf ${REP} /tmp/${USER}/${REP}
+
+cd /tmp/${USER}/${REP}
+./root_clean
+find . -name "CVS" -depth -exec \rm -rf {} \;
+find . -type f -exec chmod u+rw {} \;
+
+cd /tmp/${USER}
+
+TAR_FILE=${REP}`date +_%d.%m.%Y_%H.%M`.tgz
+
+tar cvfz ${TAR_FILE} ${REP}
+
+cp ${TAR_FILE} ${DIR}/..
+
+\rm -rf /tmp/${USER}/${REP} ${TAR_FILE}
--- /dev/null
+#! /bin/bash
+
+run() {
+ local logfile=$ORIG_DIR/build_configure.log
+ printf "%-50s" "$1 ... "
+ eval $1 > $logfile 2>&1
+ if test $? != 0 ; then
+ echo "[FAILED]"
+ echo "see file build_configure.log ..."
+ exit 1
+ fi
+ echo "[ OK ]"
+}
+
+# --
+ORIG_DIR=`pwd`
+
+########################################################################
+# Test if the KERNEL_ROOT_DIR and MEDCOUPLING_ROOT_DIR are set correctly
+
+if test ! -d "${KERNEL_ROOT_DIR}"; then
+ echo "failed : KERNEL_ROOT_DIR variable is not correct !"
+ exit
+fi
+if test ! -d "${MEDCOUPLING_ROOT_DIR}"; then
+ echo "failed : MEDCOUPLING_ROOT_DIR variable is not correct !"
+ exit
+fi
+
+# --
+# -- goto build_configure dir
+CONF_DIR=`echo $0 | sed -e "s,[^/]*$,,;s,/$,,;s,^$,.,"`
+cd ${CONF_DIR}
+# --
+# -- list all Makefile.am in Makefile.am.list
+./rfind . Makefile.am > Makefile.am.list
+# --
+# -- configure.in construction
+cp configure.in.base configure.in
+chmod +w configure.in
+echo "AC_OUTPUT([ \\" >> configure.in
+sed -e 's,\.am, \\,' -e 's,\.\/,,' Makefile.am.list >> configure.in
+echo "])" >> configure.in
+
+# --
+run "libtoolize"
+run "aclocal -I adm/unix/config_files -I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files -I ${MEDCOUPLING_ROOT_DIR}/adm_local/unix/config_files"
+run "autoconf"
+run "automake --add-missing --copy"
+
--- /dev/null
+
+AC_INIT(salome, 0.1)
+AC_CONFIG_SRCDIR(src)
+AM_INIT_AUTOMAKE
+AC_ENABLE_DEBUG(no)
+AC_DISABLE_PRODUCTION
+
+AC_PROG_LIBTOOL
+AC_PROG_CXX
+AC_PROG_CXXCPP
+
+AC_LINKER_OPTIONS
+CHECK_PYTHON
+AM_PATH_PYTHON(2.2.1)
+CHECK_SWIG
+
+CHECK_KERNEL
+CHECK_MEDCOUPLING
+
+AC_ENABLE_STATIC(no)
+
+CXXFLAGS="${CXXFLAGS} -g"
+AC_SUBST(CXXFLAGS)
--- /dev/null
+#! /bin/bash
+
+#
+# Usage : rfind dir suffix ...
+#
+# find all files *suffix in dir in a recursive way
+# different of the usual command find ...
+#
+
+if test $# != 2 ; then
+ echo "Usage : $0 dir suffix"
+ exit
+fi
+
+local_find() {
+ # if the first argument is not a directory, returns
+ if test ! -d $1 ; then
+ # echo "$1 is not a directory"
+ return
+ fi
+ # dont look in the CVS directories
+ # dont look in the autom4te* directories
+ case "$1" in
+ */CVS) return ;;
+ */autom4te*) return ;;
+ *) ;;
+ esac
+ # for each regular file contained in the directory
+ # test if it's a *"$2" file
+ for i in $1/*
+ do
+ if test -f $i ; then
+ case `basename $i` in
+ *$2) echo " "$i ;;
+ *) ;;
+ esac
+ fi
+ done
+ # for each subdirectory of the first argument, proceeds recursively
+ for i in $1/*
+ do
+ local_find $i $2
+ done
+}
+
+local_find $1 $2
--- /dev/null
+#!/bin/bash
+
+
+CONF_DIR=`echo $0 | sed -e "s,[^/]*$,,;s,/$,,;s,^$,.,"`
+cd ${CONF_DIR}
+
+TO_CLEAN=
+TO_CLEAN=${TO_CLEAN}' aclocal.m4'
+TO_CLEAN=${TO_CLEAN}' autom4te*'
+TO_CLEAN=${TO_CLEAN}' configure'
+TO_CLEAN=${TO_CLEAN}' configure.in'
+TO_CLEAN=${TO_CLEAN}' install-sh missing mkinstalldirs'
+TO_CLEAN=${TO_CLEAN}' py-compile'
+TO_CLEAN=${TO_CLEAN}' build_configure.log'
+TO_CLEAN=${TO_CLEAN}' depcomp'
+TO_CLEAN=${TO_CLEAN}' config.guess config.sub ltmain.sh'
+TO_CLEAN=${TO_CLEAN}' Makefile.am.list'
+# TO_CLEAN=${TO_CLEAN}' COPYING INSTALL'
+
+rm -rf $TO_CLEAN > /dev/null
+
+l=`find . -name "Makefile.in"`
+
+if test X"$l" != X ; then
+ rm -f $l
+fi
+
+l=`find . -name "*~"`
+
+if test X"$l" != X ; then
+ rm -f $l
+fi
--- /dev/null
+#include ":sat:{Cpp_Template_}.hxx"
+// uncoment if the component uses MED
+//#include "MEDCouplingUMesh.hxx"
+//#include "MEDCouplingFieldDouble.hxx"
+#include <string>
+
+using namespace std;
+//using namespace MED_EN;
+
+:sat:{Cpp_Template_}:::sat:{Cpp_Template_}()
+{
+}
+
+// implement your methods
+double :sat:{Cpp_Template_}::plus(double _x, double _y)
+{
+ return _x+_y;
+}
+
--- /dev/null
+#ifndef _:sat:{Cpp_Template_}_HXX_
+#define _:sat:{Cpp_Template_}_HXX_
+
+// Uncomment if the component uses MEDCoupling
+// namespace MEDCoupling
+// {
+// class MEDCouplingUMesh;
+// class MEDCouplingFieldDouble;
+// }
+
+class :sat:{Cpp_Template_}
+{
+// public methods
+public:
+ :sat:{Cpp_Template_}();
+ // fill your methods
+ double plus(double x, double y);
+private:
+};
+
+#endif
--- /dev/null
+#
+# Common begin part
+#
+
+include $(top_srcdir)/adm/unix/make_begin.am
+
+#
+# Developper part
+#
+
+lib_LTLIBRARIES = lib:sat:{Cpp_Template_}CXX.la
+lib:sat:{Cpp_Template_}CXX_la_SOURCES = :sat:{Cpp_Template_}.cxx
+lib:sat:{Cpp_Template_}CXX_la_LIBADD = $(MEDCOUPLING_LDFLAGS) $(MED3_LIBS) $(HDF5_LIBS) -lmedcoupling -linterpkernel
+
+# exported headers
+library_includedir=$(includedir)
+library_include_HEADERS = :sat:{Cpp_Template_}.hxx
+
+INCLUDES = $(MEDCOUPLING_CXXFLAGS) $(MED3_INCLUDES) $(HDF5_INCLUDES) $(KERNEL_CXXFLAGS)
+
+bin_PROGRAMS = :sat:{Cpp_Template_}_test
+:sat:{Cpp_Template_}_test_SOURCES = main.cxx
+:sat:{Cpp_Template_}_test_LDADD = lib:sat:{Cpp_Template_}CXX.la $(MEDCOUPLING_LDFLAGS) -lmedcoupling -linterpkernel
+
+
+#
+# Common end part
+#
+
+include $(top_srcdir)/adm/unix/make_end.am
+
+
--- /dev/null
+#include ":sat:{Cpp_Template_}.hxx"
+// uncoment if the component uses MED
+// #include "MEDCouplingUMesh.hxx"
+// #include "MEDCouplingFieldDouble.hxx"
+#include <stdlib.h>
+
+using namespace std;
+int main(int argc, char ** argv)
+{
+ if (getenv("SALOME_trace") == NULL )
+ setenv("SALOME_trace","local",0);
+ :sat:{Cpp_Template_} myCalc;
+ // test myCalc component ...
+}
--- /dev/null
+%module :sat:{Cpp_Template_}SWIG
+
+%{
+#include <stdlib.h>
+#include ":sat:{Cpp_Template_}.hxx"
+%}
+
+/*
+ Initialisation block due to the LocalTraceCollector mechanism
+
+ */
+
+/* %include "MEDCouplingCommon.i" */
+
+%init %{
+ if (getenv("SALOME_trace") == NULL )
+ setenv("SALOME_trace","local",0);
+%}
+
+%include "std_vector.i"
+%include "std_string.i"
+
+namespace std {
+ %template(vectori) vector<int>;
+ %template(vectord) vector<double>;
+};
+
+
+%include ":sat:{Cpp_Template_}.hxx"
+
+
+
--- /dev/null
+#
+# Common begin part
+#
+
+include $(top_srcdir)/adm/unix/make_begin.am
+
+#
+# Developper part
+#
+
+lib_LTLIBRARIES = lib:sat:{Cpp_Template_}SWIG.la
+nodist_lib:sat:{Cpp_Template_}SWIG_la_SOURCES = :sat:{Cpp_Template_}_wrap.cxx
+
+BUILT_SOURCES = :sat:{Cpp_Template_}_wrap.cxx
+
+SWIG_PYTHON_INCLUDES = $(MEDCOUPLING_CXXFLAGS) -I$(top_srcdir)/src/:sat:{Cpp_Template_}/:sat:{Cpp_Template_}_CXX
+
+INCLUDES = -I$(top_srcdir)/src/:sat:{Cpp_Template_}/:sat:{Cpp_Template_}_CXX $(PYTHON_INCLUDES) $(MEDCOUPLING_CXXFLAGS) $(MED3_INCLUDES) $(KERNEL_CXXFLAGS)
+
+lib:sat:{Cpp_Template_}SWIG_la_LIBADD = -L../:sat:{Cpp_Template_}_CXX -l:sat:{Cpp_Template_}CXX $(MEDCOUPLING_LDFLAGS)
+
+
+bin_SCRIPTS = :sat:{Cpp_Template_}SWIG.py
+
+clean-local:
+ $(RM) :sat:{Cpp_Template_}SWIG.py :sat:{Cpp_Template_}_wrap.cxx
+
+#
+# Common end part
+#
+
+include $(top_srcdir)/adm/unix/make_end.am
--- /dev/null
+from os import getenv
+if getenv("SALOMEPATH"):
+ import salome
+ import :sat:{Cpp_Template_}_ORB
+ my_:sat:{Cpp_Template_} = salome.lcc.FindOrLoadComponent("FactoryServer", ":sat:{Cpp_Template_}")
+ IN_SALOME_GUI = 1
+else:
+ import :sat:{Cpp_Template_}SWIG
+ my_:sat:{Cpp_Template_}=:sat:{Cpp_Template_}SWIG.:sat:{Cpp_Template_}()
+pass
+#
+#
+print "Test Program of :sat:{Cpp_Template_} component"
+
+# ...
+
--- /dev/null
+# data_DATA =
+# datadir =
+
+scripts_SCRIPTS = :sat:{Cpp_Template_}_test.py
+scriptsdir = $(prefix)/bin
+
+include $(top_srcdir)/adm/unix/make_check.am
--- /dev/null
+SUBDIRS = :sat:{Cpp_Template_}_CXX :sat:{Cpp_Template_}_SWIG :sat:{Cpp_Template_}_TEST
+
+
--- /dev/null
+SUBDIRS = :sat:{Cpp_Template_}
+
--- /dev/null
+#!/usr/bin/env python
+#-*- coding:utf-8 -*-
+
+# description of the template to be displayed with option --info
+info = """
+Author: CEA
+Description: This template can be used to create c++ component.
+Remark:
+ * The name of the module must be suffixed with 'CPP'.
+ * This module will compiled with med 3.
+ * Once the module is compiled use the generate command to create the SALOME module.
+ * The generate command requires a version of YACSGEN greater or equal to 6.5.0.
+"""
+
+# code to subsitute with component name
+file_subst = "Cpp_Template_"
+
+# delimiter used in the template (default is ':sat:')
+#delimiter = ":sat:"
+
+# filter of files to ignore for substitution
+# if not defined all files will be parsed
+ignore_filters = '*.png'
+
+# list of parameters
+# a string = parameter name
+# a tuple = (parameter name, default value, prompt, validation method)
+parameters = [
+ (file_subst, "%(NAME)s"),
+ ("get_method", "dir", "archive", "get method for prepare", lambda l: l in ['cvs', 'git', 'archive', 'dir'])
+ ]
+
+# configuration to use this component with sat
+pyconf = """
+ default :
+ {
+ name : "%(NAME)sCPP"
+ component_name : "%(NAME)s"
+ get_source : '%(get_method)s'
+ build_source : 'autotools'
+ git_info:
+ {
+ repo : 'to be filled'
+ tag : 'to be filled'
+ }
+ archive_info:
+ {
+ archive_name : '%(target)s'
+ }
+ dir_info:
+ {
+ dir : '%(target)s'
+ }
+ source_dir : $APPLICATION.workdir + $VARS.sep + 'SOURCES' + $VARS.sep + $name
+ build_dir : $APPLICATION.workdir + $VARS.sep + 'BUILD' + $VARS.sep + $name
+ depend : [
+ 'hdf5',
+ 'med',
+ 'qt',
+ 'Python',
+ 'omniORB',
+ 'omniORBpy',
+ 'boost' ,
+ 'cppunit' ,
+ 'KERNEL',
+ 'GUI',
+ 'MED'
+ ]
+ opt_depend : []
+ properties :
+ {
+ cpp : "yes"
+ generate : "yes"
+ has_salome_gui : "yes"
+ logo : $source_dir + "/resources/%(NAME)s.png"
+ }
+ }
+"""
AM_INIT_AUTOMAKE
AC_ENABLE_DEBUG(no)
AC_DISABLE_PRODUCTION
+CXXFLAGS="$CXXFLAGS -std=c++11"
AC_PROG_LIBTOOL
AC_PROG_CXX