diff --git a/vtkm/rendering/CMakeLists.txt b/vtkm/rendering/CMakeLists.txt index 2c9ac1479..83ca0dbeb 100644 --- a/vtkm/rendering/CMakeLists.txt +++ b/vtkm/rendering/CMakeLists.txt @@ -59,6 +59,7 @@ set(osmesa_headers ) #----------------------------------------------------------------------------- +set(includes) if(OPENGL_FOUND) set(headers ${headers} ${opengl_headers}) @@ -69,6 +70,7 @@ if(OPENGL_FOUND) find_package(MESA) if (OSMESA_FOUND) set(headers ${headers} ${glx_headers}) + list(APPEND includes ${OSMESA_INCLUDE_DIR}) endif() endif() endif() @@ -78,7 +80,8 @@ vtkm_declare_headers(${headers}) add_subdirectory(internal) add_subdirectory(raytracing) -include_directories(${OSMESA_INCLUDE_DIR}) +include_directories(${includes}) + diff --git a/vtkm/rendering/testing/CMakeLists.txt b/vtkm/rendering/testing/CMakeLists.txt index 2cea45310..b6c5cc34f 100644 --- a/vtkm/rendering/testing/CMakeLists.txt +++ b/vtkm/rendering/testing/CMakeLists.txt @@ -23,11 +23,13 @@ set(unit_tests UnitTestMapperVolume.cxx ) +set(libs) if (OSMESA_FOUND) set(unit_tests ${unit_tests} UnitTestMapperOSMesa.cxx ) + list(APPEND libs ${OSMESA_INCLUDE_DIR}) endif() VTKM_unit_tests(SOURCES ${unit_tests} - LIBRARIES ${OSMESA_LIBRARY}) + LIBRARIES ${libs})