Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Support specifying an OPENSCADPATH environment variable which will ha…

…ve precedence over the hardcoded library paths. First step of issue #125
  • Loading branch information...
commit ebf9ee0f9f525d91b34224565da2d594d500484f 1 parent 5467bc9
@kintel kintel authored
Showing with 10 additions and 1 deletion.
  1. +1 −0  doc/TODO.txt
  2. +9 −1 src/parsersettings.cc
View
1  doc/TODO.txt
@@ -240,6 +240,7 @@ o Collect "all" available OpenSCAD scripts from the internets and run the integr
MISSING TESTS:
--------------
o cmd-line -D variable override
+o OPENSCADPATH env.variable
o all functions
o mirror
o scale
View
10 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);
Please sign in to comment.
Something went wrong with that request. Please try again.