-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup.py
32 lines (28 loc) · 1.02 KB
/
setup.py
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
# -*- coding: utf-8 -*-
from subprocess import Popen, PIPE
from distutils.core import setup, Extension
popen = Popen(["pkg-config", "--cflags", "opencv"], stdout=PIPE, stderr=PIPE)
stdoutdata, stderrdata = popen.communicate()
if popen.returncode != 0:
print(stderrdata)
sys.exit()
opencv_include = [i[2:] for i in stdoutdata.split()]
popen = Popen(["pkg-config", "--libs", "opencv"], stdout=PIPE, stderr=PIPE)
stdoutdata, stderrdata = popen.communicate()
if popen.returncode != 0:
print(stderrdata)
sys.exit()
opencv_library = stdoutdata.split()
tclip_module = Extension("tclip",
sources=['tclip.cpp'],
include_dirs=opencv_include,
library_dirs=[],
libraries=[],
extra_link_args=opencv_library)
setup(name='tclip',
description='tclip.',
keywords='opencv',
license='BSD License',
maintainer='xutao',
maintainer_email='[email protected]',
ext_modules=[tclip_module])