Changeset 486:774bfa9c0dc8 in finroc_core


Ignore:
Timestamp:
26.10.2021 17:10:03 (20 months ago)
Author:
Tobias Föhst <foehst@…>
Branch:
17.03
Children:
487:3ae47727c72a, 488:9bcc51cd5ba0
Phase:
public
Message:

Adds environment variable FINROC_FILE_LOOKUP_PATH to define a place to look for e.g. a system installation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • file_lookup.cpp

    r482 r486  
    3636#include <unistd.h> 
    3737#include <limits.h> 
     38#include "rrlib/util/string.h" 
    3839 
    3940//---------------------------------------------------------------------- 
     
    106107    cwd = std::string(cwd_cstring) + "/"; 
    107108    paths.push_back(cwd); 
     109  } 
     110 
     111  const char *finroc_file_lookup_path = getenv("FINROC_FILE_LOOKUP_PATH"); 
     112  if (finroc_file_lookup_path) 
     113  { 
     114    std::vector<std::string> tokens; 
     115    rrlib::util::Tokenize(finroc_file_lookup_path, tokens, ":"); 
     116    for (auto & x : tokens) 
     117    { 
     118      x.append("/sources/cpp/"); 
     119    } 
     120    std::copy(tokens.begin(), tokens.end(), std::back_inserter(paths)); 
    108121  } 
    109122  return paths; 
Note: See TracChangeset for help on using the changeset viewer.