<div dir="ltr">Hi all,<div><br></div><div>I'm working on a project that integrates Qt's QML with VTK. I inspired myself from this code to integrate VTK into QML:</div><div><a href="https://gist.github.com/nocnokneo/c3fb01bb7ecaf437f7d6">https://gist.github.com/nocnokneo/c3fb01bb7ecaf437f7d6</a><br></div><div><br></div><div>For testing purpose, I was able to run the application (QML + VTK) under a Ubuntu 15.10 Server install which does <i>not</i> 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 <a href="http://doc.qt.io/qt-5/embedded-linux.html">http://doc.qt.io/qt-5/embedded-linux.html</a>).</div><div><br></div><div>This project is meant to run on a device of which the OS is built using Yocto <i>without </i>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).</div><div><br></div><div>The only recipes I've found for VTK on Yocto is this one from Marc Ferland: <a href="https://github.com/mferland/meta-vtk">https://github.com/mferland/meta-vtk</a></div><div>Unfortunately:</div><div>1) It is 2 years old and applies for an old release of VTK</div><div>2) It assumes that Yocto is including X11 (through the DISTRO_FEATURES="x11")</div><div>3) It is targeting OpenEmbedded (instead of Yocto)</div><div><br></div><div>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.</div><div><br></div><div>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:</div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div><div><font face="monospace, monospace">| CMake Error at CMake/FindPackageHandleStandardArgs.cmake:97 (MESSAGE):</font></div></div><div><div><font face="monospace, monospace">|   Could NOT find OSMesa (missing: OSMESA_LIBRARY OSMESA_INCLUDE_DIR)</font></div></div><div><div><font face="monospace, monospace">| Call Stack (most recent call first):</font></div></div><div><div><font face="monospace, monospace">|   CMake/FindPackageHandleStandardArgs.cmake:288 (_FPHSA_FAILURE_MESSAGE)</font></div></div><div><div><font face="monospace, monospace">|   CMake/FindOSMesa.cmake:45 (find_package_handle_standard_args)</font></div></div><div><div><font face="monospace, monospace">|   CMake/vtkOpenGL.cmake:59 (find_package)</font></div></div><div><div><font face="monospace, monospace">|   ThirdParty/glew/vtkglew/CMakeLists.txt:3 (include)</font></div></div></blockquote><div><br></div><div><br></div><div>My questions are:</div><div>1) Can I compile VTK <i>without </i>having any X11 libraries?</div><div>2) What does the cmake flag VTK_USE_X do?</div><div>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 <a href="https://gist.github.com/nocnokneo/c3fb01bb7ecaf437f7d6">https://gist.github.com/nocnokneo/c3fb01bb7ecaf437f7d6</a>)? </div><div>4) How come I was able to run my QML+VTK example on the Qt platform EGLFS on a distro without X11?</div><div><br></div><div>Thanks for any clarification!</div><div><br></div><div>Regards,</div><div><br></div><div>Nicolas</div><div><br></div></div>