On Linux when using GLEW also link to the Threading library.

This is needed because some implementations GLEW do lazy linking to
PThreads.
This commit is contained in:
Robert Maynard 2015-09-04 14:38:37 -04:00
parent 6341eb30db
commit 4cf9ab018a
2 changed files with 7 additions and 1 deletions

@ -220,7 +220,7 @@ function(vtkm_unit_tests)
if(VTKm_ENABLE_OPENGL_INTEROP)
list(APPEND VTKm_UT_INCLUDE_DIRS ${OPENGL_INCLUDE_DIR} ${GLEW_INCLUDE_DIR} )
list(APPEND VTKm_UT_LIBRARIES ${OPENGL_LIBRARIES} ${GLEW_LIBRARIES} )
list(APPEND VTKm_UT_LIBRARIES ${OPENGL_LIBRARIES} ${GLEW_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} )
endif()
if(VTKm_ENABLE_OPENGL_TESTS)

@ -165,6 +165,12 @@ CMAKE_DEPENDENT_OPTION(VTKm_ENABLE_OPENGL_TESTS
"Enable OpenGL Interop Render Window Tests"
ON "VTKm_ENABLE_OPENGL_INTEROP;GLUT_FOUND" OFF)
#on unix/linux Glew uses pthreads, so we need to find that, and link to it
#explicitly or else in release mode we get sigsegv on launch
if(UNIX AND VTKm_ENABLE_OPENGL_INTEROP)
find_package(Threads REQUIRED)
endif()
#-----------------------------------------------------------------------------
# Find Pyexpander in case somebody wants to update the auto generated
# faux variadic template code