Move retracers to their own directory.
authorJosé Fonseca <jose.r.fonseca@gmail.com>
Sat, 14 Apr 2012 16:22:57 +0000 (17:22 +0100)
committerJosé Fonseca <jose.r.fonseca@gmail.com>
Sat, 14 Apr 2012 16:22:57 +0000 (17:22 +0100)
30 files changed:
.gitignore
CMakeLists.txt
retrace/.gitignore [new file with mode: 0644]
retrace/CMakeLists.txt [new file with mode: 0644]
retrace/d3dretrace.hpp [moved from d3dretrace.hpp with 100% similarity]
retrace/d3dretrace.py [moved from d3dretrace.py with 100% similarity]
retrace/d3dretrace_main.cpp [moved from d3dretrace_main.cpp with 100% similarity]
retrace/glretrace.hpp [moved from glretrace.hpp with 100% similarity]
retrace/glretrace.py [moved from glretrace.py with 100% similarity]
retrace/glretrace_cgl.cpp [moved from glretrace_cgl.cpp with 100% similarity]
retrace/glretrace_egl.cpp [moved from glretrace_egl.cpp with 100% similarity]
retrace/glretrace_glx.cpp [moved from glretrace_glx.cpp with 100% similarity]
retrace/glretrace_main.cpp [moved from glretrace_main.cpp with 100% similarity]
retrace/glretrace_wgl.cpp [moved from glretrace_wgl.cpp with 100% similarity]
retrace/glstate.cpp [moved from glstate.cpp with 100% similarity]
retrace/glstate.hpp [moved from glstate.hpp with 100% similarity]
retrace/glstate_images.cpp [moved from glstate_images.cpp with 100% similarity]
retrace/glstate_internal.hpp [moved from glstate_internal.hpp with 100% similarity]
retrace/glstate_params.py [moved from glstate_params.py with 99% similarity]
retrace/glstate_shaders.cpp [moved from glstate_shaders.cpp with 100% similarity]
retrace/glws.cpp [moved from glws.cpp with 100% similarity]
retrace/glws.hpp [moved from glws.hpp with 100% similarity]
retrace/glws_cocoa.mm [moved from glws_cocoa.mm with 100% similarity]
retrace/glws_egl_xlib.cpp [moved from glws_egl_xlib.cpp with 100% similarity]
retrace/glws_glx.cpp [moved from glws_glx.cpp with 100% similarity]
retrace/glws_wgl.cpp [moved from glws_wgl.cpp with 100% similarity]
retrace/retrace.cpp [moved from retrace.cpp with 100% similarity]
retrace/retrace.hpp [moved from retrace.hpp with 100% similarity]
retrace/retrace.py [moved from retrace.py with 99% similarity]
retrace/retrace_stdc.cpp [moved from retrace_stdc.cpp with 100% similarity]

index 25f71f6..93f029e 100644 (file)
@@ -34,8 +34,6 @@ dxsdk
 eglretrace
 glproc.hpp
 glretrace
-glretrace_gl.cpp
-glstate_params.cpp
 install_manifest.txt
 qapitrace
 traces
index 855d73f..1d5c99f 100644 (file)
@@ -304,146 +304,8 @@ add_subdirectory (wrappers)
 ##############################################################################
 # API retracers
 
-add_custom_command (
-    OUTPUT glretrace_gl.cpp
-    COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/glretrace.py > ${CMAKE_CURRENT_BINARY_DIR}/glretrace_gl.cpp
-    DEPENDS glretrace.py retrace.py specs/glapi.py specs/gltypes.py specs/stdapi.py
-)
-
-add_custom_command (
-    OUTPUT glstate_params.cpp
-    COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/glstate_params.py > ${CMAKE_CURRENT_BINARY_DIR}/glstate_params.cpp
-    DEPENDS glstate_params.py specs/glparams.py specs/gltypes.py specs/stdapi.py
-)
-
-add_library (retrace_common
-    glretrace_gl.cpp
-    glretrace_cgl.cpp
-    glretrace_glx.cpp
-    glretrace_wgl.cpp
-    glretrace_egl.cpp
-    glretrace_main.cpp
-    glstate.cpp
-    glstate_images.cpp
-    glstate_params.cpp
-    glstate_shaders.cpp
-    retrace.cpp
-    retrace_stdc.cpp
-    glws.cpp
-)
-
-add_dependencies (retrace_common glproc)
-
-set_property (
-    TARGET retrace_common
-    APPEND
-    PROPERTY COMPILE_DEFINITIONS "RETRACE"
-)
-
-if (WIN32 OR APPLE OR X11_FOUND)
-    add_executable (glretrace
-        ${glws_os}
-        glproc_gl.cpp
-    )
-
-    add_dependencies (glretrace glproc)
-
-    set_property (
-        TARGET glretrace
-        APPEND
-        PROPERTY COMPILE_DEFINITIONS "RETRACE"
-    )
-
-    target_link_libraries (glretrace
-        retrace_common
-        common
-        ${PNG_LIBRARIES}
-        ${ZLIB_LIBRARIES}
-        ${SNAPPY_LIBRARIES}
-    )
+add_subdirectory (retrace)
 
-    if (WIN32)
-    else ()
-        if (APPLE)
-            target_link_libraries (glretrace
-                "-framework Cocoa"
-                "-framework ApplicationServices" # CGS*
-                #"-framework OpenGL" # CGL*
-            )
-        else ()
-            target_link_libraries (glretrace ${X11_X11_LIB})
-        endif ()
-
-        target_link_libraries (glretrace
-            # 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
-            ${CMAKE_THREAD_LIBS_INIT}
-            dl
-        )
-
-        if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
-            target_link_libraries (glretrace rt)
-        endif ()
-
-    endif ()
-
-    install (TARGETS glretrace RUNTIME DESTINATION bin) 
-endif ()
-
-if (ENABLE_EGL AND X11_FOUND AND NOT WIN32 AND NOT APPLE)
-    add_executable (eglretrace
-        glws_egl_xlib.cpp
-        glproc_egl.cpp
-    )
-
-    add_dependencies (eglretrace glproc)
-
-    set_property (
-        TARGET eglretrace
-        APPEND
-        PROPERTY COMPILE_DEFINITIONS "RETRACE"
-    )
-
-    target_link_libraries (eglretrace
-        retrace_common
-        common
-        ${PNG_LIBRARIES}
-        ${ZLIB_LIBRARIES}
-        ${SNAPPY_LIBRARIES}
-        ${X11_X11_LIB}
-        ${CMAKE_THREAD_LIBS_INIT}
-        dl
-    )
-
-    if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
-        target_link_libraries (eglretrace rt)
-    endif ()
-
-    install (TARGETS eglretrace RUNTIME DESTINATION bin) 
-endif ()
-
-if (WIN32 AND DirectX_D3DX9_FOUND)
-    add_custom_command (
-        OUTPUT d3dretrace_d3d9.cpp
-        COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/d3dretrace.py > ${CMAKE_CURRENT_BINARY_DIR}/d3dretrace_d3d9.cpp
-        DEPENDS d3dretrace.py retrace.py specs/d3d9.py specs/d3d9types.py specs/d3d9caps.py specs/winapi.py specs/stdapi.py
-    )
-
-    include_directories (SYSTEM ${DirectX_D3DX9_INCLUDE_DIR})
-    add_executable (d3dretrace
-        retrace.cpp
-        retrace_stdc.cpp
-        d3dretrace_main.cpp
-        d3dretrace_d3d9.cpp
-    )
-    target_link_libraries (d3dretrace
-        common
-        ${ZLIB_LIBRARIES}
-        ${SNAPPY_LIBRARIES}
-        ${DirectX_D3D9_LIBRARY}
-    )
-endif ()
 
 ##############################################################################
 # CLI
diff --git a/retrace/.gitignore b/retrace/.gitignore
new file mode 100644 (file)
index 0000000..ebcad87
--- /dev/null
@@ -0,0 +1,2 @@
+glretrace_gl.cpp
+glstate_params.cpp
diff --git a/retrace/CMakeLists.txt b/retrace/CMakeLists.txt
new file mode 100644 (file)
index 0000000..c45b33f
--- /dev/null
@@ -0,0 +1,146 @@
+##############################################################################
+# API retracers
+
+include_directories (${CMAKE_CURRENT_SOURCE_DIR})
+
+add_definitions (-DRETRACE)
+
+add_custom_command (
+    OUTPUT glretrace_gl.cpp
+    COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/glretrace.py > ${CMAKE_CURRENT_BINARY_DIR}/glretrace_gl.cpp
+    DEPENDS
+                glretrace.py
+                retrace.py
+                ${CMAKE_SOURCE_DIR}/specs/glapi.py
+                ${CMAKE_SOURCE_DIR}/specs/gltypes.py
+                ${CMAKE_SOURCE_DIR}/specs/stdapi.py
+)
+
+add_custom_command (
+    OUTPUT glstate_params.cpp
+    COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/glstate_params.py > ${CMAKE_CURRENT_BINARY_DIR}/glstate_params.cpp
+    DEPENDS
+                glstate_params.py
+                ${CMAKE_SOURCE_DIR}/specs/glparams.py
+                ${CMAKE_SOURCE_DIR}/specs/gltypes.py
+                ${CMAKE_SOURCE_DIR}/specs/stdapi.py
+)
+
+add_library (retrace_common
+    glretrace_gl.cpp
+    glretrace_cgl.cpp
+    glretrace_glx.cpp
+    glretrace_wgl.cpp
+    glretrace_egl.cpp
+    glretrace_main.cpp
+    glstate.cpp
+    glstate_images.cpp
+    glstate_params.cpp
+    glstate_shaders.cpp
+    retrace.cpp
+    retrace_stdc.cpp
+    glws.cpp
+)
+
+add_dependencies (retrace_common glproc)
+
+if (WIN32 OR APPLE OR X11_FOUND)
+    add_executable (glretrace
+        ${glws_os}
+        ${CMAKE_SOURCE_DIR}/glproc_gl.cpp
+    )
+
+    add_dependencies (glretrace glproc)
+
+    target_link_libraries (glretrace
+        retrace_common
+        common
+        ${PNG_LIBRARIES}
+        ${ZLIB_LIBRARIES}
+        ${SNAPPY_LIBRARIES}
+    )
+
+    if (WIN32)
+    else ()
+        if (APPLE)
+            target_link_libraries (glretrace
+                "-framework Cocoa"
+                "-framework ApplicationServices" # CGS*
+                #"-framework OpenGL" # CGL*
+            )
+        else ()
+            target_link_libraries (glretrace ${X11_X11_LIB})
+        endif ()
+
+        target_link_libraries (glretrace
+            # 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
+            ${CMAKE_THREAD_LIBS_INIT}
+            dl
+        )
+
+        if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+            target_link_libraries (glretrace rt)
+        endif ()
+
+    endif ()
+
+    install (TARGETS glretrace RUNTIME DESTINATION bin) 
+endif ()
+
+if (ENABLE_EGL AND X11_FOUND AND NOT WIN32 AND NOT APPLE)
+    add_executable (eglretrace
+        glws_egl_xlib.cpp
+        ${CMAKE_SOURCE_DIR}/glproc_egl.cpp
+    )
+
+    add_dependencies (eglretrace glproc)
+
+    target_link_libraries (eglretrace
+        retrace_common
+        common
+        ${PNG_LIBRARIES}
+        ${ZLIB_LIBRARIES}
+        ${SNAPPY_LIBRARIES}
+        ${X11_X11_LIB}
+        ${CMAKE_THREAD_LIBS_INIT}
+        dl
+    )
+
+    if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+        target_link_libraries (eglretrace rt)
+    endif ()
+
+    install (TARGETS eglretrace RUNTIME DESTINATION bin) 
+endif ()
+
+if (WIN32 AND DirectX_D3DX9_FOUND)
+    add_custom_command (
+        OUTPUT d3dretrace_d3d9.cpp
+        COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/d3dretrace.py > ${CMAKE_CURRENT_BINARY_DIR}/d3dretrace_d3d9.cpp
+        DEPENDS
+                d3dretrace.py
+                retrace.py
+                ${CMAKE_SOURCE_DIR}/specs/d3d9.py
+                ${CMAKE_SOURCE_DIR}/specs/d3d9types.py
+                ${CMAKE_SOURCE_DIR}/specs/d3d9caps.py
+                ${CMAKE_SOURCE_DIR}/specs/winapi.py
+                ${CMAKE_SOURCE_DIR}/specs/stdapi.py
+    )
+
+    include_directories (SYSTEM ${DirectX_D3DX9_INCLUDE_DIR})
+    add_executable (d3dretrace
+        retrace.cpp
+        retrace_stdc.cpp
+        d3dretrace_main.cpp
+        d3dretrace_d3d9.cpp
+    )
+    target_link_libraries (d3dretrace
+        common
+        ${ZLIB_LIBRARIES}
+        ${SNAPPY_LIBRARIES}
+        ${DirectX_D3D9_LIBRARY}
+    )
+endif ()
+
similarity index 100%
rename from d3dretrace.hpp
rename to retrace/d3dretrace.hpp
similarity index 100%
rename from d3dretrace.py
rename to retrace/d3dretrace.py
index a2ea75e..f472a0a 100644 (file)
@@ -27,9 +27,9 @@
 """GL retracer generator."""
 
 
+from retrace import Retracer
 import specs.stdapi as stdapi
 from specs.d3d9 import d3d9
-from retrace import Retracer
 
 
 class D3DRetracer(Retracer):
similarity index 100%
rename from glretrace.hpp
rename to retrace/glretrace.hpp
similarity index 100%
rename from glretrace.py
rename to retrace/glretrace.py
index d91c8a2..21fc499 100644 (file)
 """GL retracer generator."""
 
 
+from retrace import Retracer
 import specs.stdapi as stdapi
 import specs.glapi as glapi
 import specs.glesapi as glesapi
-from retrace import Retracer
 
 
 class GlRetracer(Retracer):
similarity index 100%
rename from glretrace_cgl.cpp
rename to retrace/glretrace_cgl.cpp
similarity index 100%
rename from glretrace_egl.cpp
rename to retrace/glretrace_egl.cpp
similarity index 100%
rename from glretrace_glx.cpp
rename to retrace/glretrace_glx.cpp
similarity index 100%
rename from glretrace_wgl.cpp
rename to retrace/glretrace_wgl.cpp
similarity index 100%
rename from glstate.cpp
rename to retrace/glstate.cpp
similarity index 100%
rename from glstate.hpp
rename to retrace/glstate.hpp
similarity index 99%
rename from glstate_params.py
rename to retrace/glstate_params.py
index 7c29932..e1f90d0 100644 (file)
@@ -27,6 +27,8 @@
 '''Generate code to dump most GL state into JSON.'''
 
 
+import retrace # to adjust sys.path
+
 from specs.stdapi import *
 
 from specs.gltypes import *
similarity index 100%
rename from glws.cpp
rename to retrace/glws.cpp
similarity index 100%
rename from glws.hpp
rename to retrace/glws.hpp
similarity index 100%
rename from glws_cocoa.mm
rename to retrace/glws_cocoa.mm
similarity index 100%
rename from glws_egl_xlib.cpp
rename to retrace/glws_egl_xlib.cpp
similarity index 100%
rename from glws_glx.cpp
rename to retrace/glws_glx.cpp
similarity index 100%
rename from glws_wgl.cpp
rename to retrace/glws_wgl.cpp
similarity index 100%
rename from retrace.cpp
rename to retrace/retrace.cpp
similarity index 100%
rename from retrace.hpp
rename to retrace/retrace.hpp
similarity index 99%
rename from retrace.py
rename to retrace/retrace.py
index 9e9af20..369c13b 100644 (file)
 """Generic retracing code generator."""
 
 
+# Adjust path
+import os.path
 import sys
+sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
+
 
 import specs.stdapi as stdapi
 import specs.glapi as glapi
similarity index 100%
rename from retrace_stdc.cpp
rename to retrace/retrace_stdc.cpp