Find OpenGL libraries in external projects

Previously when an external project loaded VTK-m with find_package(VTKm)
and then tried to use anything with OpenGL, you would get compiler (and
probably linker) errors. The problem was that
VTKmRenderingContexts.cmake skipped over the loading of OpenGL libraries
because the vtkm_rendering_gl_context target was imported before this
code was ever called. Correct the problem by going through the motions
of checking OpenGL every time.
This commit is contained in:
Kenneth Moreland 2018-04-19 19:41:46 -06:00
parent 172e3929fd
commit 96ff3a5343

@ -84,11 +84,6 @@ function(vtkm_find_gl)
endfunction()
#-----------------------------------------------------------------------------
if(TARGET vtkm_rendering_gl_context)
return()
endif()
add_library(vtkm_rendering_gl_context INTERFACE)
if(VTKm_ENABLE_GL_CONTEXT OR
VTKm_ENABLE_OSMESA_CONTEXT OR
VTKm_ENABLE_EGL_CONTEXT
@ -98,6 +93,13 @@ if(VTKm_ENABLE_GL_CONTEXT OR
QUIET)
endif()
#-----------------------------------------------------------------------------
if(TARGET vtkm_rendering_gl_context)
return()
endif()
add_library(vtkm_rendering_gl_context INTERFACE)
#-----------------------------------------------------------------------------
if(VTKm_ENABLE_GL_CONTEXT)
if(TARGET OpenGL::GLX)