diff options
author | Marius Kintel <marius@kintel.net> | 2013-10-07 22:49:08 (GMT) |
---|---|---|
committer | Marius Kintel <marius@kintel.net> | 2013-10-07 22:49:08 (GMT) |
commit | 80e5d42f474919641af3b01d0d317a8365e16e1e (patch) | |
tree | 3f6f6b860b1042671f6d7a65a1b3b136c5bede10 /src/parsersettings.cc | |
parent | 4381743ca998d651735b6569de2f6f01fc36be42 (diff) | |
parent | aa1752a3a00c25649b290102fad745af1d3b4887 (diff) |
Merge branch 'master' of ../openscad into steelman-bom-tree-std-stack
Diffstat (limited to 'src/parsersettings.cc')
-rw-r--r-- | src/parsersettings.cc | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/parsersettings.cc b/src/parsersettings.cc index 63a7713..de1ff98 100644 --- a/src/parsersettings.cc +++ b/src/parsersettings.cc @@ -88,7 +88,7 @@ fs::path find_valid_path(const fs::path &sourcepath, return fs::path(); } -void parser_init(const std::string &applicationpath) +void parser_init(const std::string &applicationpath, bool isgui) { // Add paths from OPENSCADPATH before adding built-in paths const char *openscadpaths = getenv("OPENSCADPATH"); @@ -116,8 +116,11 @@ void parser_init(const std::string &applicationpath) fs::path libdir(applicationpath); fs::path tmpdir; #ifdef __APPLE__ - libdir /= "../Resources"; // Libraries can be bundled - if (!is_directory(libdir / "libraries")) libdir /= "../../.."; + // Libraries can be bundled on Mac. If not, fall back to development layout + if (isgui) { + libdir /= "../Resources"; + if (!is_directory(libdir / "libraries")) libdir /= "../../.."; + } #elif !defined(WIN32) if (is_directory(tmpdir = libdir / "../share/openscad/libraries")) { librarydir = boosty::stringy(tmpdir); |