1 # Copyright (C) 2006-2013 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.
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
21 # check if $1 is a directory
22 if [ ${BE_QUIET} -lt 1 ] ; then
23 echo -e "-> check arguments\n"
27 echo -e "Error : directory $1 does not exist!\n"
30 CPP_ROOT_DIR=${1%%/} # remove trailing slash if present
35 if [ ${BE_QUIET} -lt 2 ] ; then
36 echo " C++ Component directory : ${CPP_ROOT_DIR}"
39 # look for include file $2 - check number of files found and extension
40 nb=`find ${CPP_ROOT_DIR} -name $2 | wc -l` # number of files found, should be equal to 1
44 echo -e "\n Error:\n Include file $2 not found in $1 directory!\n"
48 echo -e "\n Error:\n More than one file named $2 was found in $1!\n Include file should be unique!"
50 elif [ $extension != "hxx" -a $extension != "hh" -a $extension != "h" ]
52 echo -e "\n Error:\n Extension=$extension\n Include file $2 should have extension .hxx .hh or .h !\n"
55 hxx_file=`find ${CPP_ROOT_DIR} -name $2` # name of c++ header we will parse to generate salome module
57 if [ ${BE_QUIET} -lt 2 ] ; then
58 echo " C++ Component header : ${hxx_file}"
60 hxx_dir=`dirname ${hxx_file}`
63 nb=`find ${CPP_ROOT_DIR} -name $3 | wc -l` # number of files found, should be equal to 1
66 echo -e "\n Error:\n Library file $3 not found in $1 directory!\n"
70 echo -e "\n Error:\n More than one file named $3 was found in $1!\n Library file should be unique!"
73 so_file=`find ${CPP_ROOT_DIR} -name $3` # absolute path of library containing c++ module
74 if [ ${BE_QUIET} -lt 2 ] ; then
75 echo " C++ Component library : ${so_file}"
77 lib_dir=`dirname ${so_file}`
78 lib_file=${3%.so} # name without .so
79 lib_file=${lib_file#lib} # name of library without lib and .so (needed by makefile)
81 # installation directory
86 salomeComponentRoot=${4%%/} # remove trailing slash
88 cd $salomeComponentRoot
89 salomeComponentRoot=`pwd`
91 if [ ${BE_QUIET} -lt 2 ] ; then
92 echo " Salome Component directory : ${salomeComponentRoot}"
96 validate_generation_choices()
102 if [ x${arr[$iCORBA]} == "xyes" ]
104 if [ "x${KERNEL_ROOT_DIR}" == "x" ]
108 if [ ! -f ${KERNEL_ROOT_DIR}/idl/salome/SALOME_Component.idl ]