]> git.uio.no Git - u/mrichter/AliRoot.git/blob - cmake/PARfiles/SETUP.C.in
PAR: loading library in SETUP.C
[u/mrichter/AliRoot.git] / cmake / PARfiles / SETUP.C.in
1 // Automatically generated SETUP.C for @PARMODULE@
2
3 Int_t SETUP()
4 {
5   TString buf;
6   const char *wd = gSystem->WorkingDirectory();
7
8   // Set include path for CINT (PARfile is unpacked as a subfolder of current workdir)
9   // TODO: prepend path instead of appending (not currently supported by ROOT!)
10   buf.Form(".include %s", wd);
11   gROOT->ProcessLine(buf.Data());
12
13   // Prepend include path for compiled code
14   buf.Form("-I%s %s", wd, gSystem->GetIncludePath());
15   gSystem->SetIncludePath(buf.Data());
16
17   // Prepend library path
18   buf.Form("%s:%s", wd, gSystem->GetDynamicPath());
19   gSystem->SetDynamicPath(buf.Data());
20
21   // Add our rootmap
22   // TODO: disabled because it triggers actual library loading wherever it finds nested classes!
23   // (this is a ROOT bug)
24   // buf.Form("%s/lib@PARMODULE@.rootmap", wd);
25   // gInterpreter->UnloadLibraryMap("lib@PARMODULE@");
26   // gInterpreter->LoadLibraryMap(buf.Data());
27
28   // Here we load the library, but beware: if using multiple PARfiles for overriding multiple
29   // AliRoot libraries, they must be loaded in the correct order. With the autoloading, it might
30   // happen that the *wrong* library gets loaded as a dependency
31   gSystem->Load("lib@PARMODULE@");
32
33   return 0;
34 }