我的问题类似于Emre 的问题。我正在尝试 从 wiki 构建 itkImageToVTKImageFilter 示例。我希望将它用于我计划应用于图像的高斯低通滤波器。在我下载 itkvtkglue 后,将其解压缩到一个文件夹,然后在 Cmake 中按配置,我收到以下错误消息:
Check for working C compiler using: Visual Studio 9 2008
Check for working C compiler using: Visual Studio 9 2008 -- works
Detecting C compiler ABI info
Detecting C compiler ABI info - done
Check for working CXX compiler using: Visual Studio 9 2008
Check for working CXX compiler using: Visual Studio 9 2008 -- works
Detecting CXX compiler ABI info
Detecting CXX compiler ABI info - done
CMake Error at F:/ITK/ItkVtkGlue/bin/UseItkVtkGlue.cmake:10 (include):
include could not find load file:
G:/VTK/UseVTK.cmake
Call Stack (most recent call first):
CMakeLists.txt:13 (include)
Configuring incomplete, errors occurred!
我不确定是什么导致了这个错误,但我怀疑它与我的 Windows 系统路径有关。但是,它似乎也指向正确的文件夹(PATH 转到 F: 驱动器)。该错误表明 Cmake 由于某种未知原因正在 G: 驱动器内查找。
这是 itkImageToVTKImageFilter 的 CMakeLists.txt:
cmake_minimum_required(VERSION 2.8)
project(DiscreteGaussianImageFilter)
find_package(ITK REQUIRED)
include(${ITK_USE_FILE})
if (ITKVtkGlue_LOADED)
find_package(VTK REQUIRED)
include(${VTK_USE_FILE})
else()
find_package(ItkVtkGlue REQUIRED)
include(${ItkVtkGlue_USE_FILE})
set(Glue ItkVtkGlue)
endif()
add_executable(DiscreteGaussianImageFilter MACOSX_BUNDLE DiscreteGaussianImageFilter.cxx)
target_link_libraries(DiscreteGaussianImageFilter
${Glue} ${VTK_LIBRARIES} ${ITK_LIBRARIES})
我读到这是一个非常常见的问题,但我不确定如何纠正它。任何帮助将不胜感激!我对 Stackoverflow 还是很陌生,所以如果我需要提供更多信息,请告诉我。