Salome HOME
Copyright update 2022
[plugins/hybridplugin.git] / adm_local / unix / config_files / check_HYBRIDPLUGIN.m4
old mode 100755 (executable)
new mode 100644 (file)
index 05a0572..abbfccf
@@ -1,78 +1,70 @@
-dnl Copyright (C) 2004-2013  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.
-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
+# Copyright (C) 2007-2022  CEA/DEN, EDF R&D
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
 
-#  Check availability of HYBRIDPLUGIN binary distribution
+# ---
 #
-#  Author : Marc Tajchman (CEA, 2002)
-#------------------------------------------------------------
+# File   : check_HYBRIDPLUGIN.m4
+# Author : Vadim SANDLER, Open CASCADE S.A.S (vadim.sandler@opencascade.com)
+#
+# ---
 
 AC_DEFUN([CHECK_HYBRIDPLUGIN],[
 
-HYBRIDPLUGIN_LDFLAGS=""
-HYBRIDPLUGIN_CXXFLAGS=""
-
-AC_CHECKING(for GHS3dPlugin)
+AC_CHECKING(for HYBRID mesh plugin)
 
-GHS3dPlugin_ok=no
+HYBRIDplugin_ok=no
 
-AC_ARG_WITH(ghs,
-           --with-hybridPlugin=DIR  root directory path of HYBRIDPLUGIN build or installation,
-           HYBRIDPLUGIN_DIR="$withval",HYBRIDPLUGIN_DIR="")
-
-if test "x$HYBRIDPLUGIN_DIR" = "x" ; then
-
-# no --with-gui-dir option used
-
-  if test "x$HYBRIDPLUGIN_ROOT_DIR" != "x" ; then
-
-    # SALOME_ROOT_DIR environment variable defined
-    HYBRIDPLUGIN_DIR=$HYBRIDPLUGIN_ROOT_DIR
+HYBRIDPLUGIN_LDFLAGS=""
+HYBRIDPLUGIN_CXXFLAGS=""
 
-  else
+AC_ARG_WITH(HYBRIDplugin,
+           [  --with-HYBRIDplugin=DIR root directory path of HYBRID mesh plugin installation ])
 
-    # search Salome binaries in PATH variable
-    AC_PATH_PROG(TEMP, libHYBRIDEngine.so)
-    if test "x$TEMP" != "x" ; then
-      HYBRIDPLUGIN_DIR=`dirname $TEMP`
+if test "$with_HYBRIDplugin" != "no" ; then
+    if test "$with_HYBRIDplugin" == "yes" || test "$with_HYBRIDplugin" == "auto"; then
+       if test "x$HYBRIDPLUGIN_ROOT_DIR" != "x" ; then
+            HYBRIDPLUGIN_DIR=$HYBRIDPLUGIN_ROOT_DIR
+        fi
+    else
+        HYBRIDPLUGIN_DIR="$with_HYBRIDplugin"
     fi
 
-  fi
-
+    if test "x$HYBRIDPLUGIN_DIR" != "x" ; then
+       if test -f ${HYBRIDPLUGIN_DIR}/lib${LIB_LOCATION_SUFFIX}/salome/libHYBRIDEngine.so ; then
+           HYBRIDplugin_ok=yes
+           AC_MSG_RESULT(Using HYBRID mesh plugin distribution in ${HYBRIDPLUGIN_DIR})
+           HYBRIDPLUGIN_ROOT_DIR=${HYBRIDPLUGIN_DIR}
+           HYBRIDPLUGIN_LDFLAGS=-L${HYBRIDPLUGIN_DIR}/lib${LIB_LOCATION_SUFFIX}/salome
+           HYBRIDPLUGIN_CXXFLAGS=-I${HYBRIDPLUGIN_DIR}/include/salome
+       else
+           AC_MSG_WARN("Cannot find compiled HYBRID mesh plugin distribution")
+       fi
+    else
+       AC_MSG_WARN("Cannot find compiled HYBRID mesh plugin distribution")
+    fi
 fi
 
-if test -f ${HYBRIDPLUGIN_DIR}/lib/salome/libHYBRIDEngine.so  ; then
-  GHS3dPlugin_ok=yes
-  AC_MSG_RESULT(Using HYBRIDPLUGIN module distribution in ${HYBRIDPLUGIN_DIR})
+AC_MSG_RESULT(for HYBRID mesh plugin: $HYBRIDplugin_ok)
 
-  if test "x$HYBRIDPLUGIN_ROOT_DIR" == "x" ; then
-    HYBRIDPLUGIN_ROOT_DIR=${HYBRIDPLUGIN_DIR}
-  fi
-  HYBRIDPLUGIN_CXXFLAGS+=-I${HYBRIDPLUGIN_ROOT_DIR}/include/salome
-  HYBRIDPLUGIN_LDFLAGS+=-L${HYBRIDPLUGIN_ROOT_DIR}/lib${LIB_LOCATION_SUFFIX}/salome
-  AC_SUBST(HYBRIDPLUGIN_ROOT_DIR)
-  AC_SUBST(HYBRIDPLUGIN_LDFLAGS)
-  AC_SUBST(HYBRIDPLUGIN_CXXFLAGS)
-else
-  AC_MSG_WARN("Cannot find compiled HYBRIDPLUGIN module distribution")
-fi
-  
-AC_MSG_RESULT(for HYBRIDPLUGIN: $GHS3dPlugin_ok)
+AC_SUBST(HYBRIDPLUGIN_ROOT_DIR)
+AC_SUBST(HYBRIDPLUGIN_LDFLAGS)
+AC_SUBST(HYBRIDPLUGIN_CXXFLAGS)
  
 ])dnl