Salome HOME
Light Python sample module
[samples/pylight.git] / adm_local / unix / config_files / check_PYLIGHT.m4
1 #  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
2 #
3 #  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 #  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 #
6 #  This library is free software; you can redistribute it and/or
7 #  modify it under the terms of the GNU Lesser General Public
8 #  License as published by the Free Software Foundation; either
9 #  version 2.1 of the License.
10 #
11 #  This library is distributed in the hope that it will be useful,
12 #  but WITHOUT ANY WARRANTY; without even the implied warranty of
13 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 #  Lesser General Public License for more details.
15 #
16 #  You should have received a copy of the GNU Lesser General Public
17 #  License along with this library; if not, write to the Free Software
18 #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 #
20 #  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21
22 #  Author : Roman NIKOLAEV Open CASCADE S.A.S. (roman.nikolaev@opencascade.com)
23 #  Date   : 13/04/2009
24
25 #------------------------------------------------------------
26
27 AC_DEFUN([CHECK_PYLIGHT],[
28
29 AC_CHECKING(for PyLight)
30
31 PyLight_ok=no
32
33 PYLIGHT_LDFLAGS=""
34 PYLIGHT_CXXFLAGS=""
35
36 AC_ARG_WITH(gui,
37             --with-py-light=DIR root directory path of PYLIGHT installation,
38             PYLIGHT_DIR="$withval",PYLIGHT_DIR="")
39
40 if test "x$PYLIGHT_DIR" = "x" ; then
41
42 # no --with-light option used
43
44   if test "x$PYLIGHT_ROOT_DIR" != "x" ; then
45
46     # PYLIGHT_ROOT_DIR environment variable defined
47     LIGHT_DIR=$PYLIGHT_ROOT_DIR
48
49   else
50
51     # search PYLIGHT binaries in PATH variable
52     AC_PATH_PROG(TEMP, PYLIGHTGUI.py)
53     if test "x$TEMP" != "x" ; then
54       PYLIGHT_BIN_DIR=`dirname $TEMP`
55       PYLIGHT_DIR=`dirname $PYLIGHT_BIN_DIR`
56     fi
57
58   fi
59 #
60 fi
61
62 if test -f ${PYLIGHT_DIR}/lib/salome/PYLIGHTGUI.py  ; then
63   PyLight_ok=yes
64   AC_MSG_RESULT(Using PYLIGHT distribution in ${PYLIGHT_DIR})
65
66   if test "x$PYLIGHT_ROOT_DIR" == "x" ; then
67     PYLIGHT_ROOT_DIR=${PYLIGHT_DIR}
68   fi
69   AC_SUBST(PYLIGHT_ROOT_DIR)
70 else
71   AC_MSG_WARN("Cannot find compiled PYLIGHT distribution")
72 fi
73   
74 AC_MSG_RESULT(for PYLIGHT: $PyLight_ok)
75  
76 ])dnl
77