File tree Expand file tree Collapse file tree 2 files changed +22
-12
lines changed Expand file tree Collapse file tree 2 files changed +22
-12
lines changed Original file line number Diff line number Diff line change @@ -20,21 +20,27 @@ INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
20
20
add_library (ca_smoothing SHARED ca_smoothing.cxx )
21
21
add_executable (ca_smoothing_app ca_smoothing_app.cxx )
22
22
23
- SET (Libraries vtkPythonCore )
24
-
23
+ IF (WIN32 )
24
+ SET (Libraries vtkPythonCore )
25
+ ELSEIF ()
26
+ SET (Libraries )
27
+ ENDIF (WIN32 )
28
+
29
+ SET_SOURCE_FILES_PROPERTIES (ca_smoothing.i PROPERTIES CPLUSPLUS ON )
30
+ #SET_SOURCE_FILES_PROPERTIES(ca_smoothing.i PROPERTIES SWIG_FLAGS "-includeall")
31
+ SWIG_ADD_MODULE (ca_smoothing python ca_smoothing.i ca_smoothing.cxx )
32
+
25
33
if (VTK_LIBRARIES )
26
34
target_link_libraries (ca_smoothing ${VTK_LIBRARIES} ${Libraries} )
27
35
target_link_libraries (ca_smoothing_app ca_smoothing ${VTK_LIBRARIES} ${Libraries} )
36
+ SWIG_LINK_LIBRARIES (ca_smoothing ${PYTHON_LIBRARIES} ${VTK_LIBRARIES} ${Libraries} )
28
37
else ()
29
- target_link_libraries (ca_smoothing vtkHybrid )
38
+ target_link_libraries (ca_smoothing vtkHybrid )
39
+ target_link_libraries (ca_smoothing_app ca_smoothing vtkHybrid ${Libraries} )
40
+ SWIG_LINK_LIBRARIES (ca_smoothing vtkHybrid vtkCommon vtkHybridPythonD vtkFiltering ${PYTHON_LIBRARIES} ${Libraries} )
41
+
30
42
endif ()
31
43
32
- SET_SOURCE_FILES_PROPERTIES (ca_smoothing.i PROPERTIES CPLUSPLUS ON )
33
- #SET_SOURCE_FILES_PROPERTIES(ca_smoothing.i PROPERTIES SWIG_FLAGS "-includeall")
34
-
35
- SWIG_ADD_MODULE (ca_smoothing python ca_smoothing.i ca_smoothing.cxx )
36
- SWIG_LINK_LIBRARIES (ca_smoothing ${PYTHON_LIBRARIES} ${VTK_LIBRARIES} ${Libraries} )
37
-
38
44
IF (CMAKE_COMPILER_IS_GNUCXX )
39
45
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall" )
40
46
Original file line number Diff line number Diff line change 24
24
%{
25
25
#include " vtkPythonUtil.h"
26
26
#include " vtkPolyData.h"
27
+ #if (VTK_MAJOR_VERSION > 5 ||((VTK_MAJOR_VERSION == 5)&&(VTK_MINOR_VERSION > 6)))
28
+ #define vtkPythonGetObjectFromPointer vtkPythonUtil::GetObjectFromPointer
29
+ #define vtkPythonGetPointerFromObject vtkPythonUtil::GetPointerFromObject
30
+ #endif
27
31
%}
28
32
29
33
%typemap(out) vtkPolyData* {
30
34
PyImport_ImportModule (" vtk" );
31
- $result = vtkPythonUtil::GetObjectFromPointer ( (vtkPolyData*)$1 );
35
+ $result = vtkPythonGetObjectFromPointer ( (vtkPolyData*)$1 );
32
36
}
33
37
34
38
%typemap(in) vtkPolyData* {
35
- /* $1 = NULL;*/
36
- $1 = (vtkPolyData*) vtkPythonUtil::GetPointerFromObject ( $input, " vtkPolyData" );
39
+ $1 = NULL ;
40
+ $1 = (vtkPolyData*) vtkPythonGetPointerFromObject ( $input, " vtkPolyData" );
37
41
if ( $1 == NULL ) { SWIG_fail; }
38
42
}
39
43
You can’t perform that action at this time.
0 commit comments