forked from zacharyburnett/pyTerrainTree
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
62 lines (53 loc) · 1.54 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
58
59
60
61
62
import os
from pathlib import Path
from Cython.Build import cythonize
from setuptools import Extension, setup
DIRECTORY = Path(__file__).parent
cpp_sources_directory = DIRECTORY / 'modules' / 'Terrain_Trees' / 'sources'
cpp_core_library_directory = cpp_sources_directory / 'core_library' / 'sources'
cython_sources_directory = DIRECTORY / 'pyterraintree' / 'cython'
source_filenames = [
*cython_sources_directory.glob('**/*.pyx'),
*cpp_core_library_directory.glob('**/*.cpp'),
*cpp_sources_directory.glob('utilities/**/*.cpp'),
]
include_directories = [
cpp_core_library_directory,
*(
directory
for directory in cpp_core_library_directory.iterdir()
if directory.name
in (
'terrain_trees',
'utilities',
'basic_types',
'curvature',
'geometry',
'io',
'queries',
'roughness',
'statistics',
'terrain_features',
)
),
'/usr/include/eigen3',
]
source_filenames = [str(filename) for filename in source_filenames]
include_directories = [str(filename) for filename in include_directories]
extensions = cythonize(
[
Extension(
'Terrain_Trees',
sources=source_filenames,
libraries=source_filenames,
language='c++',
include_dirs=include_directories,
)
]
)
os.environ['CFLAGS'] = '-O3'
setup(
ext_modules=cythonize(
extensions, language_level=3, compiler_directives={'linetrace': True},
),
)