<div dir="ltr"><div>This has arisen because I was looking at the Qt examples in VTK in the folder Examples/GUI/Qt and thinking about issues that might arise when building them as standalone examples.</div><div><br></div>If they are built within VTK, then a similar approach can be used to that used when the VTK Qt tests are built,namely by adding the following code like this in their respective CMakeLists.txt files:<div>
<br></div><div>--------------------------------------------------------------------------</div>
<div><div>if(VTK_QT_VERSION VERSION_GREATER "4")<br></div><div># Do something specific for Qt5</div><div>else()</div><div># Do something specific for Qt4</div><div>endif()</div><div>--------------------------------------------------------------------------<br>
</div></div><div>
<div><br></div><div>Now the problem is that VTK_QT_VERSION is not a global configuration setting. So we don't know what version of Qt was used when VTK was built. This means that when building examples we have no way (as far as I can see) of determining what version of Qt was used.</div>
<div><br></div><div>My initial thinking is that we need to have a global configuration option in VTKConfig.cmake, like this:<br></div><div>SET(VTK_QT_VERSION "5") or SET(VTK_QT_VERSION "4") depending upon the Qt version.</div>
<div><br></div><div>Then in your CMake code have:</div><div>if(VTK_QT_VERSION VERSION_GREATER "4")<br></div><div># Do something specific for Qt5</div><div>else()</div><div># Do something specific for Qt4</div><div>
endif()</div><div><br></div><div>I think this would work, but has anyone else a better idea or solution?</div><div><br></div><div>In case you think it is a trivial problem, at present I can't build the Wiki Examples because they assume Qt4 is used.</div>
<div><br></div><div><br></div><div>Thanks</div><div>   Andrew</div><div><br></div><div><br></div>-- <br>___________________________________________<br>Andrew J. P. Maclean<br><br>___________________________________________
</div></div>