Changeset 19264


Ignore:
Timestamp:
Oct 22, 2018, 7:21:15 PM (8 months ago)
Author:
tbretz
Message:
Comaptibility with root 6 -- a slightly different way to load the library.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Mars/cmake/rootlogon.C.in

    r19242 r19264  
    4444#include <iomanip>
    4545
     46#if defined (R__ADD_LIBRARY_PATH) && defined (R__LOAD_LIBRARY)
     47R__ADD_LIBRARY_PATH(${PROJECT_BINARY_DIR}/dictionary)
     48R__LOAD_LIBRARY(libmars.so)
     49#endif
    4650
    4751Bool_t isloaded()
     
    5256}
    5357
    54 void unload()
    55 {
    56     if (!isloaded())
    57         return;
    58 
    59     cout << "Unloading 'libmars.so'... " << flush;
    60     if (gSystem->Unload("libmars.so"))
    61         cout << "error!" << endl;
    62     else
    63         cout << "done." << endl << endl;
    64 }
    65 
    66 bool load(TString &dir)
     58bool load()
    6759{
    6860    if (isloaded())
    69         return;
     61        return true;
    7062
    71     cout << "\033[33m\033[1m" << "Loading '" << dir << "/libmars.so'... " << "\033[0m" << flush;
     63    cout << "\033[33m\033[1m" << "Loading 'libmars.so'... " << "\033[0m" << flush;
    7264
    73     if (dir.IsNull())
    74         dir = "./";
    75 
    76     if (gSystem->Load(dir+"/libmars.so")!=0)
     65    if (gSystem->Load("${PROJECT_BINARY_DIR}/libmars.so")!=0)
    7766    {
    7867        cout << "\033[31m\033[1m" << "error!" << endl;
     
    9887    cout << endl;
    9988
    100     if (!load("${PROJECT_BINARY_DIR}"))
     89    if (gROOT->GetVersionInt()<60000 && !load())
     90        return;                                 
     91                                   
     92    MLog::RedirectErrorHandler(MLog::kColor);
     93
     94    cout << "\033[32m" << "Welcome to the Mars Root environment." << "\033[0m" << endl;
     95    cout << endl;
     96
     97    if (gROOT->GetVersionInt()>=60000)
    10198        return;
    102 
    103     MLog::RedirectErrorHandler(MLog::kColor);
    10499
    105100    // This initialized the thread factory. This is needed to supress
     
    178173    gSystem->SetFlagsOpt(opt);
    179174    gSystem->SetFlagsDebug(dbg);
    180 
    181 
    182     cout << "\033[32m" << "Welcome to the Mars Root environment." << "\033[0m" << endl;
    183     cout << endl;
    184175}
Note: See TracChangeset for help on using the changeset viewer.