-
jcfr authored
By setting OpenGL_GL_PREFERENCE to LEGACY, this commit ensures that the applications and libraries are linked against libGL.so (legacy) instead of libOpenGL.so and libGLX.so (GL Vendor Neutral Dispatch library). It allows to run the application on system where only libGL is available. It fixes a regression introduced in r27988 (COMP: Update CMake minimum required version from 3.5 to 3.13) after which one CMP0072 was set to NEW and led to have the GLVND libraries being used by default. Detailed explanation about GLVND (thanks @chuckatkins): libOpenGL.so and libGLX.so are actually just the stub GLVND interface libraries with no implementation behind them. GLVND uses a config file to locate and dlopen the implementation at runtime like a plugin (/usr/lib64/libGLX_nvidia.so.418.39 for instance). So it's not really suitable for redistribution unless an implementation like a glvnd-enabled mesa and associated config files are also packaged. For broad redistributability, it is preferable to use use the legacy libGL for now so at runtime it will be available on most systems. That will likely need to be the case for the next few years until the non-glvnd implementations are much less common. Co-authored-by: Chuck Atkins <chuck.atkins@kitware.com> git-svn-id: http://svn.slicer.org/Slicer4/trunk@27996 3bd1e089-480b-0410-8dfb-8563597acbee
245097a6