]> SALOME platform Git repositories - plugins/ghs3dprlplugin.git/commitdiff
Salome HOME
Implement --with[out]-gui configure and build_configure options. BR_PERF RELIQUAT_4x_25102008 V4_1_3 V4_1_3rc1 V4_1_3rc2 V4_1_4a1 V4_1_4rc1
authorjfa <jfa@opencascade.com>
Thu, 22 May 2008 11:53:36 +0000 (11:53 +0000)
committerjfa <jfa@opencascade.com>
Thu, 22 May 2008 11:53:36 +0000 (11:53 +0000)
adm_local/unix/make_commence.in
build_configure
configure.in.base
src/GHS3DPRLPlugin/GHS3DPRLPlugin_Hypothesis.cxx
src/GHS3DPRLPlugin/Makefile.in
src/Makefile.in

index 6d07a77258885eb935483f9542d3b72e4ec1d025..ca2027b80956000e083afd89b0acce99f29337a4 100755 (executable)
@@ -271,20 +271,32 @@ ac_cxx_partial_specialization.m4  python.m4                               \
 ac_cxx_typename.m4                check_pthreads.m4  check_cas.m4      \
 ac_cc_warnings.m4                 check_swig.m4             check_boost.m4 
 
-ACLOCAL_GUI = \
-check_vtk.m4                      check_opengl.m4    check_qt.m4       \
-check_GUI.m4                      check_corba_in_GUI.m4
-
 ACLOCAL_GEOM =                    check_GEOM.m4
 
 ACLOCAL_SMESH =                   check_SMESH.m4
 
+ifeq ($(GHS3DPRLPLUGIN_WITH_GUI),yes)
+ACLOCAL_GUI = \
+check_vtk.m4                      check_opengl.m4    check_qt.m4       \
+check_GUI.m4                      check_corba_in_GUI.m4
+
 $(top_srcdir)/aclocal.m4: $(ACLOCAL_KERNEL%=@KERNEL_ROOT_DIR@/salome_adm/unix/config_files/%) \
                           $(ACLOCAL_GUI:%=@GUI_ROOT_DIR@/adm_local/unix/config_files/%) \
                           $(ACLOCAL_GEOM:%=@GEOM_ROOT_DIR@/adm_local/unix/config_files/%) \
                           $(ACLOCAL_SMESH:%=@SMESH_ROOT_DIR@/adm_local/unix/config_files/%)
-       cd $(top_srcdir) ; aclocal -I adm_local/unix/config_files -I @KERNEL_ROOT_DIR@/salome_adm/unix/config_files \
-                                                                       -I @GUI_ROOT_DIR@/adm_local/unix/config_files \
-                                                                       -I @GEOM_ROOT_DIR@/adm_local/unix/config_files \
-                                                                       -I @SMESH_ROOT_DIR@/adm_local/unix/config_files
-                                                              
+       cd $(top_srcdir) ; aclocal -I adm_local/unix/config_files \
+                                  -I @KERNEL_ROOT_DIR@/salome_adm/unix/config_files \
+                                   -I @GUI_ROOT_DIR@/adm_local/unix/config_files \
+                                   -I @GEOM_ROOT_DIR@/adm_local/unix/config_files \
+                                   -I @SMESH_ROOT_DIR@/adm_local/unix/config_files
+endif
+
+ifeq ($(GHS3DPRLPLUGIN_WITH_GUI),no)
+$(top_srcdir)/aclocal.m4: $(ACLOCAL_KERNEL%=@KERNEL_ROOT_DIR@/salome_adm/unix/config_files/%) \
+                          $(ACLOCAL_GEOM:%=@GEOM_ROOT_DIR@/adm_local/unix/config_files/%) \
+                          $(ACLOCAL_SMESH:%=@SMESH_ROOT_DIR@/adm_local/unix/config_files/%)
+       cd $(top_srcdir) ; aclocal -I adm_local/unix/config_files \
+                                  -I @KERNEL_ROOT_DIR@/salome_adm/unix/config_files \
+                                   -I @GEOM_ROOT_DIR@/adm_local/unix/config_files \
+                                   -I @SMESH_ROOT_DIR@/adm_local/unix/config_files
+endif
index d3790d2ee924e6ae1010f7890e38a001064692c2..4b85890d25ffac80ddd951f6e2ad36cfb03d5291 100755 (executable)
@@ -10,6 +10,7 @@
 
 ORIG_DIR=`pwd`
 CONF_DIR=`echo $0 | sed -e "s,[^/]*$,,;s,/$,,;s,^$,.,"`
+GHS3DPRLPLUGIN_WITH_GUI="yes"
 
 ########################################################################
 # Test if the KERNEL_ROOT_DIR is set correctly
@@ -25,12 +26,27 @@ fi
 #    echo "failed : KERNEL_SRC variable is not correct !"
 #    exit
 #fi
+
+for option
+do
+  case $option in
+      -with-gui | --with-gui)
+          GHS3DPRLPLUGIN_WITH_GUI="yes"
+          break;;
+      -without-gui | --without-gui | -with-gui=no | --with-gui=no)
+          GHS3DPRLPLUGIN_WITH_GUI="no"
+          break;;
+  esac
+done
+
 ########################################################################
 # Test if the GUI_ROOT_DIR is set correctly
 
-if test ! -d "${GUI_ROOT_DIR}"; then
+if test ${GHS3DPRLPLUGIN_WITH_GUI} = yes; then
+  if test ! -d "${GUI_ROOT_DIR}"; then
     echo "failed : GUI_ROOT_DIR variable is not correct !"
     exit
+  fi
 fi
 
 ########################################################################
@@ -243,12 +259,22 @@ else
        echo -n "Creating 'configure' script ...  "
 fi
 
-aclocal -I adm_local/unix/config_files -I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files \
-                                       -I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files/DEPRECATED \
-                                       -I ${GUI_ROOT_DIR}/adm_local/unix/config_files \
-                                       -I ${MED_ROOT_DIR}/adm_local/unix/config_files \
-                                       -I ${GEOM_ROOT_DIR}/adm_local/unix/config_files \
-                                       -I ${SMESH_ROOT_DIR}/adm_local/unix/config_files 
+if test ${GHS3DPRLPLUGIN_WITH_GUI} = yes; then
+  aclocal -I adm_local/unix/config_files \
+          -I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files \
+          -I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files/DEPRECATED \
+          -I ${GUI_ROOT_DIR}/adm_local/unix/config_files \
+          -I ${MED_ROOT_DIR}/adm_local/unix/config_files \
+          -I ${GEOM_ROOT_DIR}/adm_local/unix/config_files \
+          -I ${SMESH_ROOT_DIR}/adm_local/unix/config_files 
+else
+  aclocal -I adm_local/unix/config_files \
+          -I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files \
+          -I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files/DEPRECATED \
+          -I ${MED_ROOT_DIR}/adm_local/unix/config_files \
+          -I ${GEOM_ROOT_DIR}/adm_local/unix/config_files \
+          -I ${SMESH_ROOT_DIR}/adm_local/unix/config_files 
+fi
 
 if autoconf
 then
index 018a31113c86dbbcd5b18bdd806cf43e9148fc48..8f76d530a67c89f66a3d7cffe1ceb2cfd8f6c603 100755 (executable)
@@ -201,37 +201,68 @@ AC_SUBST_FILE(CORBA)
 corba=make_$ORB
 CORBA=adm_local/unix/$corba
 
-echo
-echo ---------------------------------------------
-echo testing openGL
-echo ---------------------------------------------
-echo
+dnl
+dnl ---------------------------------------------
+dnl testing WITHGUI
+dnl ---------------------------------------------
+dnl
 
-CHECK_OPENGL
+CHECK_WITHGUI
 
-echo
-echo ---------------------------------------------
-echo testing QT
-echo ---------------------------------------------
-echo
+if test "X$WITHGUI" = "Xyes"; then
 
-CHECK_QT
+   echo
+   echo ---------------------------------------------
+   echo testing openGL
+   echo ---------------------------------------------
+   echo
 
-echo
-echo ---------------------------------------------
-echo testing MSG2QM
-echo ---------------------------------------------
-echo
+   CHECK_OPENGL
 
-CHECK_MSG2QM
+   echo
+   echo ---------------------------------------------
+   echo testing QT
+   echo ---------------------------------------------
+   echo
 
-echo
-echo ---------------------------------------------
-echo testing VTK
-echo ---------------------------------------------
-echo
+   CHECK_QT
+
+   echo
+   echo ---------------------------------------------
+   echo testing MSG2QM
+   echo ---------------------------------------------
+   echo
+
+   CHECK_MSG2QM
+
+   echo
+   echo ---------------------------------------------
+   echo testing VTK
+   echo ---------------------------------------------
+   echo
 
-CHECK_VTK
+   CHECK_VTK
+
+   echo
+   echo ---------------------------------------------
+   echo Testing GUI
+   echo ---------------------------------------------
+   echo
+
+   CHECK_SALOME_GUI
+
+   echo
+   echo ---------------------------------------------
+   echo Testing full GUI
+   echo ---------------------------------------------
+   echo
+
+   CHECK_CORBA_IN_GUI
+   if test "x${CORBA_IN_GUI}" != "xyes"; then
+     echo "failed : For configure GHS3DPRLPLUGIN module necessary full GUI !"
+     exit
+   fi
+fi
 
 echo
 echo ---------------------------------------------
@@ -265,26 +296,6 @@ echo
 
 CHECK_HTML_GENERATORS
 
-echo
-echo ---------------------------------------------
-echo Testing GUI
-echo ---------------------------------------------
-echo
-
-CHECK_SALOME_GUI
-
-echo
-echo ---------------------------------------------
-echo Testing full GUI
-echo ---------------------------------------------
-echo
-
-CHECK_CORBA_IN_GUI
-if test "x${CORBA_IN_GUI}" != "xyes"; then
-  echo "failed : For configure GHS3DPRLPLUGIN module necessary full GUI !"
-  exit
-fi
-
 echo
 echo ---------------------------------------------
 echo Testing Kernel
@@ -332,7 +343,14 @@ echo ---------------------------------------------
 echo
 
 echo Configure
+
+if test "X$WITHGUI" = "Xyes"; then
 variables="cc_ok boost_ok lex_yacc_ok python_ok swig_ok threads_ok OpenGL_ok qt_ok vtk_ok hdf5_ok med2_ok omniORB_ok occ_ok doxygen_ok graphviz_ok Kernel_ok Geom_ok SMesh_ok GHS3DPRL_ok"
+fi
+
+if test "X$WITHGUI" = "Xno"; then
+variables="cc_ok boost_ok lex_yacc_ok python_ok swig_ok threads_ok hdf5_ok med2_ok omniORB_ok occ_ok doxygen_ok graphviz_ok Kernel_ok Geom_ok SMesh_ok GHS3DPRL_ok"
+fi
 
 for var in $variables
 do
index e51f20e9f82e6c0dfde4cfb246f0dead4e4b7717..037faa755065cba87a7c679f9a592c9311eaa4b9 100755 (executable)
@@ -28,7 +28,6 @@
 using namespace std;
 #include <GHS3DPRLPlugin_Hypothesis.hxx>
 #include <utilities.h>
-#include <qstring.h>
 
 //=============================================================================
 /*!
@@ -52,16 +51,46 @@ GHS3DPRLPlugin_Hypothesis::GHS3DPRLPlugin_Hypothesis (int hypId, int studyId,
  *
  */
 //=============================================================================
+static string cutOrReplaceBlancs(string theIn)
+{
+  // cut all blancs at the beginning and at the end of the string,
+  // replace each blancs sequence of maximum length inside the string by one '_' symbol,
+  // as blancs consider: 9 (TAB), 10 (LF), 11 (VT), 12 (FF), 13 (CR) and 32 (Space)
+  int len = theIn.length();
+  int lastgood = 0;
+  const char* str1 = theIn.c_str();
+  char* str2 = new char [len + 1];
+  bool del = true;
+
+  for (int i = 0, j = 0; i < len; i++)
+  {
+    ushort ucs = (ushort)(str1[i]);
+    if ((9 <= ucs && ucs <= 13) || ucs == 32)
+    {
+      if (!del)
+      {
+        str2[j++] = '_';
+        del = true;
+      }
+    }
+    else
+    {
+      str2[j++] = str1[i];
+      lastgood = j;
+      del = false;
+    }
+  }
+  str2[lastgood] = '\0';
+  string anOut = str2;
+  return anOut;
+}
 
 void GHS3DPRLPlugin_Hypothesis::SetMEDName(string theVal) {
   //without whitespaces! ..from python?
-  QString tmp1,tmp2;  
-  tmp1 = (QString) theVal;
-  tmp1.simplifyWhiteSpace(); //for qt3
-  tmp1.replace(QChar(' '),QChar('_'));
-  tmp2 = (QString) _MEDName;
+  string tmp1 = cutOrReplaceBlancs(theVal);
+  string tmp2 = _MEDName;
   if (tmp1 != tmp2) {
-    _MEDName = (const char *) tmp1;
+    _MEDName = tmp1.c_str();
     NotifySubMeshesHypothesisModification();
   }
 }
@@ -108,10 +137,8 @@ istream & GHS3DPRLPlugin_Hypothesis::LoadFrom(istream & load)
 {
    //explicit inputs for future code compatibility of saved .hdf
    bool isOK = true;
-   int imax;
-   string str1;
-   QString str2,str3,str4,str5;
-   
+   string str1,str2,str3,str4;
+
    //save without any whitespaces!
    isOK = (load >> str1);
    if (!(isOK)) {
@@ -119,16 +146,19 @@ istream & GHS3DPRLPlugin_Hypothesis::LoadFrom(istream & load)
      load.clear(ios::badbit | load.rdstate());
      return load;
    }
-   str2 = (QString) str1;
-   imax = str2.contains(";");
-   for (int i=0; i<=imax; i++) {
-      str3 = str2.section(";",i,i);
-      str4 = str3.section("=",0,0);
-      str5 = str3.section("=",1,1);
-
-      if (str4=="MEDName") _MEDName = str5.ascii();
-      if (str4=="NbPart") _NbPart = str5.toInt();
-      if (str4=="KeepFiles") _KeepFiles = (bool) str5.toInt();
+   int pos = 0;
+   int len = str1.length();
+   while (pos < len) {
+     int found = str1.find(';',pos);
+     str2 = str1.substr(pos,found-pos);
+     int eqpos = str2.find('=',0);
+     str3 = str2.substr(0,eqpos);
+     str4 = str2.substr(eqpos+1);
+     pos = found + 1;
+
+     if (str3=="MEDName") _MEDName = str4.c_str();
+     if (str3=="NbPart") _NbPart = atoi(str4.c_str());
+     if (str3=="KeepFiles") _KeepFiles = (bool) atoi(str4.c_str());
    }
    return load;
 }
index 45fd4a7d2ad4d90d0788a8ed7761e5cb6d33e535..f97f9dbc59c419d680d845951d92c44070af6570 100755 (executable)
@@ -51,11 +51,10 @@ LIB_CLIENT_IDL = \
 # Libraries targets
 LIB = libGHS3DPRLEngine.la
 
-CPPFLAGS+=$(QT_INCLUDES)
-LDFLAGSFORBIN+=-lm $(QT_LIBS)
+LDFLAGSFORBIN+=-lm
 
 $(BIN):$(OBJ)
-       $(CC) $(CFLAGS) $(CPPFLAGS) -o $@ $(QT_LIBS)  $< 
+       $(CC) $(CFLAGS) $(CPPFLAGS) -o $@  $< 
 
 
 @CONCLUDE@
index f954477ebe1e0730458a5645b8a2b5c18ec4c8a8..f8883c6691f1bfa3ee9d40d6aa246c6562353734 100755 (executable)
@@ -30,6 +30,10 @@ VPATH=.:@srcdir@
 
 @COMMENCE@
 
-SUBDIRS = GHS3DPRLPlugin gui tepal2med
+SUBDIRS = GHS3DPRLPlugin
+
+ifeq (@WITHGUI@,yes)
+  SUBDIRS += gui tepal2med
+endif
 
 @MODULE@