Salome HOME
Copyright update 2020
[plugins/ghs3dplugin.git] / adm_local / unix / config_files / check_GHS3DPLUGIN.m4
1 dnl Copyright (C) 2004-2020  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, or (at your option) any later version.
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 #  Check availability of GHS3DPLUGIN binary distribution
21 #
22 #  Author : Marc Tajchman (CEA, 2002)
23 #------------------------------------------------------------
24
25 AC_DEFUN([CHECK_GHS3DPLUGIN],[
26
27 GHS3DPLUGIN_LDFLAGS=""
28 GHS3DPLUGIN_CXXFLAGS=""
29
30 AC_CHECKING(for GHS3dPlugin)
31
32 GHS3dPlugin_ok=no
33
34 AC_ARG_WITH(ghs,
35             --with-ghs3dPlugin=DIR  root directory path of GHS3DPLUGIN build or installation,
36             GHS3DPLUGIN_DIR="$withval",GHS3DPLUGIN_DIR="")
37
38 if test "x$GHS3DPLUGIN_DIR" = "x" ; then
39
40 # no --with-gui-dir option used
41
42   if test "x$GHS3DPLUGIN_ROOT_DIR" != "x" ; then
43
44     # SALOME_ROOT_DIR environment variable defined
45     GHS3DPLUGIN_DIR=$GHS3DPLUGIN_ROOT_DIR
46
47   else
48
49     # search Salome binaries in PATH variable
50     AC_PATH_PROG(TEMP, libGHS3DEngine.so)
51     if test "x$TEMP" != "x" ; then
52       GHS3DPLUGIN_DIR=`dirname $TEMP`
53     fi
54
55   fi
56
57 fi
58
59 if test -f ${GHS3DPLUGIN_DIR}/lib/salome/libGHS3DEngine.so  ; then
60   GHS3dPlugin_ok=yes
61   AC_MSG_RESULT(Using GHS3DPLUGIN module distribution in ${GHS3DPLUGIN_DIR})
62
63   if test "x$GHS3DPLUGIN_ROOT_DIR" == "x" ; then
64     GHS3DPLUGIN_ROOT_DIR=${GHS3DPLUGIN_DIR}
65   fi
66   GHS3DPLUGIN_CXXFLAGS+=-I${GHS3DPLUGIN_ROOT_DIR}/include/salome
67   GHS3DPLUGIN_LDFLAGS+=-L${GHS3DPLUGIN_ROOT_DIR}/lib${LIB_LOCATION_SUFFIX}/salome
68   AC_SUBST(GHS3DPLUGIN_ROOT_DIR)
69   AC_SUBST(GHS3DPLUGIN_LDFLAGS)
70   AC_SUBST(GHS3DPLUGIN_CXXFLAGS)
71 else
72   AC_MSG_WARN("Cannot find compiled GHS3DPLUGIN module distribution")
73 fi
74   
75 AC_MSG_RESULT(for GHS3DPLUGIN: $GHS3dPlugin_ok)
76  
77 ])dnl
78