Hi,

I am using CMake to set up a VTK project. Our project requires VTK to be 
version 7.1 or newer.
I'm using Ubuntu 16.04 with CMake 3.5.1.

My CMakeLists.txt looks like this:

cmake_minimum_required(VERSION 2.8)
project(test_vtk_versions)

find_package(VTK 7.1 REQUIRED)
include(${VTK_USE_FILE})

add_executable(test_vtk_1 test_vtk_1)
target_link_libraries(test_vtk_1 ${VTK_LIBRARIES})

I have several versions of VTK installed on my machine:

  * VTK 6.2 from the Ubuntu repositories
  * VTK 7.1 compiled/installed from sources
  * VTK 8.0 compiled/installed from sources

$ ls /usr/local/lib/cmake/vtk* /usr/lib/cmake/vtk*
/usr/lib/cmake/vtk-6.2:
exportheader.cmake.in       UseVTK.cmake                   
vtkJavaWrapping.cmake       vtkModuleMacros.cmake        VTKTargets.cmake       
          vtkThirdParty.cmake     vtkWrapPython.sip.in
(... list was manually shortened ...)

/usr/local/lib/cmake/vtk-7.1:
FindTCL.cmake          VTKConfigVersion.cmake         vtkGroups.cmake           
  vtkModuleHeaders.cmake.in    vtkObjectFactory.h.in     vtkTclWrapping.cmake   
 vtkWrapPython.cmake
(... list was manually shortened ...)

/usr/local/lib/cmake/vtk-8.0:
FindTCL.cmake          VTKConfigVersion.cmake         vtkGroups.cmake           
  vtkModuleHeaders.cmake.in    vtkObjectFactory.h.in                          
vtkTclTkMacros.cmake    vtkWrapping.cmake
(... list was manually shortened ...)

The project can be configured (Unix Makefile) and compiled, it is compiled 
against VTK 7.1 in this configuration.
However if I remove VTK 7.1 from the system (using sudo xargs rm < 
"install_manifest.txt") then I end with this this error:

CMake Error at CMakeLists.txt:4 (find_package):
  Could not find a configuration file for package "VTK" that is compatible
  with requested version "7.1".

  The following configuration files were considered but not accepted:

    /usr/local/lib/cmake/vtk-8.0/VTKConfig.cmake, version: 8.0.0
    /usr/lib/cmake/vtk-6.2/VTKConfig.cmake, version: 6.2.0

I have also tried find_package(VTK 7.1*.0* REQUIRED), without success.

Why isn't VTK 8.0.0 accepted? It is a greater version number so I expected it 
to be ok.
How do I specify that I want VTK 7.1 OR newer?

Thank you for your time
Bye

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

Reply via email to