1 dnl Copyright (C) 2007-2014 CEA/DEN, EDF R&D
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.
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.
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
17 dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 dnl File : check_MESHGEMS_CADSURF.m4
21 dnl Author : Gilles DAVID, Open CASCADE S.A.S (gilles.david@opencascade.com)
23 AC_DEFUN([CHECK_MESHGEMS_CADSURF],[
25 AC_REQUIRE([AC_PROG_CXX])dnl
26 AC_REQUIRE([AC_PROG_CXXCPP])dnl
28 AC_CHECKING([for MeshGems-CADSurf commercial product])
33 MESHGEMS_CADSURF_INCLUDES=""
34 MESHGEMS_CADSURF_LIBS=""
36 AC_ARG_WITH([meshgems],
37 [ --with-meshgems=DIR root directory path of MeshGems-CADSurf installation])
41 if test "$with-meshgems" != "no" ; then
42 if test "$with-meshgems" == "yes" || test "$with-meshgems" == "auto"; then
43 MESHGEMS_CADSURF_HOME=""
45 MESHGEMS_CADSURF_HOME="$with_meshgems"
48 if test "$MESHGEMS_CADSURF_HOME" == "" ; then
49 if test "x$MESHGEMS_CADSURFHOME" != "x" ; then
50 MESHGEMS_CADSURF_HOME=$MESHGEMS_CADSURFHOME
52 if test "x$CADSURFHOME" != "x" ; then
53 MESHGEMS_CADSURF_HOME=$CADSURFHOME
55 if test "x$MESHGEMSHOME" != "x" ; then
56 MESHGEMS_CADSURF_HOME=$MESHGEMSHOME
60 if test "x$MESHGEMS_CADSURF_HOME" != "x"; then
63 echo -------------------------------------------------
64 echo You are about to choose to use somehow the
65 echo MeshGems-CADSurf commercial product to generate 2D mesh.
68 LOCAL_INCLUDES="-I$MESHGEMS_CADSURF_HOME/include"
69 LOCAL_LIBS="-L$MESHGEMS_CADSURF_HOME/lib/Linux"
70 archtest="$(`which arch`)"
71 if test "x$archtest" = "x" ; then
74 if test $archtest = "x86_64" ; then
75 LOCAL_LIBS="-L$MESHGEMS_CADSURF_HOME/lib/Linux_64"
77 LOCAL_LIBS="${LOCAL_LIBS} -lmeshgems -lmg-cadsurf -lmg-precad"
79 CPPFLAGS_old="$CPPFLAGS"
80 CXXFLAGS_old="$CXXFLAGS"
81 CPPFLAGS="$LOCAL_INCLUDES $CPPFLAGS"
82 CXXFLAGS="$LOCAL_INCLUDES $CXXFLAGS"
84 AC_MSG_CHECKING([for MeshGems-CADSurf header file])
86 AC_CHECK_HEADER([meshgems/meshgems.h],[CADSURF_ok=yes],[CADSURF_ok=no])
87 AC_CHECK_HEADER([meshgems/cadsurf.h],[CADSURF_ok=yes],[CADSURF_ok=no])
89 if test "x$CADSURF_ok" == "xyes"; then
91 AC_MSG_CHECKING([for MeshGems-CADSurf library])
94 LIBS="-L. $LOCAL_LIBS $LIBS"
98 #include "meshgems/meshgems.h"
100 CADSURF_ok=yes,CADSURF_ok=no
105 AC_MSG_RESULT([$CADSURF_ok])
108 CPPFLAGS="$CPPFLAGS_old"
109 CXXFLAGS="$CXXFLAGS_old"
114 if test "x$CADSURF_ok" == xno ; then
115 AC_MSG_RESULT([for MeshGems-CADSurf: no])
116 AC_MSG_WARN([MeshGems-CADSurf includes or libraries are not found or are not properly installed])
117 AC_MSG_WARN([Cannot build without MeshGems-CADSurf. Use --with_meshgems option to define MeshGems installation.])
119 MESHGEMS_CADSURF_INCLUDES=$LOCAL_INCLUDES
120 MESHGEMS_CADSURF_LIBS=$LOCAL_LIBS
121 AC_MSG_RESULT([for MeshGems-CADSurf: yes])
124 AC_SUBST(MESHGEMS_CADSURF_INCLUDES)
125 AC_SUBST(MESHGEMS_CADSURF_LIBS)