Skip to content

Commit dda99f6

Browse files
committed
#24 update cmake for vtk9
1 parent 98e266d commit dda99f6

File tree

2 files changed

+23
-9
lines changed

2 files changed

+23
-9
lines changed

CMakeLists.txt

+22-8
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
find_package(Chaste COMPONENTS cell_based)
3434

3535
# PyChaste needs some additional VTK libraries
36-
if(VTK_MAJOR_VERSION LESS_EQUAL 6)
36+
if(VTK_MAJOR_VERSION LESS 7)
3737
find_package(VTK REQUIRED COMPONENTS
3838
vtkInteractionStyle
3939
vtkIOImage
@@ -44,24 +44,38 @@ if(VTK_MAJOR_VERSION LESS_EQUAL 6)
4444
vtkRenderingOpenGL
4545
vtkWrappingPythonCore
4646
)
47-
else()
47+
elseif(VTK_MAJOR_VERSION LESS 9)
4848
find_package(VTK REQUIRED COMPONENTS
49-
vtkFiltersProgrammable
50-
vtkFiltersVerdict
5149
vtkInteractionStyle
5250
vtkIOImage
5351
vtkIOMovie
5452
vtkRenderingAnnotation
5553
vtkRenderingCore
5654
vtkRenderingFreeType
57-
vtkRenderingOpenGL2
55+
vtkRenderingOpenGL
5856
vtkWrappingPythonCore
5957
)
58+
else()
59+
find_package(VTK REQUIRED COMPONENTS
60+
FiltersProgrammable
61+
FiltersVerdict
62+
InteractionStyle
63+
IOImage
64+
IOMovie
65+
RenderingAnnotation
66+
RenderingCore
67+
RenderingFreeType
68+
RenderingOpenGL2
69+
WrappingPythonCore
70+
)
6071
endif()
6172

62-
list(APPEND Chaste_INCLUDES ${VTK_INCLUDE_DIRS})
63-
list(APPEND Chaste_project_PyChaste_INCLUDE_DIRS ${VTK_INCLUDE_DIRS})
64-
list(APPEND Chaste_THIRD_PARTY_LIBRARIES ${VTK_LIBRARIES})
73+
if (VTK_MAJOR_VERSION LESS 9)
74+
list(APPEND Chaste_INCLUDES ${VTK_INCLUDE_DIRS})
75+
list(APPEND Chaste_project_PyChaste_INCLUDE_DIRS ${VTK_INCLUDE_DIRS})
76+
list(APPEND Chaste_THIRD_PARTY_LIBRARIES ${VTK_LIBRARIES})
77+
endif ()
78+
6579
chaste_do_project(PyChaste)
6680

6781
# Include the Python wrapping build logic

WrapPython.cmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ foreach(val RANGE ${len2})
124124
PREFIX "${PYTHON_MODULE_PREFIX}" SUFFIX ".so")
125125
target_compile_features(_chaste_project_PyChaste_${python_module} PRIVATE cxx_range_for)
126126
# order is important, pybind and python come first
127-
target_link_libraries(_chaste_project_PyChaste_${python_module} pybind11::module ${PYTHON3_LIBRARIES} ${Chaste_THIRD_PARTY_LIBRARIES} ${Chaste_LIBRARIES} ${PYCHASTE_SHARED_LIB})
127+
target_link_libraries(_chaste_project_PyChaste_${python_module} pybind11::module ${PYTHON3_LIBRARIES} ${Chaste_THIRD_PARTY_LIBRARIES} ${Chaste_LIBRARIES} ${PYCHASTE_SHARED_LIB} Chaste_COMMON_DEPS)
128128
add_dependencies(_chaste_project_PyChaste_${python_module} chaste_project_PyChaste)
129129
endforeach()
130130

0 commit comments

Comments
 (0)