centralize more XML startup files.

This commit is contained in:
suter_a 2016-02-25 18:19:29 +01:00
parent a0f7d5e934
commit a5e9191f15
2 changed files with 14 additions and 2 deletions

View File

@ -62,3 +62,13 @@ install-exec-hook:
uninstall-hook: uninstall-hook:
rm -f $(libdir)/libPNL_PippardFitter.so rm -f $(libdir)/libPNL_PippardFitter.so
endif endif
xmldir = $(HOME)/.musrfit/external
xml_DATA = nonlocal_startup.xml
install-xml_DATA: $(xml_DATA)
$(INSTALL_DATA) '$(xml_DATA)' '$xmldir'
uninstall-xml_DATA: $(xml_DATA)
$(RM) '$(xml_DATA)' '$xmldir'

View File

@ -56,7 +56,8 @@ PNL_StartupHandler::PNL_StartupHandler()
fTrimSpDataPath = TString(""); fTrimSpDataPath = TString("");
// get default path (for the moment only linux like) // get default path (for the moment only linux like)
char startup_path_name[128]; char startup_path_name[512];
char *home_str;
// check if the startup file is found in the current directory // check if the startup file is found in the current directory
strcpy(startup_path_name, "./nonlocal_startup.xml"); strcpy(startup_path_name, "./nonlocal_startup.xml");
@ -65,7 +66,8 @@ PNL_StartupHandler::PNL_StartupHandler()
fStartupFilePath = TString(startup_path_name); fStartupFilePath = TString(startup_path_name);
} else { // startup file is not found in the current directory } else { // startup file is not found in the current directory
cout << endl << "PNL_StartupHandler(): **WARNING** Couldn't find nonlocal_startup.xml in the current directory, will try default one." << endl; cout << endl << "PNL_StartupHandler(): **WARNING** Couldn't find nonlocal_startup.xml in the current directory, will try default one." << endl;
strncpy(startup_path_name, "/home/nemu/analysis/musrfit/src/external/Nonlocal/nonlocal_startup.xml", sizeof(startup_path_name)); home_str = getenv("$HOME");
snprintf(startup_path_name, sizeof(startup_path_name), "%s/.musrfit/nonlocal_startup.xml", home_str);
if (StartupFileExists(startup_path_name)) { if (StartupFileExists(startup_path_name)) {
fStartupFileFound = true; fStartupFileFound = true;
fStartupFilePath = TString(startup_path_name); fStartupFilePath = TString(startup_path_name);