[vtkusers] Find_package and VTK version comparison restrictions

Francois Budin fbudin at unc.edu
Fri Jun 27 13:07:50 EDT 2014


Hello,

I am using VTK as part of my project that I configure with CMake. As shown
in [1], if one specifies a REQUIRED version in the "find_package" CMake
command, VTK tries to match both the MAJOR and the MINOR version to verify
that the library given by the user is compatible with what is specified in
the CMakeLists.txt [2]. This means that if in my CMakeLists.txt I required
VTK6.0 and that a user specifies a directory that contains VTK 6.1, it will
refuse to use it giving an error message. It is not the case with other
libraries such as ITK (ie, if one requires ITK3 and gives a directory that
contains TIK4, it will still configures the project correctly). I am
wondering why VTK is so restrictive and if there is a reason to not require
only the MAJOR version to match since typically APIs are compatible between
MINOR revisions of a same MAJOR revision. I have implemented a workaround
for my project [3] but it would be easier if I could do without it.
Sincerely,

Francois


[1] http://www.vtk.org/Bug/view.php?id=14826#c32945
[2]
https://github.com/Kitware/VTK/blob/master/CMake/VTKConfigVersion.cmake.in#L5
[3]
https://github.com/NIRALUser/3DMetricTools/blob/master/SuperBuild/External_VTK.cmake#L175-L182
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20140627/9efffcd9/attachment.html>


More information about the vtkusers mailing list