X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=CMakeLists.txt;h=270c2ef18b56ede69bd483e27e76459d138bf1b4;hb=dc92162939bda50fae79e139f599a4c3e8b95047;hp=710c626ec7dbc465c626e137c2aac754038fc478;hpb=e9426dd61586757d23d7dddc85b3076f477e7f07;p=apitrace diff --git a/CMakeLists.txt b/CMakeLists.txt index 710c626..270c2ef 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -238,6 +238,7 @@ add_definitions( # Common libraries / utilities include_directories ( + ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/common ) @@ -375,10 +376,10 @@ if (WIN32) DEPENDS wgltrace.py gltrace.py trace.py specs/wglapi.py specs/wglenum.py specs/glapi.py specs/glparams.py specs/gltypes.py specs/winapi.py specs/stdapi.py ) add_library (wgltrace MODULE specs/opengl32.def + ${CMAKE_CURRENT_BINARY_DIR}/glproc.hpp wgltrace.cpp glcaps.cpp glproc_gl.cpp - ${CMAKE_CURRENT_BINARY_DIR}/glproc.hpp ) set_target_properties (wgltrace PROPERTIES PREFIX "" @@ -397,10 +398,10 @@ elseif (APPLE) ) add_library (cgltrace SHARED + ${CMAKE_CURRENT_BINARY_DIR}/glproc.hpp cgltrace.cpp glcaps.cpp glproc_gl.cpp - ${CMAKE_CURRENT_BINARY_DIR}/glproc.hpp ) set_target_properties (cgltrace PROPERTIES @@ -497,12 +498,8 @@ add_custom_command ( DEPENDS glstate.py specs/glparams.py specs/gltypes.py specs/stdapi.py ) -include_directories ( - ${CMAKE_CURRENT_BINARY_DIR} - ${OPENGL_INCLUDE_PATH} -) - set (retrace_sources + ${CMAKE_CURRENT_BINARY_DIR}/glproc.hpp glretrace_gl.cpp glretrace_cgl.cpp glretrace_glx.cpp @@ -514,7 +511,6 @@ set (retrace_sources retrace.cpp retrace_stdc.cpp glws.cpp - ${CMAKE_CURRENT_BINARY_DIR}/glproc.hpp ) add_executable (glretrace @@ -534,14 +530,21 @@ target_link_libraries (glretrace ) if (WIN32) -elseif (APPLE) - target_link_libraries (glretrace - "-framework Cocoa" - "-framework ApplicationServices" # CGS* - ${OPENGL_gl_LIBRARY} # CGL* - ) else () - target_link_libraries (glretrace ${X11_X11_LIB}) + 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) endif () install (TARGETS glretrace RUNTIME DESTINATION bin) @@ -562,10 +565,8 @@ if (EGL_FOUND AND NOT WIN32 AND NOT APPLE) target_link_libraries (eglretrace common - ) - - target_link_libraries (eglretrace ${X11_X11_LIB} + pthread ) install (TARGETS eglretrace RUNTIME DESTINATION bin)