]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PWGLF/FORWARD/trains/trainMain.cxx
Merge branch 'master' of https://git.cern.ch/reps/AliRoot
[u/mrichter/AliRoot.git] / PWGLF / FORWARD / trains / trainMain.cxx
index 4436789fe2292690cae69956c08d0259e44900c6..a1f38bfbc00a531ce2290a794ac95dd32af2acdf 100644 (file)
@@ -114,6 +114,7 @@ void ProgramUsage(const char* progname, std::ostream& o)
   PrintFakeOption(o, "class=CLASS",       "Train class");
   PrintFakeOption(o, "name=NAME",         "Name of train");
   PrintFakeOption(o, "include=DIRECTORY", "Append dir to macro/header path");
+  PrintFakeOption(o, "define=DEFINE",     "Set a preprocessor macro");
   PrintFakeOption(o, "batch",             "Batch mode");
   PrintFakeOption(o, "spawn",             "Spawn interactive ROOT shell");
 }
@@ -142,6 +143,7 @@ main(int argc, char** argv)
 {
   TList optList;
   TList paths;
+  TList defines;
   TString name;
   TString cls;
   TString where;
@@ -163,7 +165,7 @@ main(int argc, char** argv)
       if      (arg.BeginsWith("--class"))   cls  = val;
       else if (arg.BeginsWith("--name"))    name = val;
       else if (arg.BeginsWith("--include")) paths.Add(new TObjString(val)); 
-      // AppendPath(val);
+      else if (arg.BeginsWith("--define"))  defines.Add(new TObjString(val));
       else if (arg.BeginsWith("--batch"))   batch  = true;
       else if (arg.BeginsWith("--help"))    help   = true;
       else if (arg.BeginsWith("--where"))   where  = val;
@@ -186,6 +188,10 @@ main(int argc, char** argv)
   TIter nextP(&paths);
   TObject* path = 0;
   while ((path = nextP())) AppendPath(path->GetName());
+  TIter nextD(&defines);
+  TObject* def = 0;
+  while ((def = nextD())) 
+    gSystem->AddIncludePath(Form("-D%s", def->GetName()));
 
   // --- Initial check or URI/WHERE ----------------------------------
   if (!where.IsNull()) {