forked from joaofaro/KCFcpp
-
Notifications
You must be signed in to change notification settings - Fork 34
Expand file tree
/
Copy pathsetup.py
More file actions
41 lines (36 loc) · 1.17 KB
/
setup.py
File metadata and controls
41 lines (36 loc) · 1.17 KB
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
import sys
from distutils.core import setup, Extension
from Cython.Distutils import build_ext
import numpy
import pkgconfig
if pkgconfig.exists('opencv4'):
opencv_pkginfo = pkgconfig.parse('opencv4')
extra_compile_args = ['-std=c++11', '-DUSE_OPENCV4']
elif pkgconfig.exists('opencv'):
opencv_pkginfo = pkgconfig.parse('opencv')
extra_compile_args = ['-std=c++11']
else:
print("opencv package config is not found.", file=sys.stderr)
exit(1)
libdr = ['/usr/local/lib'] + opencv_pkginfo["library_dirs"]
incdr = [numpy.get_include(), '/usr/local/include/'] + opencv_pkginfo["include_dirs"]
ext = [
Extension('cvt', ['python/cvt.pyx'],
language = 'c++',
extra_compile_args = extra_compile_args,
include_dirs = incdr,
library_dirs = libdr,
libraries = ['opencv_core']),
Extension('KCF', ['python/KCF.pyx', 'src/kcftracker.cpp', 'src/fhog.cpp'],
language = 'c++',
extra_compile_args = extra_compile_args,
include_dirs = incdr,
library_dirs = libdr,
libraries = ['opencv_core', 'opencv_imgproc'])
]
setup(
name = 'app',
cmdclass = {'build_ext':build_ext},
ext_modules = ext
)
#python setup.py build_ext --inplace