AliRoot Core  da88d91 (da88d91)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Compile.C
Go to the documentation of this file.
1 //____________________________________________________________________
2 //
3 // $Id$
4 //
5 // Script to compile (using ACLic) and load a script. It sets the
6 // include path to contain the relevant directories.
7 //
21 void
22 AddInclude(const char* what)
23 {
24  TString path(gSystem->GetIncludePath());
25  if (path.Contains(what)) return;
26  gSystem->AddIncludePath(what);
27 }
28 Bool_t
29 Compile(const char* script=0, Option_t* option="g")
30 {
31  if (!script || script[0] == '\0') {
32  std::cerr << "No script to compile!" << std::endl;
33  return kFALSE;
34  }
35  gSystem->Load("libANALYSIS");
36  gSystem->Load("libANALYSISalice");
37  gSystem->Load("libFMDutil");
38  TString macroPath(gROOT->GetMacroPath());
39  macroPath.Append(":${ALICE_ROOT}/FMD/scripts");
40  gROOT->SetMacroPath(macroPath.Data());
41  AddInclude("-I`root-config --incdir`");
42  AddInclude("-I${ALICE_ROOT}");
43  AddInclude("-I${ALICE_ROOT}/include");
44  AddInclude("-I${ALICE_ROOT}/FMD");
45  AddInclude("-I${ALICE_ROOT}/geant3/TGeant3");
46  AddInclude("-I${ALICE_ROOT}/../master-src");
47  AddInclude("-I${ALICE_ROOT}/../master-src/FMD");
48  AddInclude("-I${ALICE_ROOT}/../master-src/RAW");
49  Long_t ret = gROOT->ProcessLine(Form(".L %s+%s", script, option));
50  return ret == 0;
51 }
52 
53 //____________________________________________________________________
54 //
55 // EOF
56 //
const char * path
void AddInclude(const char *what)
Definition: Compile.C:22
TROOT * gROOT
Bool_t Compile(const char *script=0, Option_t *option="g")
Definition: Compile.C:29