X-Git-Url: https://git.notmuchmail.org/git?a=blobdiff_plain;f=CMakeLists.txt;h=77abbe527af3bc3d4c3ee9a8e0cc06b35ceaa7db;hb=38c932b18ad60176980f0c99f202c610757c000a;hp=87aac12e9482bcd1d151fce4f20671b59f1892ad;hpb=efb9e170ed59dc5fc205bf890e9954fdf0a0cafc;p=apitrace diff --git a/CMakeLists.txt b/CMakeLists.txt index 87aac12..77abbe5 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,6 +21,8 @@ set (ENABLE_GUI "AUTO" CACHE STRING "Enable Qt GUI.") ############################################################################## # Find dependencies +include (FindPkgConfig) + set (CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake) set (CMAKE_USE_PYTHON_VERSION 2.7 2.6) @@ -46,6 +48,12 @@ else () 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 () @@ -179,6 +187,8 @@ endif () # For glext headers include_directories (${CMAKE_CURRENT_SOURCE_DIR}/thirdparty) +# For EGL headers +include_directories (${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/khr) ############################################################################## # Installation directories @@ -191,14 +201,19 @@ else () set (DOC_INSTALL_DIR share/doc/${CMAKE_PROJECT_NAME}) endif () +set (LIB_INSTALL_DIR lib/apitrace) + if (APPLE) # MacOSX uses fat binaries, so no need to have per-architecture wrapper # directories - set (WRAPPER_INSTALL_DIR lib/apitrace) + set (LIB_ARCH_INSTALL_DIR ${LIB_INSTALL_DIR}) else () - set (WRAPPER_INSTALL_DIR lib/apitrace/${CMAKE_SYSTEM_PROCESSOR}) + set (LIB_ARCH_INSTALL_DIR ${LIB_INSTALL_DIR}/${CMAKE_SYSTEM_PROCESSOR}) endif () +set(SCRIPTS_INSTALL_DIR ${LIB_INSTALL_DIR}/scripts) +set(WRAPPER_INSTALL_DIR ${LIB_ARCH_INSTALL_DIR}/wrappers) + # Expose the binary/install directories to source # # TODO: Use the same directory layout, for both build and install directories, @@ -207,6 +222,7 @@ endif () add_definitions( -DAPITRACE_BINARY_DIR="${CMAKE_BINARY_DIR}" -DAPITRACE_INSTALL_PREFIX="${CMAKE_INSTALL_PREFIX}" + -DAPITRACE_SCRIPTS_INSTALL_DIR="${CMAKE_INSTALL_PREFIX}/${SCRIPTS_INSTALL_DIR}" -DAPITRACE_WRAPPER_INSTALL_DIR="${CMAKE_INSTALL_PREFIX}/${WRAPPER_INSTALL_DIR}" ) @@ -222,7 +238,7 @@ include_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) @@ -416,6 +432,42 @@ else () 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 @@ -441,6 +493,7 @@ add_executable (glretrace glretrace_cgl.cpp glretrace_glx.cpp glretrace_wgl.cpp + glretrace_egl.cpp glretrace_main.cpp glstate.cpp glstate_params.cpp @@ -480,6 +533,12 @@ install (TARGETS glretrace RUNTIME DESTINATION bin) add_subdirectory(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) + ############################################################################## # GUI