1 """distutils.command.install_headers
3 Implements the Distutils 'install_headers' command, to install C/C++ header
4 files to the Python include directory."""
6 from ..core import Command
9 # XXX force is never used
10 class install_headers(Command):
12 description = "install C/C++ header files"
15 ('install-dir=', 'd', "directory to install header files to"),
16 ('force', 'f', "force installation (overwrite existing files)"),
19 boolean_options = ['force']
21 def initialize_options(self):
22 self.install_dir = None
26 def finalize_options(self):
27 self.set_undefined_options(
28 'install', ('install_headers', 'install_dir'), ('force', 'force')
32 headers = self.distribution.headers
36 self.mkpath(self.install_dir)
37 for header in headers:
38 (out, _) = self.copy_file(header, self.install_dir)
39 self.outfiles.append(out)
42 return self.distribution.headers or []
44 def get_outputs(self):