Commit 34e28445 authored by Utkarsh Ayachit's avatar Utkarsh Ayachit
Browse files

Fix build issues with static builds + Python + kits

When building statically with Python support and Kits enabled, the
vtkpython executable was trying to link against ${vtk-module}Python library
rather than linking the corresponding ${vtk-kit}Python library. This fixes
that issue. This also ensures that the header generated for initializing
Python modules uses correct kit-based names.

For this to work properly, we needed to save the KIT information to
module-config. Hence ${vtk-module}Module.cmake file now has a new variable
${vtk-module}_KIT which indicates the Kit that the module belongs to.
parent 7a8d5dab
......@@ -5,4 +5,5 @@ set(@vtk-module@_INCLUDE_DIRS "@vtk-module-INCLUDE_DIRS@")
set(@vtk-module@_LIBRARY_DIRS "@vtk-module-LIBRARY_DIRS@")
set(@vtk-module@_RUNTIME_LIBRARY_DIRS "@vtk-module-RUNTIME_LIBRARY_DIRS@")
set(@vtk-module@_WRAP_HIERARCHY_FILE "@vtk-module-WRAP_HIERARCHY_FILE@")
set(@vtk-module@_KIT "@vtk-module-KIT@")
@vtk-module-EXPORT_CODE@
......@@ -283,6 +283,7 @@ macro(vtk_module_export_info)
set(vtk-module-INCLUDE_DIRS "${vtk-module-INCLUDE_DIRS-build}")
set(vtk-module-EXPORT_CODE "${vtk-module-EXPORT_CODE-build}")
set(vtk-module-WRAP_HIERARCHY_FILE "${${vtk-module}_WRAP_HIERARCHY_FILE}")
set(vtk-module-KIT "${${vtk-module}_KIT}")
configure_file(${_VTKModuleMacros_DIR}/vtkModuleInfo.cmake.in
${VTK_MODULES_DIR}/${vtk-module}.cmake @ONLY)
set(vtk-module-INCLUDE_DIRS "${vtk-module-INCLUDE_DIRS-install}")
......
......@@ -196,6 +196,22 @@ endfunction()
# the header file should link against (using target_link_libraries()).
function(vtk_write_python_modules_header_for_wrapped_modules filename out_var)
get_property(python_wrapped_modules GLOBAL PROPERTY VTK_PYTHON_WRAPPED)
if(VTK_ENABLE_KITS)
# Process VTK_PYTHON_WRAPPED to generate a list of Python wrapped kits and
# modules.
set(_kits_and_modules)
foreach(module IN LISTS python_wrapped_modules)
vtk_module_load("${module}")
if(${module}_KIT)
set(kit ${${module}_KIT})
list(APPEND _kits_and_modules ${kit}Kit)
else()
list(APPEND _kits_and_modules ${module})
endif()
endforeach()
list(REMOVE_DUPLICATES _kits_and_modules)
set(python_wrapped_modules ${_kits_and_modules})
endif()
vtk_write_python_modules_header(
"${filename}" ${python_wrapped_modules})
set (dependencies)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment