1 """distutils.command.install_headers
3 Implements the Distutils 'install_headers' command, to install C/C++ header
4 files to the Python include directory."""
8 from distutils
.core
import Command
11 # XXX force is never used
12 class install_headers(Command
):
14 description
= "install C/C++ header files"
16 user_options
= [('install-dir=', 'd',
17 "directory to install header files to"),
19 "force installation (overwrite existing files)"),
22 boolean_options
= ['force']
24 def initialize_options(self
):
25 self
.install_dir
= None
29 def finalize_options(self
):
30 self
.set_undefined_options('install',
31 ('install_headers', 'install_dir'),
36 headers
= self
.distribution
.headers
40 self
.mkpath(self
.install_dir
)
41 for header
in headers
:
42 (out
, _
) = self
.copy_file(header
, self
.install_dir
)
43 self
.outfiles
.append(out
)
46 return self
.distribution
.headers
or []
48 def get_outputs(self
):
51 # class install_headers