Salome HOME
Update copyrights
[plugins/hexoticplugin.git] / adm_local / unix / config_files / check_HexoticPLUGIN.m4
index e2e6497992a5f4b1f8a64f820ae9d43008b20541..8ab2323b4f2538392f8d53d4d4cd15e325761d65 100644 (file)
@@ -1,53 +1,75 @@
-AC_DEFUN([CHECK_HEXOTIC],[
+dnl Copyright (C) 2007-2019  CEA/DEN, EDF R&D
+dnl
+dnl This library is free software; you can redistribute it and/or
+dnl modify it under the terms of the GNU Lesser General Public
+dnl License as published by the Free Software Foundation; either
+dnl version 2.1 of the License, or (at your option) any later version.
+dnl
+dnl This library is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+dnl Lesser General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU Lesser General Public
+dnl License along with this library; if not, write to the Free Software
+dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+dnl
+dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+dnl
+
+dnl  File   : check_HexoticPLUGIN.m4
+dnl  Author : Vadim SANDLER, Open CASCADE S.A.S (vadim.sandler@opencascade.com)
+dnl
+AC_DEFUN([CHECK_HEXOTICPLUGIN],[
+
+AC_CHECKING(for Hexotic mesh plugin)
+
+Hexoticplugin_ok=no
+
+HexoticPLUGIN_LDFLAGS=""
+HexoticPLUGIN_CXXFLAGS=""
+
+AC_ARG_WITH(Hexoticplugin,
+      --with-Hexoticplugin=DIR  root directory path of Hexotic mesh plugin installation,
+      HexoticPLUGIN_DIR="$withval",HexoticPLUGIN_DIR="")
+
+if test "x$HexoticPLUGIN_DIR" = "x" ; then
+
+# no --with-Hexoticplugin option used
+
+  if test "x$HexoticPLUGIN_ROOT_DIR" != "x" ; then
+
+    # SALOME_ROOT_DIR environment variable defined
+    HexoticPLUGIN_DIR=$HexoticPLUGIN_ROOT_DIR
 
-AC_REQUIRE([AC_PROG_CXX])dnl
-AC_REQUIRE([AC_PROG_CXXCPP])dnl
-
-AC_CHECKING(for Hexotic comercial product)
-
-AC_LANG_SAVE
-AC_LANG_CPLUSPLUS
-
-AC_ARG_WITH(,
-           [  --with-Hexotic=DIR root directory path of Hexotic installation],
-           Hexotic_HOME=$withval,Hexotic_HOME="")
-
-Hexotic_ok=no
-
-if test "x$Hexotic_HOME" == "x" ; then
+  else
 
-# no --with-Hexotic option used
-   if test "x$HexoticHOME" != "x" ; then
+    # search Salome binaries in PATH variable
+    AC_PATH_PROG(TEMP, libHexoticEngine.so)
+    if test "x$TEMP" != "x" ; then
+      HexoticPLUGIN_DIR=`dirname $TEMP`
+    fi
 
-    # HexoticHOME environment variable defined
-      Hexotic_HOME=$HexoticHOME
+  fi
 
-   fi
-# 
 fi
 
-if test "x$Hexotic_HOME" != "x"; then
+if test -f ${HexoticPLUGIN_DIR}/lib${LIB_LOCATION_SUFFIX}/salome/libHexoticEngine.so  ; then
+  Hexoticplugin_ok=yes
+  AC_MSG_RESULT(Using Hexotic mesh plugin distribution in ${HexoticPLUGIN_DIR})
 
-  echo
-  echo -------------------------------------------------
-  echo You are about to choose to use somehow the
-  echo Hexotic commercial product to generate 3D hexahedral mesh.
-  echo
-
-  AC_MSG_CHECKING(for Hexotic executable)
-
-  AC_CHECK_PROG(HEXOTIC, hexotic,found)
-
-  if test "x$HEXOTIC" == x ; then
-    AC_MSG_RESULT(no)
-    AC_MSG_WARN(Hexotic program not found in PATH variable)
-  else
-    Hexotic_ok=yes
+  if test "x$HexoticPLUGIN_ROOT_DIR" == "x" ; then
+    HexoticPLUGIN_ROOT_DIR=${HexoticPLUGIN_DIR}
   fi
-
+  HexoticPLUGIN_CXXFLAGS+=-I${HexoticPLUGIN_ROOT_DIR}/include/salome
+  HexoticPLUGIN_LDFLAGS+=-L${HexoticPLUGIN_ROOT_DIR}/lib${LIB_LOCATION_SUFFIX}/salome
+  AC_SUBST(HexoticPLUGIN_ROOT_DIR)
+  AC_SUBST(HexoticPLUGIN_LDFLAGS)
+  AC_SUBST(HexoticPLUGIN_CXXFLAGS)
+else
+  AC_MSG_WARN("Cannot find compiled Hexotic mesh plugin distribution")
 fi
-
-AC_MSG_RESULT(for Hexotic: $Hexotic_ok)
-AC_LANG_RESTORE
-
+  
+AC_MSG_RESULT(for Hexotic mesh plugin: $Hexoticplugin_ok)
 ])dnl