MantisBT - CMake
View Issue Details
0011678CMakeCMakepublic2011-01-10 16:312011-01-10 16:56
Curan 
Brad King 
normalmajoralways
closedno change required 
LinuxDebian6.0+
CMake-2-8 
 
0011678: FindVTK.cmake fails with additional version requirement.
Michael Hanke reported to Debian the bug #600889, stating that FindVTK.cmake fails to find a VTK version if a specific version requirement was given. For Debian this will be fixed in the next upload, the latest version of the patch can be found at <http://git.debian.org/?p=collab-maint/cmake.git;a=blob;f=debian/patches/FindVTK_fix_%23600889.diff;hb=HEAD>, [^] the current version is attached to this report.
Use (e.g.)

FIND_PACKAGE(VTK 5.4 REQUIRED)

instead of

FIND_PACKAGE(VTK REQUIRED)
The bug was originally reported to Debian as bug #600889, you can find the bug report at <http://bugs.debian.org/600889>. [^]
No tags attached.
diff FindVTK_fix_#600889.diff (1,827) 2011-01-10 16:31
https://public.kitware.com/Bug/file/3614/FindVTK_fix_%23600889.diff
Issue History
2011-01-10 16:31CuranNew Issue
2011-01-10 16:31CuranFile Added: FindVTK_fix_#600889.diff
2011-01-10 16:53Brad KingNote Added: 0024561
2011-01-10 16:53Brad KingAssigned To => Brad King
2011-01-10 16:53Brad KingStatusnew => assigned
2011-01-10 16:56Brad KingNote Added: 0024562
2011-01-10 16:56Brad KingStatusassigned => closed
2011-01-10 16:56Brad KingResolutionopen => no change required

Notes
(0024561)
Brad King   
2011-01-10 16:53   
The proposed fix is incorrect. The entire block of code around it is specifically looking for VTK 4.0 and nothing more recent. It starts with:

  # Special search for VTK 4.0.

and the case reported in the bug is intentionally commented as

  # We found the wrong version. Pretend we did not find it.

The *real* search takes place before that entire block begins:

  # Use the Config mode of the find_package() command to find VTKConfig.
  # If this succeeds (possibly because VTK_DIR is already set), the
  # command will have already loaded VTKConfig.cmake and set VTK_FOUND.
  IF(NOT _VTK_40_ONLY AND NOT VTK_FOUND)
    FIND_PACKAGE(VTK QUIET NO_MODULE)
  ENDIF()

and is actually implemented in C++ in the find_package() command.

This is actually a VTK issue. It does not provide a package version file (VTKConfigVersion.cmake) file next to its package configuration file (VTKConfig.cmake). Debian can fix this for its VTK packages by adding such a file.
(0024562)
Brad King   
2011-01-10 16:56   
No change is required to CMake. Please file this as a VTK issue.