Skip to content

Commit b1fa503

Browse files
jamesobutlerjcfr
andcommitted
BUG: Fix wrapping error when using VTK 9.5
See https://gitlab.kitware.com/vtk/vtk/-/commit/d2176e740532253b00e2ef88c07c11eaea282d12 Co-authored-by: Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com>
1 parent 873e91f commit b1fa503

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

CMake/vtkWrapPython.cmake

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -159,21 +159,26 @@ $<$<BOOL:$<TARGET_PROPERTY:${TARGET},INCLUDE_DIRECTORIES>>:
159159
@ONLY
160160
)
161161

162+
set(_init_impl_src "")
163+
if(${VTK_VERSION} VERSION_LESS "9.5.0")
164+
set(_init_impl_src "${CMAKE_CURRENT_BINARY_DIR}/${TARGET}InitImpl.cxx")
165+
endif()
162166
add_custom_command(
163167
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${TARGET}Init.cxx
164-
${CMAKE_CURRENT_BINARY_DIR}/${TARGET}InitImpl.cxx
168+
${_init_impl_src}
165169
DEPENDS ${VTK_WRAP_PYTHON_INIT_EXE}
166170
${CMAKE_CURRENT_BINARY_DIR}/${TARGET}Init.data
167171
COMMAND ${VTK_WRAP_PYTHON_INIT_EXE}
168172
${CMAKE_CURRENT_BINARY_DIR}/${TARGET}Init.data
169173
${CMAKE_CURRENT_BINARY_DIR}/${TARGET}Init.cxx
170-
${CMAKE_CURRENT_BINARY_DIR}/${TARGET}InitImpl.cxx
174+
${_init_impl_src}
171175
COMMENT "Generating the Python module initialization sources for ${TARGET}"
172176
VERBATIM
173177
)
174-
175-
# Create the Init File
176-
set(${SRC_LIST_NAME} ${${SRC_LIST_NAME}} ${TARGET}InitImpl.cxx)
178+
if(${VTK_VERSION} VERSION_LESS "9.5.0")
179+
# Create the Init File
180+
set(${SRC_LIST_NAME} ${${SRC_LIST_NAME}} ${TARGET}InitImpl.cxx)
181+
endif()
177182

178183
endmacro()
179184

0 commit comments

Comments
 (0)