Add to macro path

Is there a way to add a directory to the macro path from inside a program?

I thought at first that gROOT->SetMacroPath(<path>) would work, but it seems that the description “Set or extend the macro search path.” is wrong. Using this function replaces the macro path (as read from .rootrc) with the supplied path. Or is this meant to be used with GetMacroPath in calling something like gROOT->SetMacroPath(gROOT->GetMacroPath() + <path>) where the new path is manually added to the existing path? If so I think the description of SetMacroPath is misleading.

1 Like

TROOT::SetMacroPath(TString(TROOT::GetMacroPath()) + "/my/own/path:");

So the description of SetMacroPath is wrong, it does not extend the path, it just sets it. This should be updated.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.