[vtk-developers] FindPackage not working in new module system

Aron Helser aron.helser at kitware.com
Thu Jan 10 14:01:59 EST 2019


Yep, just figured that out, thanks!

 Unfortunately, I'm still having a problem just with IOFFMPEG - I need it
for 'vtkFFMPEGVideoSource.h', but mineview cmake reports:

> -- Could NOT find FFMPEG (missing: FFMPEG_INCLUDE_DIRS FFMPEG_LIBRARIES
> avformat avcodec avutil swscale) (Required is at least version "4.0")
> -- Could not find the VTK package due to a missing dependency: FFMPEG
> CMake Warning at CMakeLists.txt:5 (find_package):
>   Found package configuration file:
>     C:/akit/vtk/build/lib/cmake/vtk-8.90/vtk-config.cmake
>   but it set VTK_FOUND to FALSE so package "VTK" is considered to be NOT
>   FOUND.  Reason given by package:
>   Could not find the VTK package with the following required components:
>   IOFFMPEG.


I'm setting FFMPEG_ROOT to compile vtk, so then if I set it for my app, I
get a warning:

CMake Warning (dev) at
> C:/akit/vtk/build/lib/cmake/vtk-8.90/VTK-vtk-module-find-packages.cmake:279
> (find_package):
> Policy CMP0074 is not set: find_package uses <PackageName>_ROOT variables.
> Run "cmake --help-policy CMP0074" for policy details. Use the cmake_policy
> command to set the policy and suppress this warning. CMake variable
> FFMPEG_ROOT is set to: c:/akit/mineview/src/ffmpeg For compatibility,
> CMake is ignoring the variable.
> Call Stack (most recent call first):
> C:/akit/vtk/build/lib/cmake/vtk-8.90/vtk-config.cmake:62 (include)
> CMakeLists.txt:5 (find_package)


But my app compiles! So I'm not sure about the warning?

On Thu, Jan 10, 2019 at 1:37 PM Ben Boeckel <ben.boeckel at kitware.com> wrote:

> On Thu, Jan 10, 2019 at 12:24:07 -0500, Aron Helser wrote:
> > Sorry, I should have started with the original problem. I started with
> this
> > file:
> >
> > cmake_minimum_required(VERSION 3.3 FATAL_ERROR)
> > PROJECT (mineview)
> > find_package(VTK REQUIRED)
> > vtk_module_config(VTK
> >   vtkCommonCore
> >   vtkCommonDataModel
> >   vtkFiltersGeneral
> >   vtkIOFFMPEG
> >   vtkIOImage
> >   vtkIOXML
> >   vtkInteractionStyle
> >   vtkRenderingOpenGL2
> >   vtkRenderingOpenVR
> > )
> > include(${VTK_USE_FILE})
> >
> > add_executable(mineview MACOSX_BUNDLE mineview.cxx Lobby.cxx View.cxx
> > AudioHandler.cxx)
> > target_link_libraries(mineview ${VTK_LIBRARIES} Xaudio2.lib opengl32
> > winmm.lib)
> >
> > but "vtk_module_config" doesn't exist anymore, right? So I tried to
> change
> > to this:
> > find_package(VTK
> >   COMPONENTS
> >   vtkCommonCore
> >  ...
> >
> > but then it complains:
> >
> > CMake Warning at CMakeLists.txt:5 (find_package):
> > Found package configuration file:
> >
> > C:/akit/vtk/build/lib/cmake/vtk-8.90/vtk-config.cmake
> >
> > but it set VTK_FOUND to FALSE so package "VTK" is considered to be NOT
> > FOUND. Reason given by package:
> >
> > Could not find the VTK package with the following required components:
> > vtkCommonCore.
> >
> >
> > Thus I am confused. :)
> > Hope those breadcrumbs help?
>
> COMPONENTS are now `CommonCore` and `FiltersGeneral` since they end up
> like `VTK::CommonCore`. I suppose the components list could be
> preprocessed to detect a leading `vtk` and remove it (warning that that
> name is deprecated).
>
> --Ben
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://vtk.org/pipermail/vtk-developers/attachments/20190110/1a11dc32/attachment.html>


More information about the vtk-developers mailing list