Salome HOME
Merge from V6_main_20120808 08Aug12
[plugins/hexoticplugin.git] / adm_local / unix / config_files / check_HexoticPLUGIN.m4
1 dnl Copyright (C) 2007-2012  CEA/DEN, EDF R&D
2 dnl
3 dnl This library is free software; you can redistribute it and/or
4 dnl modify it under the terms of the GNU Lesser General Public
5 dnl License as published by the Free Software Foundation; either
6 dnl version 2.1 of the License.
7 dnl
8 dnl This library is distributed in the hope that it will be useful,
9 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
10 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 dnl Lesser General Public License for more details.
12 dnl
13 dnl You should have received a copy of the GNU Lesser General Public
14 dnl License along with this library; if not, write to the Free Software
15 dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 dnl
17 dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 dnl
19
20 dnl  File   : check_HexoticPLUGIN.m4
21 dnl  Author : Vadim SANDLER, Open CASCADE S.A.S (vadim.sandler@opencascade.com)
22 dnl
23 AC_DEFUN([CHECK_HEXOTICPLUGIN],[
24
25 AC_CHECKING(for Hexotic mesh plugin)
26
27 Hexoticplugin_ok=no
28
29 HexoticPLUGIN_LDFLAGS=""
30 HexoticPLUGIN_CXXFLAGS=""
31
32 AC_ARG_WITH(Hexoticplugin,
33       --with-Hexoticplugin=DIR  root directory path of Hexotic mesh plugin installation,
34       HexoticPLUGIN_DIR="$withval",HexoticPLUGIN_DIR="")
35
36 if test "x$HexoticPLUGIN_DIR" = "x" ; then
37
38 # no --with-Hexoticplugin option used
39
40   if test "x$HexoticPLUGIN_ROOT_DIR" != "x" ; then
41
42     # SALOME_ROOT_DIR environment variable defined
43     HexoticPLUGIN_DIR=$HexoticPLUGIN_ROOT_DIR
44
45   else
46
47     # search Salome binaries in PATH variable
48     AC_PATH_PROG(TEMP, libHexoticEngine.so)
49     if test "x$TEMP" != "x" ; then
50       HexoticPLUGIN_DIR=`dirname $TEMP`
51     fi
52
53   fi
54
55 fi
56
57 if test -f ${HexoticPLUGIN_DIR}/lib${LIB_LOCATION_SUFFIX}/salome/libHexoticEngine.so  ; then
58   Hexoticplugin_ok=yes
59   AC_MSG_RESULT(Using Hexotic mesh plugin distribution in ${HexoticPLUGIN_DIR})
60
61   if test "x$HexoticPLUGIN_ROOT_DIR" == "x" ; then
62     HexoticPLUGIN_ROOT_DIR=${HexoticPLUGIN_DIR}
63   fi
64   HexoticPLUGIN_CXXFLAGS+=-I${HexoticPLUGIN_ROOT_DIR}/include/salome
65   HexoticPLUGIN_LDFLAGS+=-L${HexoticPLUGIN_ROOT_DIR}/lib${LIB_LOCATION_SUFFIX}/salome
66   AC_SUBST(HexoticPLUGIN_ROOT_DIR)
67   AC_SUBST(HexoticPLUGIN_LDFLAGS)
68   AC_SUBST(HexoticPLUGIN_CXXFLAGS)
69 else
70   AC_MSG_WARN("Cannot find compiled Hexotic mesh plugin distribution")
71 fi
72   
73 AC_MSG_RESULT(for Hexotic mesh plugin: $Hexoticplugin_ok)
74  
75 ])dnl