Salome HOME
86a8264b2b23f14fdd883020a4904a1d8fe2d677
[modules/smesh.git] / adm_local / unix / config_files / check_SMESH.m4
1 # Check availability of SMesh binary distribution
2 #
3 # Author : Nicolas REJNERI (OPEN CASCADE, 2003)
4 #
5
6 AC_DEFUN([CHECK_SMESH],[
7
8 AC_CHECKING(for SMesh)
9
10 SMesh_ok=no
11
12 AC_ARG_WITH(smesh,
13             [  --with-smesh=DIR root directory path of SMESH installation ],
14             SMESH_DIR="$withval",SMESH_DIR="")
15
16 if test "x$SMESH_DIR" == "x" ; then
17
18 # no --with-smesh option used
19
20    if test "x$SMESH_ROOT_DIR" != "x" ; then
21
22     # SMESH_ROOT_DIR environment variable defined
23       SMESH_DIR=$SMESH_ROOT_DIR
24
25    else
26
27     # search SMESH binaries in PATH variable
28       AC_PATH_PROG(TEMP, libSMESH_Swig.py)
29       if test "x$TEMP" != "x" ; then
30          SMESH_BIN_DIR=`dirname $TEMP`
31          SMESH_DIR=`dirname $SMESH_BIN_DIR`
32       fi
33       
34    fi
35
36 fi
37
38 if test -f ${SMESH_DIR}/bin/salome/libSMESH_Swig.py ; then
39    SMesh_ok=yes
40    AC_MSG_RESULT(Using SMesh module distribution in ${SMESH_DIR})
41
42    if test "x$SMESH_ROOT_DIR" == "x" ; then
43       SMESH_ROOT_DIR=${SMESH_DIR}
44    fi
45    AC_SUBST(SMESH_ROOT_DIR)
46
47 else
48    AC_MSG_WARN("Cannot find compiled SMesh module distribution")
49 fi
50
51 AC_MSG_RESULT(for SMesh: $SMesh_ok)
52  
53 ])dnl
54