6 from setuptools
import setup
7 from setuptools
import Extension
9 from distutils.core
import setup
10 from distutils.extension
import Extension
12 from Cython.Build
import cythonize
20 from numpy
import get_include
as numpy_get_include
25 win32_build = os.name ==
'nt' 26 linux_build = sys.platform.startswith(
'linux')
28 sha512 = hashlib.sha512()
29 src_files = filter(len,
'@CYTHON_BINDINGS_SOURCES@;@CYTHON_BINDINGS_GENERATE_SOURCES@'.split(
';'))
31 if os.path.isabs(src):
34 return '{}/{}'.format(
'@CMAKE_CURRENT_SOURCE_DIR@', src)
35 src_files = map(absolute, src_files)
38 with
open(f,
'r') as fd: 42 sha512.update(data.encode(
'ascii'))
45 version_hash = sha512.hexdigest()[:7]
48 ret = os.path.basename(path)
49 dot_idx = ret.find(
'.')
54 class pkg_config(object):
56 compile_args =
"@CYTHON_BINDINGS_COMPILE_DEFINITIONS@" 57 self.compile_args = [
"-D" + x
for x
in compile_args.split(
';')
if len(x) ]
58 self.compile_args = list(
set(self.compile_args))
59 include_dirs =
"@CYTHON_BINDINGS_INCLUDE_DIRECTORIES@" 61 self.include_dirs = [ x
for x
in include_dirs.split(
';')
if len(x) ]
62 self.include_dirs.
append(
'@CMAKE_CURRENT_SOURCE_DIR@/include')
63 self.include_dirs = list(
set(self.include_dirs))
64 library_dirs =
"@CYTHON_BINDINGS_LINK_FLAGS@" 65 self.library_dirs = [ x
for x
in library_dirs.split(
';')
if len(x) ]
66 self.libraries = [ re.sub(
"^lib",
"",
get_lib_name(l))
for l
in "@CYTHON_BINDINGS_LIBRARIES@".split(
";")
if len(l) ]
67 self.libraries = list(
set(self.libraries))
68 self.library_dirs += [os.path.dirname(l)
for l
in "@CYTHON_BINDINGS_TARGET_FILES@".split(
';')
if len(l) ]
69 self.library_dirs = list(
set(self.library_dirs))
72 for l
in self.libraries:
73 self.link_args += [
'-Wl,--no-as-needed',
'-l{}'.format(l)]
76 self.extra_objects = [l
for l
in '@CYTHON_BINDINGS_STATIC_LIBRARIES@'.split(
';')
if len(l)]
78 self.extra_objects = []
91 cxx_standard =
max(map(cxx_standard,
"0;@CYTHON_BINDINGS_CXX_STANDARD@".split(
';')), key = cxx_standard_cmp)
94 config.compile_args.append(
'-std=c++{}'.format(cxx_standard))
97 if cxx_standard >= 17:
98 config.compile_args.append(
'-Wno-register')
100 if cxx_standard > 17:
101 config.compile_args.append(
'/std:c++latest')
102 elif cxx_standard == 17:
103 config.compile_args.append(
'/std:c++17')
106 config.compile_args.append(
"-DWIN32")
107 if "$<CONFIGURATION>".lower() ==
"debug":
108 config.compile_args += [
"-Zi",
"/Od"]
109 config.link_args += [
"-debug"]
112 pyx_src = name.replace(
'.',
'/')
113 pyx_src = pyx_src +
'.pyx' 115 return Extension(name, [ext_src], extra_compile_args = config.compile_args, include_dirs = config.include_dirs, library_dirs = config.library_dirs, libraries = config.libraries, extra_link_args = config.link_args, extra_objects = config.extra_objects)
117 extensions = [
GenExtension(x)
for x
in '@CYTHON_BINDINGS_MODULES@'.split(
';') ]
119 extensions = cythonize(extensions)
121 packages = [ p.split(
'.')[0]
for p
in '@CYTHON_BINDINGS_MODULES@'.split(
';') ]
122 package_data = { p : list(map(
lambda x: x.replace(p +
'/',
''), filter(
lambda x: x.startswith(p +
'/'),
'@CYTHON_BINDINGS_EXPORT_SOURCES@'.split(
';'))))
for p
in packages }
125 name =
'@CYTHON_BINDINGS_PACKAGE_NAME@',
126 version=
'@CYTHON_BINDINGS_VERSION@-{}'.format(version_hash),
127 ext_modules = extensions,
129 package_data = package_data
void set(bool ownStorage, Vec3f *points_, unsigned int num_points_)
result_of::push_front< V const, T >::type append(T const &t, V const &v)
Append the element T at the front of boost fusion vector V.
def cxx_standard_cmp(lhs)
AD< Scalar > max(const AD< Scalar > &x, const AD< Scalar > &y)