49 FILE* pipe = gSystem->OpenPipe(
"geant4-config --libs",
"r");
50 std::string all_lines;
52 while ( fgets(line,
sizeof(line), pipe ) != NULL ) {
56 TString all_lines_t(all_lines.data());
57 all_lines_t.Remove(all_lines_t.First(
'\n'));
59 TObjArray* libs = all_lines_t.Tokenize(
" ");
62 for (Int_t i=libs->GetEntriesFast()-1; i>=0; i-- ) {
63 TString addPath = ((TObjString*)libs->At(i))->GetString();
64 if (addPath.BeginsWith(
"-L")) {
66 addPath.ReplaceAll(
"\"",
"");
68 gSystem->AddDynamicPath(addPath.Data());
72 cout << libs->GetEntriesFast() << endl;
73 for (Int_t i=libs->GetEntriesFast()-1; i>=0; i-- ) {
74 TString lib = ((TObjString*)libs->At(i))->GetString();
75 lib.ReplaceAll(
"-l",
"lib");
77 if(lib.BeginsWith(
"lib"))
78 gSystem->Load(lib.Data());
81 gSystem->SetFPEMask(0);