From 60e41827dad09fd3bf76d9638f993e7b6f7243ac Mon Sep 17 00:00:00 2001 From: "Gabriel A. Devenyi" Date: Mon, 29 Aug 2016 11:07:10 -0400 Subject: [PATCH] Fix VTK Superbuild --- ANTS.cmake | 17 +++++++++++++++++ Examples/CMakeLists.txt | 20 +------------------- SuperBuild/External_VTK.cmake | 3 ++- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/ANTS.cmake b/ANTS.cmake index e921d4c57..ac6341697 100644 --- a/ANTS.cmake +++ b/ANTS.cmake @@ -54,8 +54,25 @@ option(BUILD_ALL_ANTS_APPS "Use All ANTs Apps" ON) option(USE_VTK "Use VTK Libraries" OFF) if(USE_VTK) find_package(VTK) + find_package(VTK COMPONENTS + vtkCommonCore + vtkCommonDataModel + vtkIOGeometry + vtkIOXML + vtkIOLegacy + vtkIOPLY + vtkFiltersModeling + vtkImagingStencil + vtkImagingGeneral + vtkRenderingAnnotation + vtkRenderingVolumeOpenGL + # vtkRenderingVolumeOpenGL2 # VTK7 + ) + if(VTK_FOUND) include(${VTK_USE_FILE}) + include_directories(${VTK_INCLUDE_DIRS}) + set(INIT_VTK_LIBRARIES ${VTK_LIBRARIES}) else(VTK_FOUND) message("Cannot build some programs without VTK. Please set VTK_DIR if you need these programs.") endif(VTK_FOUND) diff --git a/Examples/CMakeLists.txt b/Examples/CMakeLists.txt index 51b1d5d30..9e6d95d72 100644 --- a/Examples/CMakeLists.txt +++ b/Examples/CMakeLists.txt @@ -168,26 +168,8 @@ endif(BUILD_ALL_ANTS_APPS) if(USE_VTK) -find_package(VTK REQUIRED NO_MODULE) -find_package(VTK COMPONENTS - vtkCommonCore - vtkCommonDataModel - vtkIOGeometry - vtkIOXML - vtkIOLegacy - vtkIOPLY - vtkFiltersModeling - vtkImagingStencil - vtkImagingGeneral - vtkRenderingAnnotation - vtkRenderingVolumeOpenGL -# vtkRenderingVolumeOpenGL2 # VTK7 - ) -include(${VTK_USE_FILE}) -include_directories(${VTK_INCLUDE_DIRS}) - set(VTK_ANTS_APPS -# ConvertVectorFieldToVTK + # ConvertVectorFieldToVTK antsSurf antsVol GetMeshAndTopology diff --git a/SuperBuild/External_VTK.cmake b/SuperBuild/External_VTK.cmake index b866799cc..21bf05ab8 100644 --- a/SuperBuild/External_VTK.cmake +++ b/SuperBuild/External_VTK.cmake @@ -195,7 +195,8 @@ if(NOT ( DEFINED "USE_SYSTEM_${extProjName}" AND "${USE_SYSTEM_${extProjName}}" # -P ${VTKPatchScript} # ) - set(${extProjName}_DIR ${CMAKE_BINARY_DIR}/${proj}-install/lib/vtk-6.2) +set(${extProjName}_DIR ${CMAKE_BINARY_DIR}/${proj}-install) + else() if(${USE_SYSTEM_${extProjName}}) find_package(${extProjName} ${${extProjName}_REQUIRED_VERSION} REQUIRED)