##############################################################################
# Find dependencies
+include (FindPkgConfig)
+
set (CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
set (CMAKE_USE_PYTHON_VERSION 2.7 2.6)
set (X11_GL_LIB ${OPENGL_gl_LIBRARY})
include_directories (${X11_INCLUDE_DIR})
+
+ pkg_check_modules (EGL egl)
+ if (EGL_FOUND)
+ include_directories (${EGL_INCLUDE_DIR})
+ add_definitions (-DHAVE_EGL)
+ endif ()
endif ()
# For glext headers
include_directories (${CMAKE_CURRENT_SOURCE_DIR}/thirdparty)
+# For EGL headers
+include_directories (${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/khr)
##############################################################################
# Installation directories
add_custom_command (
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/glproc.hpp
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/glproc.py > ${CMAKE_CURRENT_BINARY_DIR}/glproc.hpp
- DEPENDS glproc.py dispatch.py specs/wglapi.py specs/glxapi.py specs/cglapi.py specs/glapi.py specs/gltypes.py specs/stdapi.py
+ DEPENDS glproc.py dispatch.py specs/wglapi.py specs/glxapi.py specs/cglapi.py specs/eglapi.py specs/glapi.py specs/gltypes.py specs/stdapi.py
)
if (WIN32)
endif ()
+if (EGL_FOUND)
+ # libEGL.so/libGL.so
+ add_custom_command (
+ OUTPUT egltrace.cpp
+ COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/egltrace.py > ${CMAKE_CURRENT_BINARY_DIR}/egltrace.cpp
+ DEPENDS egltrace.py gltrace.py trace.py specs/eglapi.py specs/glapi.py specs/glparams.py specs/gltypes.py specs/stdapi.py
+ )
+
+ add_library (egltrace SHARED
+ ${CMAKE_CURRENT_BINARY_DIR}/glproc.hpp
+ egltrace.cpp
+ glcaps.cpp
+ glsnapshot.cpp
+ )
+
+ set_property (
+ TARGET egltrace
+ APPEND
+ PROPERTY COMPILE_DEFINITIONS "TRACE_EGL"
+ )
+
+ set_target_properties (egltrace PROPERTIES
+ # avoid the default "lib" prefix
+ PREFIX ""
+ LINK_FLAGS "-Wl,-Bsymbolic -Wl,-Bsymbolic-functions"
+ # Prevent symbol relocations internal to our wrapper library to be
+ # overwritten by the application.
+ RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/wrappers
+ LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/wrappers
+ )
+
+ target_link_libraries (egltrace dl)
+
+ install (TARGETS egltrace LIBRARY DESTINATION ${WRAPPER_INSTALL_DIR})
+endif ()
+
##############################################################################
# API retracers
glretrace_cgl.cpp
glretrace_glx.cpp
glretrace_wgl.cpp
+ glretrace_egl.cpp
glretrace_main.cpp
glstate.cpp
glstate_params.cpp