Rename some SWIG stuff to prepare for C# bindings

This commit is contained in:
Matt Williams
2012-11-21 17:03:17 +00:00
parent bef6a7746e
commit 3577a56eb3
3 changed files with 7 additions and 4 deletions

View File

@ -43,10 +43,11 @@ if(ENABLE_BINDINGS)
set_source_files_properties(PolyVoxCore.i PROPERTIES CPLUSPLUS ON)
#set_source_files_properties(PolyVoxCore.i PROPERTIES SWIG_FLAGS "-builtin")
swig_add_module(PolyVoxCore python PolyVoxCore.i)
swig_link_libraries(PolyVoxCore ${PYTHON_LIBRARIES} PolyVoxCore)
swig_add_module(PolyVoxCorePython python PolyVoxCore.i)
swig_link_libraries(PolyVoxCorePython ${PYTHON_LIBRARIES} PolyVoxCore)
set_target_properties(${SWIG_MODULE_PolyVoxCorePython_REAL_NAME} PROPERTIES OUTPUT_NAME _PolyVoxCore)
#set_target_properties(${SWIG_MODULE_PolyVoxCore_REAL_NAME} PROPERTIES SUFFIX ".pyd")
SET_PROPERTY(TARGET ${SWIG_MODULE_PolyVoxCore_REAL_NAME} PROPERTY FOLDER "Bindings")
SET_PROPERTY(TARGET ${SWIG_MODULE_PolyVoxCorePython_REAL_NAME} PROPERTY FOLDER "Bindings")
else()
set(BUILD_BINDINGS OFF CACHE BOOL "Will the bindings be built" FORCE)
endif()

View File

@ -6,9 +6,11 @@
%include "Vector.h"
#ifdef SWIGPYTHON
PROPERTY(PolyVox::Vector, x, getX, setX)
PROPERTY(PolyVox::Vector, y, getY, setY)
PROPERTY(PolyVox::Vector, z, getZ, setZ)
#endif
%extend PolyVox::Vector {
PolyVox::Vector __add__(const PolyVox::Vector& rhs) {

View File

@ -22,4 +22,4 @@ class TestSurfaceExtractor(unittest.TestCase):
self.assertEqual(self.mesh.getNoOfVertices(), 6)
if __name__ == '__main__':
unittest.main()
unittest.main()