Got the Vector class working in Python through SWIG.
This commit is contained in:
parent
78cda39c38
commit
26081fd4ba
@ -2,7 +2,7 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
|
||||
|
||||
PROJECT(PolyVox)
|
||||
|
||||
#add_subdirectory(bindings)
|
||||
add_subdirectory(bindings)
|
||||
add_subdirectory(PolyVoxCore)
|
||||
add_subdirectory(PolyVoxUtil)
|
||||
|
||||
|
@ -4,11 +4,12 @@ if(SWIG_FOUND)
|
||||
|
||||
find_package(PythonLibs)
|
||||
include_directories(${PYTHON_INCLUDE_PATH})
|
||||
include_directories(${PolyVoxCore_SOURCE_DIR}/include)
|
||||
|
||||
set(CMAKE_SWIG_FLAGS "")
|
||||
set_source_files_properties(PolyVoxCore.i PROPERTIES CPLUSPLUS ON)
|
||||
|
||||
swig_add_module(PolyVoxCore python PolyVoxCore.i)
|
||||
swig_link_libraries(PolyVoxCore ${PYTHON_LIBRARIES} PolyVoxCore)
|
||||
set_target_properties(${SWIG_MODULE_PolyVoxCore_REAL_NAME} PROPERTIES SUFFIX ".pyd")
|
||||
#set_target_properties(${SWIG_MODULE_PolyVoxCore_REAL_NAME} PROPERTIES SUFFIX ".pyd")
|
||||
endif()
|
@ -4,8 +4,8 @@
|
||||
//%include <windows.i>
|
||||
|
||||
//%include "TypeDef.i"
|
||||
%include "Enums.i"
|
||||
%include "PolyVoxCStdInt.i"
|
||||
%include "Utility.i"
|
||||
//%include "Enums.i"
|
||||
//%include "PolyVoxCStdInt.i"
|
||||
//%include "Utility.i"
|
||||
//%include "PolyVoxForwardDeclarations.i" //Shouldn't be needed
|
||||
%include "Vector.i"
|
||||
|
@ -1,10 +1,10 @@
|
||||
%module Vector
|
||||
%{
|
||||
#include "PolyVoxCore/Vector.h"
|
||||
//#include "PolyVoxCore/PolyVoxCStdInt.h"
|
||||
#include "Vector.h"
|
||||
//#include "PolyVoxCore/include/PolyVoxCStdInt.h"
|
||||
%}
|
||||
|
||||
%include "PolyVoxCore/Vector.h"
|
||||
%include "Vector.h"
|
||||
|
||||
%template(Vector3DFloat) PolyVox::Vector<3,float>;
|
||||
%template(Vector3DDouble) PolyVox::Vector<3,double>;
|
||||
|
Loading…
x
Reference in New Issue
Block a user