# prescribed in http://www.gentoo.org/proj/en/qa/automagic.xml
set (ENABLE_GUI "AUTO" CACHE STRING "Enable Qt GUI.")
+set (ENABLE_EGL "AUTO" CACHE STRING "Enable EGL support.")
+
##############################################################################
# Find dependencies
include_directories (${X11_INCLUDE_DIR})
- pkg_check_modules (EGL egl)
- if (EGL_FOUND)
- include_directories (${EGL_INCLUDE_DIR})
- add_definitions (-DHAVE_EGL)
+ if (ENABLE_EGL)
+ if (NOT ENABLE_EGL STREQUAL "AUTO")
+ set (REQUIRE_EGL REQUIRED)
+ endif ()
+ pkg_check_modules (EGL egl glesv1_cm glesv2 ${REQUIRE_EGL})
+ if (EGL_FOUND)
+ include_directories (${EGL_INCLUDE_DIR})
+ add_definitions (-DHAVE_EGL)
+ endif ()
+ else ()
+ set (EGL_FOUND 0)
endif ()
endif ()
add_library (common STATIC
common/trace_file.cpp
+ common/trace_file_read.cpp
+ common/trace_file_write.cpp
common/trace_file_zlib.cpp
common/trace_file_snappy.cpp
common/trace_model.cpp
${CMAKE_CURRENT_BINARY_DIR}/glproc.hpp
glxtrace.cpp
glcaps.cpp
- glsnapshot.cpp
)
set_target_properties (glxtrace PROPERTIES
${CMAKE_CURRENT_BINARY_DIR}/glproc.hpp
egltrace.cpp
glcaps.cpp
- glsnapshot.cpp
)
set_property (
${OPENGL_INCLUDE_PATH}
)
-add_executable (glretrace
+set (retrace_sources
glretrace_gl.cpp
glretrace_cgl.cpp
glretrace_glx.cpp
retrace.cpp
retrace_stdc.cpp
glws.cpp
- ${glws_os}
${CMAKE_CURRENT_BINARY_DIR}/glproc.hpp
)
+add_executable (glretrace
+ ${retrace_sources}
+ ${glws_os}
+)
+
set_property (
TARGET glretrace
APPEND
install (TARGETS glretrace RUNTIME DESTINATION bin)
+if (EGL_FOUND AND NOT WIN32 AND NOT APPLE)
+ add_executable (eglretrace
+ ${retrace_sources}
+ glws_egl_xlib.cpp
+ )
+
+ set_property (
+ TARGET eglretrace
+ APPEND
+ PROPERTY COMPILE_DEFINITIONS "RETRACE"
+ PROPERTY COMPILE_DEFINITIONS "TRACE_EGL"
+ )
+
+ target_link_libraries (eglretrace
+ common
+ )
+
+ target_link_libraries (eglretrace
+ ${EGL_LIBRARIES}
+ ${OPENGL_gl_LIBRARY}
+ ${X11_X11_LIB}
+ )
+
+ install (TARGETS eglretrace RUNTIME DESTINATION bin)
+endif ()
+
##############################################################################
# CLI
##############################################################################
# Scripts (to support the CLI)
-install (PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/scripts/tracediff.sh DESTINATION ${LIB_INSTALL_DIR}/scripts)
-install (PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/scripts/jsondiff.py DESTINATION ${LIB_INSTALL_DIR}/scripts)
+install (
+ PROGRAMS
+ ${CMAKE_CURRENT_SOURCE_DIR}/scripts/tracediff.sh
+ ${CMAKE_CURRENT_SOURCE_DIR}/scripts/jsondiff.py
+ ${CMAKE_CURRENT_SOURCE_DIR}/scripts/snapdiff.py
+ DESTINATION ${SCRIPTS_INSTALL_DIR}
+)
##############################################################################
# GUI