VTK 9.0 dll missing with same setup of vtk vtk 8.x

Hello,

I have a doubt. With vtk 8.0, I haven’t had to add the dll in the bin directory with shared lib option ticked. With the cmake visual was able to find the dll but I found that in vtk 9.0 I am forced to put all dllls in the bin. Is there any way to set it up as before that it was directly found with visual c++ 2015? I didn’t set up the system variables in the previous versions. What change is making this behaviour. If I put all dll it works but I would like to set it as before without the dll as it is cleaner.

Thanks

All .dll files should be in the bin/ directory. Could you be more explicit which files you see in the expected place in 8.x? Where are the analogous files for you in 9.0?

Hello, thank you for answering I did not have to copy the dlls in the previous version I only defined this cmake and visual was able to find the dlls directly. I did not set up the environment variables eaither. I also do not define itk or qt dlls it is able to detect them. But I do not know how to do it in vtk 9.0. It 's cleaner not to copy all dlls in the release and debug folders of the the bin. Maybe because this include(${VTK_USE_FILE}) is not used in vtk 9.0? Thanks !!

find_package(Qt5 COMPONENTS REQUIRED
Concurrent Widgets)

# VTK
 find_package(VTK COMPONENTS REQUIRED
vtkCommonCore
vtkCommonDataModel
vtkFiltersFlowPaths
vtkGUISupportQt
vtkInteractionImage
vtkImagingStencil
vtkImagingMorphological
vtkIOGeometry
vtkIOImage
vtkIOImport
vtkIOLegacy
vtkIOXML
vtkRenderingCore   
   #${VTK_RENDERING_BACKEND}
vtkRenderingVolumeOpenGL2
vtkInteractionWidgets
   NO_MODULE)

  include(${VTK_USE_FILE})

 find_package(ITK REQUIRED)
 include(${ITK_USE_FILE})

add_library(VtkMgr STATIC
  include/VtkMgr/vtk_mgr.h src/vtk_mgr.cpp
)

target_include_directories(VtkMgr
  PUBLIC
      $<INSTALL_INTERFACE:include>
        
  $<BUILD_INTERFACE:$
 {CMAKE_CURRENT_SOURCE_DIR}/include>
  PRIVATE
    ${CMAKE_CURRENT_SOURCE_DIR}/src)

   target_link_libraries(VtkMgr
   PUBLIC
Qt5::Concurrent
    Qt5::Widgets
    ${ITK_LIBRARIES}
    ${VTK_LIBRARIES}
)

   target_compile_features(VtkMgr PUBLIC cxx_std_14)

 if(BUILD_TESTING)
 add_subdirectory(test)
 endif(BUILD_TESTING)

I still don’t have enough information to figure out what’s wrong here. I don’t know what made it work in 8.2 or for Qt and ITK as there’s nothing special that was done before as far as I’m aware. I expect you have some PATH setting that made it work? What are you trying to run? A project built against VTK? VTK’s tests?

This has nothing to do with it. Everything that file did is now managed in vtk_module_autoinit.

Yes you are right. I also have this in the cmake. But in this version it does not have any effect. Thanks

if (WIN32)
   set_target_properties(${PROJECT_NAME} PROPERTIES
     VS_DEBUGGER_ENVIRONMENT    
  "PATH=${VTK_RUNTIME_DIRS}/$<CONFIG>;${QtBinDir}"

set(LIB_FOLDERS "${VTK_
RUNTIME_DIRS}/Release" "${Qt5_DIR}")

I replaced VTK_
RUNTIME_DIRS by VTK_PREFIX_PATH. But no luck

Ah, yeah, that variable isn’t provided anymore because there’s no single path for it. ${VTK_PREFIX_PATH}/bin should work though.

Hello, yes it is working now I must add the bin too !! Thank you !!