Commit 6bf029c2 authored by Yung-Lin Huang (Cary)'s avatar Yung-Lin Huang (Cary)

CMake only finds required VTK components

parent f5eb9c08
......@@ -34,13 +34,26 @@ else (PTHREAD_LIB)
endif (PTHREAD_LIB)
#VTK
find_package(VTK)
if (VTK_FOUND)
include_directories(${VTK_INCLUDE_DIRS})
link_libraries(${VTK_LIBRARIES})
else ((VTK_FOUND))
message(FATAL_ERROR "Couldn't find VTK library")
endif (VTK_FOUND)
option(USE_VTK "Build with VTK" TRUE)
if (USE_VTK)
set(MESHALYZER_VTK_COMPONENTS
vtkCommonCore
vtkIOCore
vtkIOLegacy
vtkIOXML
)
find_package(VTK REQUIRED COMPONENTS ${MESHALYZER_VTK_COMPONENTS})
if (VTK_FOUND)
message(STATUS "Found VTK components: ${VTK_LIBRARIES}")
include_directories(${VTK_INCLUDE_DIRS})
link_libraries(${VTK_LIBRARIES})
add_definitions(-DUSE_VTK)
else (VTK_FOUND)
message(FATAL_ERROR "Couldn't find VTK library")
endif (VTK_FOUND)
endif (USE_VTK)
#Check for GLUT
find_package(OpenGL REQUIRED)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment