From f03ef676ae63593e9ebbc03e01f0381b8de09552 Mon Sep 17 00:00:00 2001
From: Christophe Geuzaine <cgeuzaine@ulg.ac.be>
Date: Fri, 13 Feb 2015 13:42:19 +0000
Subject: [PATCH] simpler

---
 Common/CMakeLists.txt             |  8 +-------
 Common/gmshLocalNetworkClient.cpp |  8 ++++++--
 Common/gmshLocalNetworkClient.h   | 12 ++++++------
 3 files changed, 13 insertions(+), 15 deletions(-)

diff --git a/Common/CMakeLists.txt b/Common/CMakeLists.txt
index 440ddc255e..453870f029 100644
--- a/Common/CMakeLists.txt
+++ b/Common/CMakeLists.txt
@@ -24,14 +24,8 @@ set(SRC
   onelabUtils.cpp
   GamePad.cpp
   GmshRemote.cpp
+  gmshLocalNetworkClient.cpp
 )
 
-if(ENABLE_ONELAB AND NOT ENABLE_ONELAB2)
-  set(SRC
-    ${SRC}
-    gmshLocalNetworkClient.cpp
-  )
-endif(ENABLE_ONELAB AND NOT ENABLE_ONELAB2)
-
 file(GLOB HDR RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.h) 
 append_gmsh_src(Common "${SRC};${HDR}")
diff --git a/Common/gmshLocalNetworkClient.cpp b/Common/gmshLocalNetworkClient.cpp
index 25db11c1df..95b3e0b563 100644
--- a/Common/gmshLocalNetworkClient.cpp
+++ b/Common/gmshLocalNetworkClient.cpp
@@ -3,19 +3,22 @@
 // See the LICENSE.txt file for license information. Please report all
 // bugs and problems to the public mailing list <gmsh@geuz.org>.
 
-#include "gmshLocalNetworkClient.h"
 #include "GmshConfig.h"
 #include "Gmsh.h"
 #include "Context.h"
 #include "OS.h"
 #include "StringUtils.h"
-#include "onelabUtils.h"
 #include "OpenFile.h"
 #include "CreateFile.h"
 #include "PView.h"
 #include "Options.h"
 #include "GModel.h"
 
+#if defined(HAVE_ONELAB)
+
+#include "gmshLocalNetworkClient.h"
+#include "onelabUtils.h"
+
 #if defined(HAVE_FLTK)
 #include "FlGui.h"
 #include "onelabGroup.h"
@@ -862,3 +865,4 @@ void solver_batch_cb(void *data)
   }
 }
 
+#endif
diff --git a/Common/gmshLocalNetworkClient.h b/Common/gmshLocalNetworkClient.h
index 76835f23fa..3dce8eda92 100644
--- a/Common/gmshLocalNetworkClient.h
+++ b/Common/gmshLocalNetworkClient.h
@@ -8,6 +8,10 @@
 
 #include <vector>
 #include <algorithm>
+#include "GmshConfig.h"
+
+#if defined(HAVE_ONELAB)
+
 #include "onelab.h"
 
 class gmshLocalNetworkClient : public onelab::localNetworkClient{
@@ -58,15 +62,9 @@ class gmshLocalNetworkClient : public onelab::localNetworkClient{
     }
     return n;
   }
-#ifdef HAVE_ONELAB2 // Useless code in onelab2
-  bool receiveMessage(gmshLocalNetworkClient *master){return true;}
-  bool run(){return true;}
-  bool kill(){return true;}
-#else
   bool receiveMessage(gmshLocalNetworkClient *master);
   bool run();
   bool kill();
-#endif
 };
 
 // FIXME: move this to onelabUtils
@@ -82,3 +80,5 @@ void resetDb(bool runGmshClient);
 void solver_batch_cb(void *data);
 
 #endif
+
+#endif
-- 
GitLab