-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathsetup.py.cmake
53 lines (39 loc) · 1.23 KB
/
setup.py.cmake
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import os
import sys
import subprocess
from setuptools import setup
from distutils.command.build import build as _build
from setuptools.command.install import install as _install
proj_dir = os.path.abspath(os.path.dirname(__file__))
bindings_py_path = os.path.join(proj_dir, "bindings.py")
class build(_build):
def run(self):
_delegate()
class install(_install):
def run(self):
_delegate()
def _delegate():
_run("cmake -DPYTHON_EXECUTABLE:FILEPATH={} .".format(sys.executable))
_run("make bindings_distutils")
sys.stderr.write("delegating to bindings.py... \n")
sys.stderr.flush()
os.execvp(sys.executable, [sys.executable, bindings_py_path] + sys.argv[1:])
def _run(line):
p = subprocess.Popen(line.split(), cwd=proj_dir)
p.communicate()
if p.returncode != 0:
sys.exit("failed: {}".format(line))
setup(
name="exifyay",
version='${BINDINGS_VERSION}',
packages=['exifyay'],
package_dir={'exifyay': ''},
author='Simon Pantzare',
author_email='[email protected]',
description='Yay, Exif!',
license='LGPL',
keywords='exif',
url='http://github.com/Memoto/exifyay',
cmdclass={'build': build, 'install': install},
zip_safe=False,
)