[vtkusers] VTK and Yocto
Nicolas Bigaouette
nbigaouette at gmail.com
Mon Dec 21 14:20:48 EST 2015
Hi all,
I'm working on a project that integrates Qt's QML with VTK. I inspired
myself from this code to integrate VTK into QML:
https://gist.github.com/nocnokneo/c3fb01bb7ecaf437f7d6
For testing purpose, I was able to run the application (QML + VTK) under a
Ubuntu 15.10 Server install which does *not* install the X server. It does
contain a /usr/lib/libGL.so though, which VTK seems to require, even if QML
uses the "eglfs" platform plugin (OpenGL ES 2.0, see
http://doc.qt.io/qt-5/embedded-linux.html).
This project is meant to run on a device of which the OS is built using
Yocto *without *X11, similarly to what Ubuntu Server provides. But while I
could build VTK, QML and my application on my Ubuntu workstation and copy
these files to the Ubuntu Server machine to run, I can't do this for the
real project running from a Yocto image. I need to compile VTK (in addition
to any other library) through the Yocto build system (bitbake).
The only recipes I've found for VTK on Yocto is this one from Marc Ferland:
https://github.com/mferland/meta-vtk
Unfortunately:
1) It is 2 years old and applies for an old release of VTK
2) It assumes that Yocto is including X11 (through the
DISTRO_FEATURES="x11")
3) It is targeting OpenEmbedded (instead of Yocto)
After adapting the recipe for VTK 7.0.0.rc1, I cannot build it. From the
original recipe, I removed dependencies on x11-related libraries
(virtual/libx11 virtual/libgl libxt xserver-xorg-extension-glx) and
everything Python related.
What I don't understand is that recipe uses "-DVTK_USE_X:BOOL=OFF". But I
still get errors dues to missing X11 libraries. For example, I am getting:
| CMake Error at CMake/FindPackageHandleStandardArgs.cmake:97 (MESSAGE):
| Could NOT find OSMesa (missing: OSMESA_LIBRARY OSMESA_INCLUDE_DIR)
| Call Stack (most recent call first):
| CMake/FindPackageHandleStandardArgs.cmake:288 (_FPHSA_FAILURE_MESSAGE)
| CMake/FindOSMesa.cmake:45 (find_package_handle_standard_args)
| CMake/vtkOpenGL.cmake:59 (find_package)
| ThirdParty/glew/vtkglew/CMakeLists.txt:3 (include)
My questions are:
1) Can I compile VTK *without *having any X11 libraries?
2) What does the cmake flag VTK_USE_X do?
3) Does it make sense to build VTK without x11 if I will be using VTK from
C++ including these headers: QOpenGLFunctions, QQuickFramebufferObject,
QOpenGLFramebufferObject, vtkGenericOpenGLRenderWindow (like at
https://gist.github.com/nocnokneo/c3fb01bb7ecaf437f7d6)?
4) How come I was able to run my QML+VTK example on the Qt platform EGLFS
on a distro without X11?
Thanks for any clarification!
Regards,
Nicolas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20151221/7d1c7f46/attachment.html>
More information about the vtkusers
mailing list