Skip to content
  • Jean-Christophe Fillion-Robin's avatar
    COMP: Ensure project depending on VTK link against correct OpenGL libraries · 52bc6093
    Jean-Christophe Fillion-Robin authored
    This commit is a follow-up of ab02c350 (vtk-config: export OPENGL_GL_PREFERENCE
    to the package) where (1) the variable was improperly cased and (2) the
    opengl_preference was systematically set to GLVND even if OpenGL::GL was
    defined.
    
    This commit implements two key changes:
    
    * updates the variable name to match the name expected by the
      FindOpenGL.cmake module and ensures project depending on VTK will
      look-up the expected OpenGL libraries.
    
    * sets opengl_preference by also explicitly testing the variable "use_legacy"
      Since on some system both set of libraries can be found (GLVND and LEGACY),
      it is critical to explicitly check the user choice.
    
    This is required to successfully configure project like CTK, ITK or VTK
    module wheels and ensure the corresponding libraries are not linked
    against libOpenGL when OpenGL_GL_PREFERENCE is set to LEGACY.
    52bc6093