-
- if ( getenv("top_srcdir") ) {
- // we are in 'make check' step
- resourceFile = getenv("top_srcdir");
- resourceFile += "/resources/";
- }
- else if ( getenv("MED_ROOT_DIR") ) {
- // use MED_ROOT_DIR env.var
- resourceFile = getenv("MED_ROOT_DIR");
- resourceFile += "/share/salome/resources/med/";
+ if ( getenv("MEDCOUPLING_ROOT_DIR") ) {
+ // use MEDCOUPLING_ROOT_DIR env.var
+ resourceFile = getenv("MEDCOUPLING_ROOT_DIR");
+ resourceFile += "/share/resources/med/";
+ resourceFile += filename;
+ std::ifstream my_file(resourceFile.c_str());
+ if (my_file.good())
+ return resourceFile;