more work towards centralizing default startup XML files.
This commit is contained in:
parent
a5e9191f15
commit
4d2d7c860e
6
src/external/Nonlocal/PNL_StartupHandler.cpp
vendored
6
src/external/Nonlocal/PNL_StartupHandler.cpp
vendored
@ -5,8 +5,6 @@
|
|||||||
Author: Andreas Suter
|
Author: Andreas Suter
|
||||||
e-mail: andreas.suter@psi.ch
|
e-mail: andreas.suter@psi.ch
|
||||||
|
|
||||||
$Id$
|
|
||||||
|
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
@ -57,7 +55,7 @@ PNL_StartupHandler::PNL_StartupHandler()
|
|||||||
|
|
||||||
// get default path (for the moment only linux like)
|
// get default path (for the moment only linux like)
|
||||||
char startup_path_name[512];
|
char startup_path_name[512];
|
||||||
char *home_str;
|
char *home_str=0;
|
||||||
|
|
||||||
// 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");
|
||||||
@ -66,7 +64,7 @@ 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;
|
||||||
home_str = getenv("$HOME");
|
home_str = getenv("HOME");
|
||||||
snprintf(startup_path_name, sizeof(startup_path_name), "%s/.musrfit/nonlocal_startup.xml", home_str);
|
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;
|
||||||
|
@ -59,3 +59,14 @@ install-exec-hook:
|
|||||||
uninstall-hook:
|
uninstall-hook:
|
||||||
rm -f $(libdir)/libPPhotoMeissner.so
|
rm -f $(libdir)/libPPhotoMeissner.so
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
# define default xml install
|
||||||
|
xmldir = $(HOME)/.musrfit/external
|
||||||
|
xml_DATA = ../test/photoMeissner_startup.xml
|
||||||
|
|
||||||
|
instal-xml_DATA: $(xml_DATA)
|
||||||
|
$(INSTALL_DATA) '$(xml_DATA)' '$(xmldir)'
|
||||||
|
|
||||||
|
uninstal-xml_DATA: $(xml_DATA)
|
||||||
|
$(RM) '$(xml_DATA)' '$(xmldir)'
|
||||||
|
|
||||||
|
@ -231,7 +231,8 @@ PStartupHandler_PM::PStartupHandler_PM()
|
|||||||
fStartupFilePath = "";
|
fStartupFilePath = "";
|
||||||
|
|
||||||
// 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_path=0;
|
||||||
|
|
||||||
// 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, "./photoMeissner_startup.xml");
|
strcpy(startup_path_name, "./photoMeissner_startup.xml");
|
||||||
@ -240,7 +241,8 @@ PStartupHandler_PM::PStartupHandler_PM()
|
|||||||
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 << ">> PStartupHandler_PM(): **WARNING** Couldn't find photoMeissner_startup.xml in the current directory, will try default one." << endl;
|
cout << endl << ">> PStartupHandler_PM(): **WARNING** Couldn't find photoMeissner_startup.xml in the current directory, will try default one." << endl;
|
||||||
strncpy(startup_path_name, "/home/nemu/analysis/musrfit/src/external/libPhotoMeissner/test/photoMeissner_startup.xml", sizeof(startup_path_name));
|
home_path = getenv("HOME");
|
||||||
|
snprintf(startup_path_name, sizeof(startup_path_name), "%s/.musrfit/external/photoMeissner_startup.xml", home_path);
|
||||||
if (StartupFileExists(startup_path_name)) {
|
if (StartupFileExists(startup_path_name)) {
|
||||||
fStartupFileFound = true;
|
fStartupFileFound = true;
|
||||||
fStartupFilePath = TString(startup_path_name);
|
fStartupFilePath = TString(startup_path_name);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user