On a system that has no opengl or mesa and with rendering enabled (such as docker container), vtkm fails to configure

when adding target_include_directories for the rendering library. I believe this happens because cmake determines that the variable VTKm_OPENGL_INCLUDE_DIRECTORIES is dependent on OPENGL_INCLUDE_DIRS( which is NOTFOUND). This causes cmake to raise an error even when VTKm_OPENGL_INCLUDE_DIRECTORIES is set to "".
This commit is contained in:
Matt Larsen 2017-07-09 10:30:58 -07:00
parent e783487f98
commit 013ff1ba45

@ -172,8 +172,13 @@ macro(vtkm_configure_component_OpenGL)
ADD_LIBRARIES ${vtkm_opengl_libraries}
)
set(VTKm_OPENGL_INCLUDE_DIRS ${vtkm_opengl_includes})
set(VTKm_OPENGL_LIBRARIES ${vtkm_opengl_libraries})
#setting VTKm_OPENGL_INCLUDE_DIRS when both mesa and
#opengl are not present causes cmake to fail to configure
#becase of a percieved dependency in the rendering lib
if(VTKm_OSMesa_FOUND OR OPENGL_FOUND)
set(VTKm_OPENGL_INCLUDE_DIRS ${vtkm_opengl_includes})
set(VTKm_OPENGL_LIBRARIES ${vtkm_opengl_libraries})
endif()
endmacro(vtkm_configure_component_OpenGL)