3 Implement the Distutils "install_ext" command to install extension modules."""
5 # created 1999/09/12, Greg Ward
9 from distutils
.core
import Command
10 from distutils
.util
import copy_tree
12 class InstallExt (Command
):
14 description
= "install C/C++ extension modules"
16 options
= [('install-dir=', 'd', "directory to install to"),
17 ('build-dir=','b', "build directory (where to install from)"),
20 def set_default_options (self
):
21 # let the 'install' command dictate our installation directory
22 self
.install_dir
= None
25 def set_final_options (self
):
26 self
.set_undefined_options ('install',
27 ('build_platlib', 'build_dir'),
28 ('install_site_platlib', 'install_dir'))
32 # Make sure we have built all extension modules first
33 self
.run_peer ('build_ext')
35 # Dump the entire "build/platlib" directory (or whatever it really
36 # is; "build/platlib" is the default) to the installation target
37 # (eg. "/usr/local/lib/python1.5/site-packages"). Note that
38 # putting files in the right package dir is already done when we
40 outfiles
= self
.copy_tree (self
.build_dir
, self
.install_dir
)