Improving build env for python

parent 228d348b
......@@ -3,13 +3,24 @@ project( VAPython )
list( APPEND CMAKE_MODULE_PATH "$ENV{VISTA_CMAKE_COMMON}" )
if( NOT DEFINED ITA_VAPYTHON_VERSION_MAJOR )
set( ITA_VAPYTHON_VERSION_MAJOR "v2017" CACHE STRING "VAPython version major (usually 'v' and year)" )
endif( NOT DEFINED ITA_VAPYTHON_VERSION_MAJOR )
if( NOT DEFINED ITA_VAPYTHON_VERSION_MINOR )
set( ITA_VAPYTHON_VERSION_MINOR "d" CACHE STRING "VAPython version minor (usually a,b,c ...)" )
endif( NOT DEFINED ITA_VAPYTHON_VERSION_MINOR )
include( VistaCommon )
vista_use_package( VANet REQUIRED FIND_DEPENDENCIES )
vista_use_package( PythonLibs REQUIRED )
if( ITA_VISTA_BUILD_STATIC )
add_definitions( -DVISTABASE_STATIC -DVISTAMATH_STATIC -DVISTAASPECTS_STATIC -DVISTATOOLS_STATIC -DVISTAINTERPROCCOMM_STATIC )
add_definitions( -DVISTA_STATIC )
if( WIN32 )
list( APPEND VISTA_USE_PACKAGE_LIBRARIES ws2_32 winspool )
endif( )
endif( )
if( NOT BUILD_SHARED_LIBS )
......@@ -27,14 +38,12 @@ target_link_libraries( VAPython ${VISTA_USE_PACKAGE_LIBRARIES} )
# Run distutils after (useless) build in your dev env to compile the Python extension into 'dist' folder
configure_file( "setup.py.proto" "${CMAKE_CURRENT_SOURCE_DIR}/setup.py" @ONLY )
set( BATCH_SCRIPT_EXTENSION "bat" )
if( NOT WIN32 )
set( BATCH_SCRIPT_EXTENSION "sh" )
endif( )
set( BATCH_SCRIPT_TYPE distutils_build_static )
if( BUILD_SHARED_LIBS )
set( BATCH_SCRIPT_TYPE distutils_build_shared )
endif( )
set( BATCH_SCRIPT_TYPE distutils_build_va_python )
add_custom_command( TARGET VAPython POST_BUILD COMMAND "${BATCH_SCRIPT_TYPE}.${BATCH_SCRIPT_EXTENSION}" WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" COMMENT "Running distutils" VERBATIM )
# configure
......
python.exe setup.py clean
python.exe setup.py build --force
python.exe setup.py install --prefix dist
python.exe setup.py sdist --formats=zip
rem later:
rem python.exe setup.py bdist_wininst
python.exe setup.py check
from distutils.core import setup, Extension
module1 = Extension('va',
define_macros = [('VA_PYTHON_VERSION_MAJOR', '2017'), ('VA_PYTHON_VERSION_MINOR', 'c')],
include_dirs = ['../VABase/include','../VANet/include'],
libraries = ['VABase', 'VANet', 'VistaBase', 'VistaAspects', 'VistaInterProcComm'],
library_dirs = ['../build_win32-x64.vc14/lib','../../ViSTA/build_win32-x64.vc14/lib'],
sources = ['src/vasingleton.cpp'] )
setup (name = 'va',
version = '2017.c',
description = 'Virtual Acoustics singleton interface',
author = 'Institute of Technical Acoustics (ITA), RWTH Aachen University',
author_email = 'post@akustik.rwth-aachen.de',
url = 'https://virtualacoustics.org',
long_description = '''
Virtual Acoustics is a real-time auralization framework for Virtual Reality. This module is an interface to interact with a VA server.
''',
license = "Apache License Version 2.0",
ext_modules = [module1])
\ No newline at end of file
from distutils.core import setup, Extension
module1 = Extension('va',
define_macros = [ ( 'VA_PYTHON_VERSION_MAJOR', '@ITA_VAPYTHON_VERSION_MAJOR@' ),
( 'VA_PYTHON_VERSION_MINOR', '@ITA_VAPYTHON_VERSION_MINOR@' ),
( 'VABASE_STATIC', 1 ),
( 'VANET_STATIC', 1 ),
( 'VISTABASE_STATIC', 1 ),
( 'VISTAINTERPROCCOMM_STATIC', 1 ),
( 'VISTAASPECTS_STATIC',1 ) ],
include_dirs = [ '../VABase/include', '../VANet/include' ],
libraries = [ 'VABase', 'VANet', 'VistaBase', 'VistaAspects', 'VistaInterProcComm', 'winmm', 'ws2_32' ],
library_dirs = [ '../build_win32-x64.vc14/lib','../../ViSTA/build_win32-x64.vc14/lib' ],
sources = [ 'src/vasingleton.cpp' ] )
setup ( name = 'va',
version = '@ITA_VAPYTHON_VERSION_MAJOR@@ITA_VAPYTHON_VERSION_MINOR@',
description = 'Virtual Acoustics (VA) singleton interface',
author = 'Institute of Technical Acoustics (ITA), RWTH Aachen University',
author_email = 'post@akustik.rwth-aachen.de',
url = 'https://www.virtualacoustics.org',
long_description = '''
Virtual Acoustics (VA) is a real-time auralization framework for Virtual Reality. This module is an interface to interact with a VA server.
''',
license = "Copyright 2017. Apache License Version 2.0",
ext_modules = [ module1 ]
)
from distutils.core import setup, Extension
module1 = Extension('va',
define_macros = [('VA_PYTHON_VERSION_MAJOR', '2017'), ('VA_PYTHON_VERSION_MINOR', 'c'), ('VABASE_STATIC', 1), ('VANET_STATIC', 1), ('VISTABASE_STATIC', 1), ('VISTAINTERPROCCOMM_STATIC', 1), ('VISTAASPECTS_STATIC',1)],
include_dirs = ['../VABase/include','../VANet/include'],
libraries = ['VABase', 'VANet', 'VistaBase', 'VistaAspects', 'VistaInterProcComm', 'winmm', 'ws2_32' ],
library_dirs = ['../build_win32-x64.vc14_static/lib','../../ViSTA/build_static_win32-x64.vc14/lib'],
sources = ['src/vasingleton.cpp'] )
setup (name = 'va',
version = '2017.c',
description = 'Virtual Acoustics singleton interface',
author = 'Institute of Technical Acoustics (ITA), RWTH Aachen University',
author_email = 'post@akustik.rwth-aachen.de',
url = 'https://virtualacoustics.org',
long_description = '''
Virtual Acoustics is a real-time auralization framework for Virtual Reality. This module is an interface to interact with a VA server.
''',
license = "Apache License Version 2.0",
ext_modules = [module1])
\ No newline at end of file
......@@ -92,7 +92,7 @@ static struct PyMethodDef va_methods[] =
{ "set_sound_receiver_parameters", ( PyCFunction ) set_sound_receiver_parameters, METH_FASTCALL, no_doc },
{ "get_sound_receiver_parameters", ( PyCFunction ) get_sound_receiver_parameters, METH_FASTCALL, no_doc },
{ "get_sound_receiver_directivity", ( PyCFunction ) get_sound_receiver_directivity, METH_FASTCALL, no_doc },
{ "get_sound_receiver_directivity", ( PyCFunction ) get_sound_receiver_directivity, METH_FASTCALL, no_doc },
{ "set_sound_receiver_directivity", ( PyCFunction ) set_sound_receiver_directivity, METH_FASTCALL, no_doc },
{ "get_sound_receiver_position", ( PyCFunction ) get_sound_receiver_position, METH_FASTCALL, no_doc },
{ "set_sound_receiver_position", ( PyCFunction ) set_sound_receiver_position, METH_FASTCALL, no_doc },
{ "get_sound_receiver_orientation_vu", ( PyCFunction ) get_sound_receiver_orientation_vu, METH_FASTCALL, no_doc },
......@@ -124,6 +124,11 @@ static struct PyMethodDef va_methods[] =
{ "set_reprodution_module_gain", ( PyCFunction ) set_reproduction_module_gain, METH_FASTCALL, no_doc },
{ "get_reprodution_module_gain", ( PyCFunction ) get_reproduction_module_gain, METH_FASTCALL, no_doc },
{ "lock_update", ( PyCFunction ) lock_update, METH_FASTCALL, no_doc },
{ "unlock_update", ( PyCFunction ) unlock_update, METH_FASTCALL, no_doc },
{ "get_update_locked", ( PyCFunction ) get_update_locked, METH_FASTCALL, no_doc },
{ "get_input_gain", ( PyCFunction ) get_input_gain, METH_FASTCALL, no_doc },
{ "set_input_gain", ( PyCFunction ) set_input_gain, METH_FASTCALL, no_doc },
{ "is_input_muted", ( PyCFunction ) is_input_muted, METH_FASTCALL, no_doc },
......
......@@ -1160,7 +1160,6 @@ static PyObject* set_sound_receiver_real_world_orientation_vu( PyObject*, PyObje
if( !_PyArg_ParseStack( ppArgs, nArgs, pKeywordNames, &_parser, &iID, &v3View.x, &v3View.y, &v3View.z, &v3Up.x, &v3Up.y, &v3Up.z ) )
return NULL;
double t;
VAVec3 v3Pos, v3View_dummy, v3Up_dummy;
g_pVANetClient->GetCoreInstance()->GetSoundReceiverRealWorldPositionOrientationVU( iID, v3Pos, v3View_dummy, v3Up_dummy );
g_pVANetClient->GetCoreInstance()->SetSoundReceiverRealWorldPositionOrientationVU( iID, v3Pos, v3View, v3Up );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment