VTK/Examples/Cxx/Utilities/GetDataRoot

From KitwarePublic

Jump to: navigation, search

GetDataRoot.cxx

#include <vtkSmartPointer.h>
#include <vtkTesting.h>
 
int main(int, char *[])
{
  // Locate VTK_DATA_ROOT
  vtkSmartPointer<vtkTesting> testHelper =
    vtkSmartPointer<vtkTesting>::New();
  std::string dataRoot = testHelper->GetDataRoot();
 
  std::cout << "dataRoot: " << dataRoot << std::endl;
 
  return EXIT_SUCCESS;
}

CMakeLists.txt

cmake_minimum_required(VERSION 2.6)
PROJECT(GetDataRoot)
 
FIND_PACKAGE(VTK REQUIRED)
INCLUDE(${VTK_USE_FILE})
 
ADD_EXECUTABLE(GetDataRoot GetDataRoot.cxx)
TARGET_LINK_LIBRARIES(GetDataRoot vtkHybrid)
Personal tools