Part Design libs install location

About the development of the Part Design module/workbench. PLEASE DO NOT POST HELP REQUESTS HERE!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
peterl94
Veteran
Posts: 1001
Joined: Thu May 23, 2013 7:31 pm
Location: United States

Part Design libs install location

Post by peterl94 »

Hey there,

I have a quick question: how come the Part Design libraries are installed into Mod/PartDesign? I see in the CMake file there is a comment saying that they must go where the __init__.py file is, but why only Part Design?
User avatar
jriegel
Founder
Posts: 3369
Joined: Sun Feb 15, 2009 5:29 pm
Location: Ulm, Germany
Contact:

Re: Part Design libs install location

Post by jriegel »

No, we don't use the __init__.py mechanism so far. The module directories are added directly to the python path.

There are different cMake mechanisms to move the files in the build. E.g. on Windows we don't use the INSTALL target, the files get moved/created by the compiler and some cMake scripts which moving additional files and libs...
Stop whining - start coding!
wmayer
Founder
Posts: 20310
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Part Design libs install location

Post by wmayer »

No, we don't use the __init__.py mechanism so far. The module directories are added directly to the python path.
Yes, we do! PartDesign has some sub-directories and in order to load the Python modules there we e.g. have to do:

Code: Select all

from PartDesign.WizardShaft import Shaft
Therefore we need an __init__.py in the PartDesign directory. However, most of the time Part design is loaded by:

Code: Select all

import PartDesign
And this call basically only loads the __init__.py file and in order to load the actual PartDesign stuff the __init__.py file contains this statement:

Code: Select all

import PartDesign
which then loads the actual shared library (under MacOSX it's the .dylib extension I guess) and therefore it must be at a place where it can be found.
peterl94
Veteran
Posts: 1001
Joined: Thu May 23, 2013 7:31 pm
Location: United States

Re: Part Design libs install location

Post by peterl94 »

Ah, that makes sense. I wondered what made it special.
Post Reply