+ if (APPLE)
+ target_link_libraries (glretrace
+ "-framework Cocoa"
+ "-framework ApplicationServices" # CGS*
+ ${OPENGL_gl_LIBRARY} # CGL*
+ )
+ else ()
+ target_link_libraries (glretrace ${X11_X11_LIB})
+ endif ()
+
+ # gdb doesn't like when pthreads is loaded through dlopen (which happens
+ # when dlopen'ing libGL), so link pthreads to avoid this issue. See also
+ # http://stackoverflow.com/questions/2702628/gdb-cannot-find-new-threads-generic-error
+ target_link_libraries (glretrace pthread)