diff --git a/library/bindings/CMakeLists.txt b/library/bindings/CMakeLists.txt index 10bcd6f7..e976c015 100644 --- a/library/bindings/CMakeLists.txt +++ b/library/bindings/CMakeLists.txt @@ -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() diff --git a/library/bindings/Vector.i b/library/bindings/Vector.i index b84b9003..6bc99d1f 100644 --- a/library/bindings/Vector.i +++ b/library/bindings/Vector.i @@ -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) { diff --git a/tests/TestSurfaceExtractor.py b/tests/TestSurfaceExtractor.py index be66e3d2..7e966584 100644 --- a/tests/TestSurfaceExtractor.py +++ b/tests/TestSurfaceExtractor.py @@ -22,4 +22,4 @@ class TestSurfaceExtractor(unittest.TestCase): self.assertEqual(self.mesh.getNoOfVertices(), 6) if __name__ == '__main__': - unittest.main() \ No newline at end of file + unittest.main()