forked from radarsimx/radarsimpy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
84 lines (71 loc) · 3.05 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
"""
Setup script for a Python package "radarsimpy"
---
- Copyright (C) 2018 - PRESENT radarsimx.com
- E-mail: info@radarsimx.com
- Website: https://radarsimx.com
::
██████╗ █████╗ ██████╗ █████╗ ██████╗ ███████╗██╗███╗ ███╗██╗ ██╗
██╔══██╗██╔══██╗██╔══██╗██╔══██╗██╔══██╗██╔════╝██║████╗ ████║╚██╗██╔╝
██████╔╝███████║██║ ██║███████║██████╔╝███████╗██║██╔████╔██║ ╚███╔╝
██╔══██╗██╔══██║██║ ██║██╔══██║██╔══██╗╚════██║██║██║╚██╔╝██║ ██╔██╗
██║ ██║██║ ██║██████╔╝██║ ██║██║ ██║███████║██║██║ ╚═╝ ██║██╔╝ ██╗
╚═╝ ╚═╝╚═╝ ╚═╝╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝╚═╝ ╚═╝╚═╝ ╚═╝
"""
import platform
from setuptools import setup
from setuptools import Extension
from Cython.Distutils import build_ext
from Cython.Build import cythonize
import numpy
os_type = platform.system() # 'Linux', 'Windows', 'macOS'
if os_type == "Linux":
LINK_ARGS = ["-Wl,-rpath,$ORIGIN"]
LIBRARY_DIRS = ["src/radarsimcpp/build"]
elif os_type == "Darwin":
LINK_ARGS = ["-Wl,-rpath,$ORIGIN"]
LIBRARY_DIRS = ["src/radarsimcpp/build"]
elif os_type == "Windows":
LINK_ARGS = []
LIBRARY_DIRS = ["src/radarsimcpp/build/Release"]
MACROS = [("NPY_NO_DEPRECATED_API", "NPY_1_7_API_VERSION")]
INCLUDE_DIRS = ["src/radarsimcpp/includes", "src/radarsimcpp/includes/zpvector"]
ext_modules = [
Extension(
"radarsimpy.lib.cp_radarsimc",
["src/radarsimpy/lib/cp_radarsimc.pyx"],
define_macros=MACROS,
include_dirs=INCLUDE_DIRS,
libraries=["radarsimcpp"],
library_dirs=LIBRARY_DIRS,
extra_link_args=LINK_ARGS,
),
Extension(
"radarsimpy.rt",
["src/radarsimpy/raytracing/rt.pyx"],
define_macros=MACROS,
include_dirs=INCLUDE_DIRS,
libraries=["radarsimcpp"],
library_dirs=LIBRARY_DIRS,
extra_link_args=LINK_ARGS,
),
Extension(
"radarsimpy.simulator",
["src/radarsimpy/simulator.pyx"],
define_macros=MACROS,
include_dirs=INCLUDE_DIRS,
libraries=["radarsimcpp"],
library_dirs=LIBRARY_DIRS,
extra_link_args=LINK_ARGS,
),
]
setup(
name="radarsimpy",
cmdclass={"build_ext": build_ext},
ext_modules=cythonize(
ext_modules,
annotate=False,
compiler_directives={"language_level": "3"},
),
include_dirs=[numpy.get_include()],
)