centralize XML startup files

This commit is contained in:
suter_a 2016-02-26 08:30:50 +01:00
parent 4d2d7c860e
commit 3ff1bebd9d
3 changed files with 17 additions and 4 deletions

View File

@ -28,7 +28,7 @@ AM_CXXFLAGS = $(LOCAL_LIB_CXXFLAGS)
BUILT_SOURCES = $(dict_cpp_sources) $(dict_h_sources) BUILT_SOURCES = $(dict_cpp_sources) $(dict_h_sources)
AM_LDFLAGS = $(LOCAL_LIB_LDFLAGS) -L@ROOTLIBDIR@ AM_LDFLAGS = $(LOCAL_LIB_LDFLAGS) -L@ROOTLIBDIR@
CLEANFILES = ../include/*Dict.cpp ../include/*Dict.h *~ core CLEANFILES = ../classes/*Dict* ../include/*Dict.* *~ core
%Dict.cpp %Dict.h: ../include/%.h ../include/%LinkDef.h %Dict.cpp %Dict.h: ../include/%.h ../include/%LinkDef.h
@ROOTCINT@ -v -f $*Dict.cpp -c -p $(AM_CPPFLAGS) $^ @ROOTCINT@ -v -f $*Dict.cpp -c -p $(AM_CPPFLAGS) $^

View File

@ -28,7 +28,7 @@ AM_CXXFLAGS = $(LOCAL_LIB_CXXFLAGS)
BUILT_SOURCES = $(dict_cpp_sources) $(dict_h_sources) BUILT_SOURCES = $(dict_cpp_sources) $(dict_h_sources)
AM_LDFLAGS = $(LOCAL_LIB_LDFLAGS) -L@ROOTLIBDIR@ AM_LDFLAGS = $(LOCAL_LIB_LDFLAGS) -L@ROOTLIBDIR@
CLEANFILES = ../include/*Dict.cpp ../include/*Dict.h *~ core CLEANFILES = ../classes/*Dict.* ../include/*Dict.* *~ core
%Dict.cpp %Dict.h: ../include/%.h ../include/%LinkDef.h %Dict.cpp %Dict.h: ../include/%.h ../include/%LinkDef.h
@ROOTCINT@ -v -f $*Dict.cpp -c -p $(AM_CPPFLAGS) $^ @ROOTCINT@ -v -f $*Dict.cpp -c -p $(AM_CPPFLAGS) $^
@ -59,3 +59,14 @@ install-exec-hook:
uninstall-hook: uninstall-hook:
rm -f $(libdir)/libPSpinValve.so rm -f $(libdir)/libPSpinValve.so
endif endif
# define default xml install
xmldir = $(HOME)/.musrfit/external
xml_DATA = ../test/spinValve_startup.xml
instal-xml_DATA: $(xml_DATA)
$(INSTALL_DATA) '$(xml_DATA)' '$(xmldir)'
uninstal-xml_DATA: $(xml_DATA)
$(RM) '$(xml_DATA)' '$(xmldir)'

View File

@ -52,6 +52,7 @@ PStartupHandler_SV::PStartupHandler_SV()
// 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[128];
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, "./spinValve_startup.xml"); strcpy(startup_path_name, "./spinValve_startup.xml");
@ -59,8 +60,9 @@ PStartupHandler_SV::PStartupHandler_SV()
fStartupFileFound = true; fStartupFileFound = true;
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_SV(): **WARNING** Couldn't find skewedLorentzian_startup.xml in the current directory, will try default one." << endl; cout << endl << ">> PStartupHandler_SV(): **WARNING** Couldn't find spinValve_startup.xml in the current directory, will try default one." << endl;
strncpy(startup_path_name, "/home/nemu/analysis/musrfit/src/external/libSpinValve/test/spinValve_startup.xml", sizeof(startup_path_name)); home_path = getenv("HOME");
snprintf(startup_path_name, sizeof(startup_path_name), "%s/.musrfit/external/spinValve_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);