]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - EVE/Alieve/alieve_main/alieve_main.cxx
Remove EVE/Reve/ sub-module.
[u/mrichter/AliRoot.git] / EVE / Alieve / alieve_main / alieve_main.cxx
index 4ba1fd2def085af62c08187b2a17715f0fd47ad9..326c0cd953f370f420eb1a115be33fd84e8c3293 100644 (file)
@@ -1,13 +1,47 @@
-#include <Reve/Reve.h>
-#include <Reve/ReveManager.h>
+#include <TInterpreter.h>
+#include <TRint.h>
+#include <TROOT.h>
+#include <TSystem.h>
+#include <TError.h>
+
+#include <TEveUtil.h>
+#include <TEveManager.h>
 
 #include <Getline.h>
 
 int main(int argc, char **argv)
 {
-  Reve::SetupEnvironment();
+  static const TEveException eH("alieve::main");
+
+  if(gSystem->Getenv("REVESYS") == 0) {
+    if(gSystem->Getenv("ALICE_ROOT") != 0) {
+      Info(eH.Data(), "setting REVESYS from ALICE_ROOT.");
+      gSystem->Setenv("REVESYS", Form("%s/EVE", gSystem->Getenv("ALICE_ROOT")));
+    } else {
+      Error(eH.Data(), "REVESYS not defined, neither is ALICE_ROOT.");
+      gSystem->Exit(1);
+    }
+  }
+  if(gSystem->AccessPathName(gSystem->Getenv("REVESYS")) == kTRUE) {
+    Error(eH.Data(), "REVESYS '%s' does not exist.", gSystem->Getenv("REVESYS"));
+    gSystem->Exit(1);
+  }
+
+  TString macPath(gROOT->GetMacroPath());
+  macPath += Form(":%s/macros", gSystem->Getenv("REVESYS"));
+  gInterpreter->AddIncludePath(gSystem->Getenv("REVESYS"));
+  if(gSystem->Getenv("ALICE_ROOT") != 0) {
+    macPath += Form(":%s/alice-macros", gSystem->Getenv("REVESYS"));
+    gInterpreter->AddIncludePath(Form("%s/include", gSystem->Getenv("ALICE_ROOT")));
+    gInterpreter->AddIncludePath(gSystem->Getenv("ALICE_ROOT"));
+  }
+  gROOT->SetMacroPath(macPath);
+
+  TRint app("App", &argc, argv);
+
+  TEveManager::Create();
+
 
-  int r = Reve::ReveManager::SpawnGuiAndRun(argc, argv);
-  Getlinem(kCleanUp, 0);
-  return r;
+  app.Run(); // Never returns.
+  return 0;
 }