diff options
author | Marius Kintel <marius@kintel.net> | 2013-10-07 22:47:08 (GMT) |
---|---|---|
committer | Marius Kintel <marius@kintel.net> | 2013-10-07 22:47:08 (GMT) |
commit | aa1752a3a00c25649b290102fad745af1d3b4887 (patch) | |
tree | 2b6df9683d1797286aaf4dec969d427603a9eeab /src/parsersettings.cc | |
parent | 4c06a4e78f1bf9cc86bd67ae792e2a54febd3d91 (diff) |
Mac needs to know if we're a GUI app in order to find bundled libraries, Use Qt to find application path if available
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); |