-
Notifications
You must be signed in to change notification settings - Fork 5
/
setup.py
57 lines (53 loc) · 2.03 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/usr/bin/env python
import os
from setuptools import setup, find_packages
from setuptools.extension import Extension
from Cython.Build import cythonize
import subprocess
import numpy as np
VERSION = '0.0.5'
README = open('README.md').read()
flags = subprocess.check_output(['pkg-config', '--cflags-only-I', 'opencv'])
include_dirs_list = [str(flag[2:].decode('utf-8')) for flag in flags.split()]
include_dirs_list.append('.')
include_dirs_list.append(np.get_include())
flags = subprocess.check_output(['pkg-config', '--libs-only-L', 'opencv'])
library_dirs_list = flags
flags = subprocess.check_output(['pkg-config', '--libs', 'opencv'])
libraries_list = []
for flag in flags.split():
libraries_list.append(str(flag.decode('utf-8')))
EXTENSIONS = [
Extension(
"rh_renderer.blender.images_composer",
[os.path.join("rh_renderer", "blender", "images_composer.pyx"),
os.path.join("rh_renderer", "blender", "ImagesComposer.cpp"),
os.path.join("rh_renderer", "blender", "detail", "seam_finders.cpp"),
os.path.join("rh_renderer", "blender", "detail", "exposure_compensate.cpp"),
os.path.join("rh_renderer", "blender", "detail", "blenders.cpp")],
language="c++",
include_dirs=include_dirs_list,
extra_compile_args=['-O3', '--verbose'],
extra_objects=libraries_list
)
]
setup(
name='rh_renderer',
version=VERSION,
packages=find_packages(),
ext_modules = cythonize(EXTENSIONS),
author='Adi Suissa-Peleg',
author_email='[email protected]',
url="https://github.com/Rhoana/rh_renderer",
description="Rhoana's rendering library",
long_description=README,
include_package_data=True,
install_requires=[
"numpy>=1.9.3",
"scipy>=0.16.0",
"Cython>=0.23.3",
"scikit-image>=0.13.1",
],
dependency_links = ['http://github.com/Rhoana/tinyr/tarball/master#egg=tinyr-0.1'],
zip_safe=False
)