From c9e942668186b49bd592a5927c7844b2a27101ca Mon Sep 17 00:00:00 2001
From: Christophe Geuzaine <cgeuzaine@ulg.ac.be>
Date: Fri, 4 Dec 2009 08:40:00 +0000
Subject: [PATCH] fix compile

---
 Geo/GModel.cpp          | 10 ++++++++++
 Geo/GModel.h            | 11 +----------
 Geo/LuaBindings_Geo.cpp |  5 +++++
 3 files changed, 16 insertions(+), 10 deletions(-)

diff --git a/Geo/GModel.cpp b/Geo/GModel.cpp
index f860a2cf2b..4c37dedfb9 100644
--- a/Geo/GModel.cpp
+++ b/Geo/GModel.cpp
@@ -72,6 +72,16 @@ GModel *GModel::current(int index)
   return list[_current];
 }
 
+int GModel::setCurrent(GModel *m)
+{
+  for (unsigned int i = 0; i < list.size(); i++){
+    if (list[i] == m){
+      _current = i;
+      return i;
+    }
+  }
+}
+
 GModel *GModel::findByName(std::string name)
 {
   // return last mesh with given name
diff --git a/Geo/GModel.h b/Geo/GModel.h
index 719d9b6245..be75c7eb3c 100644
--- a/Geo/GModel.h
+++ b/Geo/GModel.h
@@ -122,16 +122,7 @@ class GModel
   static GModel *current(int index=-1);
   
   // sets a model to current
-  static int setCurrent(GModel *m){
-    for (int i=0;i<list.size();i++){
-      if (list[i] ==m){
-	_current = i;
-	return i;
-      }
-    }
-  }
-  
-
+  static int setCurrent(GModel *m);
 
   // find a model by name
   static GModel *findByName(std::string name);
diff --git a/Geo/LuaBindings_Geo.cpp b/Geo/LuaBindings_Geo.cpp
index a9cd89477d..f237b3d0cd 100644
--- a/Geo/LuaBindings_Geo.cpp
+++ b/Geo/LuaBindings_Geo.cpp
@@ -1,6 +1,9 @@
 #include "LuaBindings_Geo.h"
 #include "OpenFile.h"
 #include "CreateFile.h"
+
+#if defined(HAVE_LUA)
+
 // define the name of the object that will be used
 // in Lua
 
@@ -49,3 +52,5 @@ int LuaGModel::save(lua_State *L){
   GModel::setCurrent(temp);
   return 1;
 }
+
+#endif
-- 
GitLab