[vtkusers] Problem depending on VTK >= 8.1 with CMake 3.12.1 and VTK 8.1.1 on Win 10/MSVC 2017

Elvis Stansvik elvis.stansvik at orexplore.com
Sun Aug 19 04:05:49 EDT 2018


Hey all,

In the past it was worked for us to depend on VTK 8.1 with

    find_package(VTK 8.1 ....)

But now I'm having trouble with a setup like this:

    - Windows 10
    - CMake 3.12.1
    - VTK 8.1.1

The error I get when configuring our project is:

-- Selecting Windows SDK version 10.0.17134.0 to target Windows 10.0.16299.
CMake Error at CMakeLists.txt:29 (find_package):
  Could not find a configuration file for package "VTK" that is compatible
  with requested version "8.1".

  The following configuration files were considered but not accepted:

    C:/Users/Elvis/Dev/VTK-8.1.1-inst/lib/cmake/vtk-8.1/VTKConfig.cmake,
version: 8.1.1 (64bit)

This is nonsensical to me. Version 8.1.1 (which was found) should be
able to satisfy 8.1.

Just to test, I set the dependency in our CMakeLists.txt to exactly
8.1.1, and got:

-- Selecting Windows SDK version 10.0.17134.0 to target Windows 10.0.16299.
CMake Error at CMakeLists.txt:29 (find_package):
  Could not find a configuration file for package "VTK" that is compatible
  with requested version "8.1.1".

  The following configuration files were considered but not accepted:

    C:/Users/Elvis/Dev/VTK-8.1.1-inst/lib/cmake/vtk-8.1/VTKConfig.cmake,
version: 8.1.1 (64bit)

Which makes it obvious something is not right.

For reference, cmake was invoked like

    cmake -DCMAKE_PREFIX_PATH=C:/Users/Elvis/Dev/qwt-6.1.2-inst;C:/Users/Elvis/Dev/VTK-8.1.1-inst;C:/Users/Elvis/Dev/HDF5/1.10.2;C:/Users/Elvis/Dev/karchive-5.36.0-inst
..

where C:/Users/Elvis/Dev/VTK-8.1.1-inst is the installation prefix of VTK.

Any ideas? Was there some change in CMake recently that could have caused this?

Many thanks in advance,
Elvis


More information about the vtkusers mailing list