Welcome to mirror list, hosted at ThFree Co, Russian Federation.

setup.py.in « python « bindings « audaspace « extern - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 5ad1a37db3a7c1fa1791fab42e31e73bca7a4967 (plain)
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
# -*- coding: utf-8 -*-

import sys
import os
import codecs
import numpy

from distutils.core import setup, Extension

if len(sys.argv) > 2 and sys.argv[1] == '--build-docs':
	import subprocess
	from distutils.core import Distribution
	from distutils.command.build import build

	dist = Distribution()
	cmd = build(dist)
	cmd.finalize_options()
	#print(cmd.build_platlib)

	os.environ['PYTHONPATH'] = os.path.join(os.getcwd(), cmd.build_platlib)
	os.environ['LD_LIBRARY_PATH'] = os.getcwd()

	ret = subprocess.call(sys.argv[2:])
	sys.exit(ret)


# the following line is not working due to https://bugs.python.org/issue9023
#source_directory = os.path.relpath('@PYTHON_SOURCE_DIRECTORY@')
source_directory = '@PYTHON_SOURCE_DIRECTORY@'

extra_args = []

if sys.platform == 'win32':
    extra_args.append('/EHsc')
    extra_args.append('/DAUD_BUILD_SHARED_LIBRARY')
else:
    extra_args.append('-std=c++11')

audaspace = Extension(
                      'aud',
                      include_dirs = ['@CMAKE_CURRENT_BINARY_DIR@', '@FFTW_INCLUDE_DIR@', os.path.join(source_directory, '../../include'), numpy.get_include()],
                      libraries = ['audaspace'],
                      library_dirs = ['.', 'Release', 'Debug'],
                      language = 'c++',
                      extra_compile_args = extra_args,
					  sources = [os.path.join(source_directory, file) for file in ['PyAPI.cpp', 'PyDevice.cpp', 'PyHandle.cpp', 'PySound.cpp', 'PySequenceEntry.cpp', 'PySequence.cpp', 'PyPlaybackManager.cpp', 'PyDynamicMusic.cpp', 'PyThreadPool.cpp', 'PySource.cpp'] + (['PyImpulseResponse.cpp', 'PyHRTF.cpp'] if '@WITH_FFTW@' == 'ON' else [])]
)

setup(
      name = 'audaspace',
      version = '@AUDASPACE_LONG_VERSION@',
      description = 'Audaspace is a high level audio library.',
      author = 'Jörg Müller',
      author_email = 'nexyon@gmail.com',
      url = 'https://github.com/audaspace/audaspace',
      license = 'Apache License 2.0',
      long_description = codecs.open(os.path.join(source_directory, '../../README.md'), 'r', 'utf-8').read(),
      ext_modules = [audaspace],
	  headers = [os.path.join(source_directory, file) for file in ['PyAPI.h', 'PyDevice.h', 'PyHandle.h', 'PySound.h', 'PySequenceEntry.h', 'PySequence.h', 'PyPlaybackManager.h', 'PyDynamicMusic.h', 'PyThreadPool.h', 'PySource.h'] + (['PyImpulseResponse.h', 'PyHRTF.h'] if '@WITH_FFTW@' == 'ON' else [])] + ['Audaspace.h']
)