Changes for Root6 (Mikolaj)
[u/mrichter/AliRoot.git] / cmake / PARfiles / SETUP.C.in
CommitLineData
18e073a8 1// Automatically generated SETUP.C for @PARMODULE@
2
3Int_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)
0c9d4db8 9 // TODO: prepend path instead of appending (not currently supported by ROOT!)
18e073a8 10 buf.Form(".include %s", wd);
11 gROOT->ProcessLine(buf.Data());
12
0c9d4db8 13 // Prepend include path for compiled code
18e073a8 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
0c9d4db8 21 // Add our rootmap
22 // TODO: disabled because it triggers actual library loading wherever it finds nested classes!
2411193e 23 // (this is a ROOT bug)
0c9d4db8 24 // buf.Form("%s/lib@PARMODULE@.rootmap", wd);
25 // gInterpreter->UnloadLibraryMap("lib@PARMODULE@");
26 // gInterpreter->LoadLibraryMap(buf.Data());
18e073a8 27
5fc5c635 28 // Append this PARfile's name to the list of currently enabled ones in an environment variable.
29 // The variable will be used by other PARfiles in order to correctly set some paths during the
30 // PARfile build process
31 const char *parEnvVarName = "ALICE_PARFILES_ENABLED";
32 TString parEnvVar = gSystem->Getenv(parEnvVarName);
33 if (!parEnvVar.IsNull()) {
34 parEnvVar.Append(" ");
35 }
36 parEnvVar.Append("@PARMODULE@");
37 gSystem->Setenv(parEnvVarName, parEnvVar.Data());
38
2411193e 39 // Here we load the library, but beware: if using multiple PARfiles for overriding multiple
40 // AliRoot libraries, they must be loaded in the correct order. With the autoloading, it might
41 // happen that the *wrong* library gets loaded as a dependency
42 gSystem->Load("lib@PARMODULE@");
18e073a8 43
44 return 0;
b24da1d3 45}