From: dberzano Date: Mon, 26 Jan 2015 14:33:28 +0000 (+0100) Subject: PAR: SETUP.C macro to load library and set paths X-Git-Url: http://git.uio.no/git/?p=u%2Fmrichter%2FAliRoot.git;a=commitdiff_plain;h=18e073a8d495a7961697f17a2dd37c8c7c9481a7 PAR: SETUP.C macro to load library and set paths --- diff --git a/cmake/PARfiles/SETUP.C.in b/cmake/PARfiles/SETUP.C.in index 90e2c1e74d2..cf01e48a303 100644 --- a/cmake/PARfiles/SETUP.C.in +++ b/cmake/PARfiles/SETUP.C.in @@ -1,3 +1,34 @@ -Int_t SETUP() { - Printf("Hello world!"); +// Automatically generated SETUP.C for @PARMODULE@ + +Int_t SETUP() +{ + TString buf; + const char *wd = gSystem->WorkingDirectory(); + + // Set include path for CINT (PARfile is unpacked as a subfolder of current workdir) + buf.Form(".include %s", wd); + gROOT->ProcessLine(buf.Data()); + + // Prepend include path for other stuff + buf.Form("-I%s %s", wd, gSystem->GetIncludePath()); + gSystem->SetIncludePath(buf.Data()); + + // Prepend library path + buf.Form("%s:%s", wd, gSystem->GetDynamicPath()); + gSystem->SetDynamicPath(buf.Data()); + + // Load library + if ( gSystem->Load("lib@PARMODULE@") < 0 ) { + // Error loading + return -1; + } + + // Set our location, so that other packages can find us + //gSystem->Setenv("@PARMODULE@_INCLUDE", "@PARMODULE@"); + + // Set our lib coordinates, so that other packages can link to us + //buf.Form("-L%s -l@PARMODULE@", wd); + //gSystem->Setenv("@PARMODULE@_LIBS", buf.Data()); + + return 0; }