ITKVTKGlue编译报错:
CMake Error at
C:/…/ITK/debug/lib/cmake/ITK-4.13/Modules/ITKVtkGlue.cmake:37
(vtk_module_config): Unknown CMake command “vtk_module_config”.
原因:ITK和VTK版本不对应导致找不到vtk_module_config文件,编译失败。
解决:
添加代码到以下两个文件位置;
1. C:…\ITK\ITK-4.13.2\Modules\Bridge\VtkGlue\CakeLists.txt
2. C:…\ITK\debug\lib\cmake\ITK-4.13\Modules\ITKVTKGlue.cmake
需添加的代码:
# for vtk>8.9if(NOT COMMAND vtk_module_config)macro(vtk_module_config ns)foreach(arg ${ARGN})if(${arg} MATCHES "^[Vv][Tt][Kk]")string(REGEX REPLACE "^[Vv][Tt][Kk]" "" _arg ${arg})else()set(_arg ${arg})endif()set(${ns}_LIBRARIES ${${ns}_LIBRARIES} VTK::${_arg}) endforeach()endmacro()if(NOT VTK_RENDERING_BACKEND)set(VTK_RENDERING_BACKEND OpenGL2)endif()endif()# endif for vtk>8.9