Skip to content

Commit

Permalink
Merge topic 'fix-linking-kits-mac'
Browse files Browse the repository at this point in the history
8a60be1 Fix linking libvtkWrapping with Python wrapping and kits enabled on Mac

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: David Gobbi <david.gobbi@gmail.com>
Reviewed-by: David Gobbi <david.gobbi@gmail.com>
Merge-request: !3014
  • Loading branch information
msmolens authored and kwrobot committed Jul 26, 2017
2 parents a035a34 + 8a60be1 commit 236a185
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions CMake/vtkModuleTop.cmake
Expand Up @@ -353,13 +353,19 @@ macro(_vtk_build_module _module)
add_subdirectory("${${_module}_SOURCE_DIR}" "${${_module}_BINARY_DIR}")
endmacro()

include(vtkTargetLinkLibrariesWithDynamicLookup)

# Build all modules.
foreach(kit IN LISTS vtk_modules_and_kits)
if(_${kit}_is_kit)
set(_vtk_build_as_kit ${kit})
set(kit_srcs)
set(_optional_python_link)
foreach(kit_module IN LISTS _${kit}_modules)
list(APPEND kit_srcs $<TARGET_OBJECTS:${kit_module}Objects>)
if(${kit_module}_OPTIONAL_PYTHON_LINK)
set(_optional_python_link 1)
endif()
endforeach()

configure_file("${_VTKModuleMacros_DIR}/vtkKit.cxx.in"
Expand Down Expand Up @@ -398,6 +404,10 @@ foreach(kit IN LISTS vtk_modules_and_kits)
target_link_libraries(${kit}
LINK_PRIVATE ${kit_priv}
LINK_PUBLIC ${kit_pub})
if(_optional_python_link)
vtk_module_load(vtkPython)
vtk_target_link_libraries_with_dynamic_lookup(${kit} LINK_PUBLIC ${vtkPython_LIBRARIES})
endif()
vtk_target(${kit})
else()
if(VTK_ENABLE_KITS)
Expand Down

0 comments on commit 236a185

Please sign in to comment.