]> git.uio.no Git - u/mrichter/AliRoot.git/blame - FMD/scripts/Compile.C
minor bugfix: negative return value in case of error
[u/mrichter/AliRoot.git] / FMD / scripts / Compile.C
CommitLineData
bf000c32 1//____________________________________________________________________
a1f80595 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//
9b48326f 8/** @defgroup FMD_script Scripts
9 @brief Scripts for the FMD
10*/
11/** @defgroup simple_script Simple scripts
12 @ingroup FMD_script
13 @brief Scripts for the FMD
14*/
15/** Compile an FMD script using ACLic
16 @param script Script to compile
17 @param option Compile option
18 @ingroup FMD_script
19*/
e173c769 20void
21AddInclude(const char* what)
22{
23 TString path(gSystem->GetIncludePath());
24 if (path.Contains(what)) return;
25 gSystem->AddIncludePath(what);
26}
9b98d361 27Bool_t
8f6ee336 28Compile(const char* script, Option_t* option="g")
a1f80595 29{
9b98d361 30 if (!script || script[0] == '\0') {
31 std::cerr << "No script to compile!" << std::endl;
32 return kFALSE;
33 }
83ad576a 34 gSystem->Load("libANALYSIS.so");
35 gSystem->Load("libANALYSISalice.so");
a1f80595 36 gSystem->Load("libFMDutil.so");
9b98d361 37 TString macroPath(gROOT->GetMacroPath());
38 macroPath.Append(":${ALICE_ROOT}/FMD/scripts");
39 gROOT->SetMacroPath(macroPath.Data());
e173c769 40 AddInclude("-I`root-config --incdir`");
41 AddInclude("-I${ALICE_ROOT}");
42 AddInclude("-I${ALICE_ROOT}/include");
43 AddInclude("-I${ALICE_ROOT}/FMD");
44 AddInclude("-I${ALICE_ROOT}/geant3/TGeant3");
45 AddInclude("-I${ALICE_ROOT}/../aliroot.trunk");
46 AddInclude("-I${ALICE_ROOT}/../aliroot.trunk/FMD");
47 AddInclude("-I${ALICE_ROOT}/../aliroot.trunk/RAW");
9b98d361 48 Long_t ret = gROOT->ProcessLine(Form(".L %s+%s", script, option));
49 return ret == 0;
a1f80595 50}
51
52//____________________________________________________________________
53//
54// EOF
55//