1 # Copyright (C) 2006-2016 CEA/DEN, EDF R&D
3 # This library is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU Lesser General Public
5 # License as published by the Free Software Foundation; either
6 # version 2.1 of the License, or (at your option) any later version.
8 # This library is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 # Lesser General Public License for more details.
13 # You should have received a copy of the GNU Lesser General Public
14 # License along with this library; if not, write to the Free Software
15 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 generate_cpp_module_source()
21 if [ ${BE_QUIET} -lt 1 ] ; then
22 echo -e "\n\n\tC++ wrapper generation"
26 # ------------------------- C++ generation ------------------------------------------------------
27 sed -e "s/SUBDIRS = /SUBDIRS = ${CLASS_NAME}_CPP /" < ${CLASS_NAME}_SRC/src/Makefile.am > ${CLASS_NAME}_SRC/src/tmpfile
28 \mv -f ${CLASS_NAME}_SRC/src/tmpfile ${CLASS_NAME}_SRC/src/Makefile.am
30 if [ ${BE_QUIET} -lt 1 ] ; then
31 echo -e "\n\n-> Generate Salome2 C++ files\n"
33 cat ${CLASS_NAME}_public_functions |\
34 awk -v class_name=${CLASS_NAME} -f ${gene_dir}/parse4.awk
35 echo "#include \""`basename ${hxx_file}`"\"" > ${CLASS_NAME}_SRC/src/${CLASS_NAME}_CPP/${CLASS_NAME}_CPP.cxx
36 echo >> ${CLASS_NAME}_SRC/src/${CLASS_NAME}_CPP/${CLASS_NAME}_CPP.cxx
38 cat code_dispatch >> ${CLASS_NAME}_SRC/src/${CLASS_NAME}_CPP/${CLASS_NAME}_CPP.cxx
41 if [ ${BE_QUIET} -lt 1 ] ; then
42 echo -e "\n-> Substitute flags in Makefile.am"
44 sed "s?HXX2SALOME_INCLUDE?${makefile_include}?g
45 s?HXX2SALOME_PYTHON_FILE?${python_test_file}?g
46 s?HXX2SALOME_LIB?${makefile_lib}?g
47 " ${CLASS_NAME}_SRC/src/${CLASS_NAME}_CPP/Makefile.am > tmpfile
48 sed "s?XXX?XXX -I$hxx_dir?" tmpfile > tmp2file
50 if [ "x${USE_MED}" == "x1" ]
52 sed "/AM_CXXFLAGS/s?\$? -DMED_WITHOUT_KERNEL -DUSE_MED \${MED2_INCLUDES} -I\${MED_ROOT_DIR}/include/salome?" tmp2file > tmpfile
53 sed "s?USE_MED=0?USE_MED=1?" tmpfile > tmp2file
55 mv tmp2file ${CLASS_NAME}_SRC/src/${CLASS_NAME}_CPP/Makefile.am
56 \rm -f tmpfile tmp2file
58 if [ ${BE_QUIET} -lt 1 ] ; then
59 echo -e "\n-> XML Catalog generation"
61 cat ${CLASS_NAME}_public_functions | awk -v class_name=${CLASS_NAME} -f ${gene_dir}/parse5.awk
62 mv catalog.xml ${CLASS_NAME}_SRC/resources/${CLASS_NAME}Catalog.xml
64 echo "" >> ${CLASS_NAME}_SRC/resources/Makefile.am
65 echo "${CLASS_NAME}Catalog.xml: \${srcdir}/${CLASS_NAME}Catalog.xml" >> ${CLASS_NAME}_SRC/resources/Makefile.am
66 echo " cp \$^ \$@" >> ${CLASS_NAME}_SRC/resources/Makefile.am
70 clean_cpp_module_source()
72 \rm -rf ${CLASS_NAME}_SRC/src/${CLASS_NAME}_CPP