Skip to content

Commit aa0e771

Browse files
committed
Added 'install_headers' command to install C/C++ header files.
1 parent 847a996 commit aa0e771

2 files changed

Lines changed: 41 additions & 0 deletions

File tree

Lib/distutils/command/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
'build_scripts',
1313
'install',
1414
'install_lib',
15+
'install_headers',
1516
'install_scripts',
1617
'install_data',
1718
'clean',
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
"""distutils.command.install_headers
2+
3+
Implements the Distutils 'install_headers' command, to install C/C++ header
4+
files to the Python include directory."""
5+
6+
# created 2000/05/26, Greg Ward
7+
8+
__revision__ = "$Id$"
9+
10+
from distutils.core import Command
11+
12+
13+
class install_headers (Command):
14+
15+
description = "install C/C++ header files"
16+
17+
user_options = [('install-dir=', 'd',
18+
"directory to install header files to"),
19+
]
20+
21+
22+
def initialize_options (self):
23+
self.install_dir = None
24+
25+
def finalize_options (self):
26+
self.set_undefined_options('install',
27+
('install_headers', 'install_dir'))
28+
29+
def run (self):
30+
headers = self.distribution.headers
31+
if not headers:
32+
return
33+
34+
self.mkpath(self.install_dir)
35+
for header in headers:
36+
self.copy_file(header, self.install_dir)
37+
38+
# run()
39+
40+
# class install_headers

0 commit comments

Comments
 (0)