From 326c02cd0f68aca62f4ab461004b69b0c7ff520d Mon Sep 17 00:00:00 2001 From: Jeremy Wright Date: Fri, 5 Dec 2014 23:42:25 -0500 Subject: [PATCH] Added explicit support for Mac OS. --- cadquery/freecad_impl/__init__.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/cadquery/freecad_impl/__init__.py b/cadquery/freecad_impl/__init__.py index 069fcd3..c0f8257 100644 --- a/cadquery/freecad_impl/__init__.py +++ b/cadquery/freecad_impl/__init__.py @@ -37,6 +37,7 @@ def _fc_path(): os.path.join(os.path.expanduser("~"), "lib/freecad/lib"), "/usr/local/lib/freecad/lib", "/usr/lib/freecad/lib", + "/opt/freecad/lib/", "/usr/bin/freecad/lib", ]: if os.path.exists(_PATH): @@ -84,6 +85,14 @@ def _fc_path(): ]: if os.path.exists(_PATH): return _PATH + else: + #Assume we're dealing with a Mac + for _PATH in [ + os.path.join(os.path.expanduser("~"), "Library/Application Support/FreeCAD/lib"), + "/Applications/FreeCAD.app/lib", + ]: + if os.path.exists(_PATH): + return _PATH #Make sure that the correct FreeCAD path shows up in Python's system path -sys.path.insert(0, _fc_path()) \ No newline at end of file +sys.path.insert(0, _fc_path())