]> SALOME platform Git repositories - modules/gui.git/blob - adm_local/unix/config_files/check_GUI.m4
Salome HOME
ec07762f324976e49fa1abc31d0a912db33c16a8
[modules/gui.git] / adm_local / unix / config_files / check_GUI.m4
1 dnl  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
2 dnl
3 dnl  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 dnl  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 dnl
6 dnl  This library is free software; you can redistribute it and/or
7 dnl  modify it under the terms of the GNU Lesser General Public
8 dnl  License as published by the Free Software Foundation; either
9 dnl  version 2.1 of the License.
10 dnl
11 dnl  This library is distributed in the hope that it will be useful,
12 dnl  but WITHOUT ANY WARRANTY; without even the implied warranty of
13 dnl  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 dnl  Lesser General Public License for more details.
15 dnl
16 dnl  You should have received a copy of the GNU Lesser General Public
17 dnl  License along with this library; if not, write to the Free Software
18 dnl  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 dnl
20 dnl  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 dnl
22 #  Check availability of Salome binary distribution
23 #
24 #  Author : Marc Tajchman (CEA, 2002)
25 #------------------------------------------------------------
26
27 AC_DEFUN([CHECK_GUI],[
28 AC_REQUIRE([AC_LINKER_OPTIONS])dnl
29
30 AC_CHECKING(for $2 $1 )
31
32 SalomeGUI_ok=no
33
34 GUI_LDFLAGS=""
35 GUI_CXXFLAGS=""
36
37 AC_ARG_WITH(gui,
38             --with-salome_gui=DIR root directory path of SALOME GUI installation,
39             SALOME_GUI_DIR="$withval",SALOME_GUI_DIR="")
40
41 if test "x${SALOME_GUI_DIR}" = "x" ; then
42   # no --with-gui-dir option used
43   AC_MSG_RESULT(try \${GUI_ROOT_DIR}: ${GUI_ROOT_DIR})
44   if test "x${GUI_ROOT_DIR}" != "x" ; then
45     # SALOME_ROOT_DIR environment variable defined
46     SALOME_GUI_DIR=${GUI_ROOT_DIR}
47   else
48     # search Salome binaries in PATH variable
49     AC_PATH_PROG(TEMP, $1)
50     if test "x${TEMP}" != "x" ; then
51       AC_MSG_RESULT($1 was found at : ${TEMP})
52       SALOME_BIN_DIR=`dirname ${TEMP}`
53       SALOME_GUI_DIR=`cd ${SALOME_BIN_DIR}/../..; pwd`
54     fi
55   fi
56 fi
57
58 if test -f ${SALOME_GUI_DIR}/bin/salome/$1 ; then
59   SalomeGUI_ok=yes
60   AC_MSG_RESULT(Using SALOME GUI distribution in ${SALOME_GUI_DIR})
61
62   if test "x${GUI_ROOT_DIR}" == "x" ; then
63     GUI_ROOT_DIR=${SALOME_GUI_DIR}
64   fi
65
66   AC_SUBST(GUI_ROOT_DIR)
67
68   GUI_LDFLAGS=-L${SALOME_GUI_DIR}/lib${LIB_LOCATION_SUFFIX}/salome
69   GUI_CXXFLAGS=-I${SALOME_GUI_DIR}/include/salome
70
71   AC_SUBST(GUI_LDFLAGS)
72   AC_SUBST(GUI_CXXFLAGS)
73 else
74   AC_MSG_WARN("Cannot find compiled SALOME GUI distribution")
75 fi
76   
77 AC_MSG_RESULT(for $2: ${SalomeGUI_ok})
78  
79 ])dnl
80
81 AC_DEFUN([CHECK_SALOME_GUI],[
82   CHECK_GUI([SUITApp],
83             [SALOME GUI])
84 ])dnl