summaryrefslogtreecommitdiff
path: root/src/parsersettings.cc
diff options
context:
space:
mode:
authorMarius Kintel <marius@kintel.net>2012-10-24 02:10:15 (GMT)
committerMarius Kintel <marius@kintel.net>2012-10-24 02:10:15 (GMT)
commitebf9ee0f9f525d91b34224565da2d594d500484f (patch)
tree2a33f255392bd154166ef96f515a8590b689442b /src/parsersettings.cc
parent5467bc94116c7e3f22210ace64e0678fff4d4347 (diff)
Support specifying an OPENSCADPATH environment variable which will have precedence over the hardcoded library paths. First step of issue #125
Diffstat (limited to 'src/parsersettings.cc')
-rw-r--r--src/parsersettings.cc10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/parsersettings.cc b/src/parsersettings.cc
index 47859c7..3dda132 100644
--- a/src/parsersettings.cc
+++ b/src/parsersettings.cc
@@ -28,7 +28,15 @@ std::string locate_file(const std::string &filename)
void parser_init(const std::string &applicationpath)
{
- // FIXME: Append paths from OPENSCADPATH before adding built-in paths
+ // Add path from OPENSCADPATH before adding built-in paths
+ const char *openscadpath = getenv("OPENSCADPATH");
+ if (openscadpath) {
+ add_librarydir(boosty::absolute(fs::path(openscadpath)).string());
+ }
+
+ // FIXME: Support specifying more than one path in OPENSCADPATH
+ // FIXME: Add ~/.openscad/libraries
+ // FIXME: Add ~/Documents/OpenSCAD/libraries on Mac?
std::string librarydir;
fs::path libdir(applicationpath);
contact: Jan Huwald // Impressum