VTK/Examples/Cxx/Utilities/CMakeVTKVersionCheck

From KitwarePublic
< VTK‎ | Examples‎ | Cxx
Jump to navigationJump to search

CMakeVTKVersionCheck.cxx

#include <vtkPolyData.h>

int main(int, char *[])
{

  return EXIT_SUCCESS;
}

CMakeLists.txt

# This works:
# if(${VTK_MAJOR_VERSION} LESS 5 OR ${VTK_MINOR_VERSION} LESS 8)
#   message("Your VTK version is too old!")
# else()
#   message("Valid VTK version.")
# endif()

# But this is more clear:
if("${VTK_VERSION}" VERSION_LESS 5.8)
  message("Your VTK version is too old! Must be greater than ${VTK_VERSION}")
else()
  message("Valid VTK version (${VTK_VERSION}).")
endif()