]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
PAR: SETUP.C macro to load library and set paths
authordberzano <dario.berzano@cern.ch>
Mon, 26 Jan 2015 14:33:28 +0000 (15:33 +0100)
committerdberzano <dario.berzano@cern.ch>
Thu, 29 Jan 2015 11:57:51 +0000 (12:57 +0100)
cmake/PARfiles/SETUP.C.in

index 90e2c1e74d242156467773e837375da31a4da3ee..cf01e48a30351dc3559b269aeb055a91288cfcf1 100644 (file)
@@ -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;
 }