简体   繁体   中英

VTK + Cmake -> USE_VTK_RENDERING error

I am a begineer in VTK library and I have a problem with run this project:

http://web.mit.edu/16.225/dv/VTK/Examples/ImageProcessing/Cxx/

In CMakeLists there is 'if' condition:

IF(NOT VTK_USE_RENDERING) MESSAGE(FATAL_ERROR "Example ${PROJECT_NAME} requires VTK_USE_RENDERING.") ENDIF(NOT VTK_USE_RENDERING)

but during the configuration in CMake error apears:

CMake Error at CMakeLists.txt:6 (MESSAGE): Example ImageProcessing requires VTK_USE_RENDERING.

Proble is that there is no VTK_USE_RENDERING entry in CMake. So how I can solve this problem? Should I use QT?

I would be grateful for any response!

Thank you in advance!

Problem solved.

VTK greater or equal than 6.0 version should use this CMakeFile.txt :

cmake_minimum_required(VERSION 2.8.5 FATAL_ERROR) 
project(ImageProcessing) 

find_package(VTK REQUIRED NO_MODULE) 
include(${VTK_USE_FILE}) 

add_executable(ImageSlicing ImageSlicing.cxx) 
target_link_libraries(ImageSlicing ${VTK_LIBRARIES})

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM