Index: trunk/Mars/cmake/rootlogon.C.in
===================================================================
--- trunk/Mars/cmake/rootlogon.C.in	(revision 19242)
+++ trunk/Mars/cmake/rootlogon.C.in	(revision 19264)
@@ -44,4 +44,8 @@
 #include <iomanip>
 
+#if defined (R__ADD_LIBRARY_PATH) && defined (R__LOAD_LIBRARY)
+R__ADD_LIBRARY_PATH(${PROJECT_BINARY_DIR}/dictionary)
+R__LOAD_LIBRARY(libmars.so)
+#endif
 
 Bool_t isloaded()
@@ -52,27 +56,12 @@
 }
 
-void unload()
-{
-    if (!isloaded())
-        return;
-
-    cout << "Unloading 'libmars.so'... " << flush;
-    if (gSystem->Unload("libmars.so"))
-        cout << "error!" << endl;
-    else
-        cout << "done." << endl << endl;
-}
-
-bool load(TString &dir)
+bool load()
 {
     if (isloaded())
-        return;
+        return true;
 
-    cout << "\033[33m\033[1m" << "Loading '" << dir << "/libmars.so'... " << "\033[0m" << flush;
+    cout << "\033[33m\033[1m" << "Loading 'libmars.so'... " << "\033[0m" << flush;
 
-    if (dir.IsNull())
-        dir = "./";
-
-    if (gSystem->Load(dir+"/libmars.so")!=0)
+    if (gSystem->Load("${PROJECT_BINARY_DIR}/libmars.so")!=0)
     {
         cout << "\033[31m\033[1m" << "error!" << endl;
@@ -98,8 +87,14 @@
     cout << endl;
 
-    if (!load("${PROJECT_BINARY_DIR}"))
+    if (gROOT->GetVersionInt()<60000 && !load())
+        return;                             	
+                                    
+    MLog::RedirectErrorHandler(MLog::kColor);
+
+    cout << "\033[32m" << "Welcome to the Mars Root environment." << "\033[0m" << endl;
+    cout << endl;
+
+    if (gROOT->GetVersionInt()>=60000)
         return;
-
-    MLog::RedirectErrorHandler(MLog::kColor);
 
     // This initialized the thread factory. This is needed to supress
@@ -178,7 +173,3 @@
     gSystem->SetFlagsOpt(opt);
     gSystem->SetFlagsDebug(dbg);
-
-
-    cout << "\033[32m" << "Welcome to the Mars Root environment." << "\033[0m" << endl;
-    cout << endl;
 }
