1 ##############################################################################
5 ${CMAKE_CURRENT_SOURCE_DIR}
6 ${CMAKE_SOURCE_DIR}/helpers
7 ${CMAKE_BINARY_DIR}/dispatch
8 ${CMAKE_SOURCE_DIR}/dispatch
11 add_definitions (-DRETRACE)
14 OUTPUT glretrace_gl.cpp
15 COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/glretrace.py > ${CMAKE_CURRENT_BINARY_DIR}/glretrace_gl.cpp
19 ${CMAKE_SOURCE_DIR}/specs/glapi.py
20 ${CMAKE_SOURCE_DIR}/specs/gltypes.py
21 ${CMAKE_SOURCE_DIR}/specs/stdapi.py
25 OUTPUT glstate_params.cpp
26 COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/glstate_params.py > ${CMAKE_CURRENT_BINARY_DIR}/glstate_params.cpp
29 ${CMAKE_SOURCE_DIR}/specs/glparams.py
30 ${CMAKE_SOURCE_DIR}/specs/gltypes.py
31 ${CMAKE_SOURCE_DIR}/specs/stdapi.py
34 add_library (retrace_common
41 target_link_libraries (retrace_common
48 add_library (glretrace_common
63 add_dependencies (glretrace_common glproc)
66 if (WIN32 OR APPLE OR X11_FOUND)
67 add_executable (glretrace
71 add_dependencies (glretrace glproc)
73 target_link_libraries (glretrace
82 target_link_libraries (glretrace
84 "-framework ApplicationServices" # CGS*
85 #"-framework OpenGL" # CGL*
88 target_link_libraries (glretrace ${X11_X11_LIB})
91 target_link_libraries (glretrace
92 # gdb doesn't like when pthreads is loaded through dlopen (which happens
93 # when dlopen'ing libGL), so link pthreads to avoid this issue. See also
94 # http://stackoverflow.com/questions/2702628/gdb-cannot-find-new-threads-generic-error
95 ${CMAKE_THREAD_LIBS_INIT}
99 if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
100 target_link_libraries (glretrace rt)
105 install (TARGETS glretrace RUNTIME DESTINATION bin)
108 if (ENABLE_EGL AND X11_FOUND AND NOT WIN32 AND NOT APPLE)
109 add_executable (eglretrace
113 add_dependencies (eglretrace glproc)
115 target_link_libraries (eglretrace
120 ${CMAKE_THREAD_LIBS_INIT}
124 if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
125 target_link_libraries (eglretrace rt)
128 install (TARGETS eglretrace RUNTIME DESTINATION bin)
131 if (WIN32 AND DirectX_D3DX9_INCLUDE_DIR)
133 OUTPUT d3dretrace_d3d9.cpp
134 COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/d3d9retrace.py > ${CMAKE_CURRENT_BINARY_DIR}/d3dretrace_d3d9.cpp
139 ${CMAKE_SOURCE_DIR}/dispatch/dispatch.py
140 ${CMAKE_SOURCE_DIR}/specs/d3d9.py
141 ${CMAKE_SOURCE_DIR}/specs/d3d9types.py
142 ${CMAKE_SOURCE_DIR}/specs/d3d9caps.py
143 ${CMAKE_SOURCE_DIR}/specs/winapi.py
144 ${CMAKE_SOURCE_DIR}/specs/stdapi.py
147 include_directories (SYSTEM ${DirectX_D3DX9_INCLUDE_DIR})
148 add_executable (d3dretrace
155 target_link_libraries (d3dretrace
159 install (TARGETS d3dretrace RUNTIME DESTINATION bin)
162 if (WIN32 AND DirectX_D3D10_INCLUDE_DIR)
164 OUTPUT d3dretrace_d3d10.cpp
165 COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/d3d10retrace.py > ${CMAKE_CURRENT_BINARY_DIR}/d3dretrace_d3d10.cpp
171 ${CMAKE_SOURCE_DIR}/dispatch/dispatch.py
172 ${CMAKE_SOURCE_DIR}/specs/d3d10.py
173 ${CMAKE_SOURCE_DIR}/specs/d3d10misc.py
174 ${CMAKE_SOURCE_DIR}/specs/d3d10sdklayers.py
175 ${CMAKE_SOURCE_DIR}/specs/d3d10shader.py
176 ${CMAKE_SOURCE_DIR}/specs/d3d10effect.py
177 ${CMAKE_SOURCE_DIR}/specs/d3dcommon.py
178 ${CMAKE_SOURCE_DIR}/specs/dxgi.py
179 ${CMAKE_SOURCE_DIR}/specs/dxgitype.py
180 ${CMAKE_SOURCE_DIR}/specs/dxgiformat.py
181 ${CMAKE_SOURCE_DIR}/specs/winapi.py
182 ${CMAKE_SOURCE_DIR}/specs/stdapi.py
185 include_directories (SYSTEM ${DirectX_D3D10_INCLUDE_DIR})
186 add_executable (d3d10retrace
191 target_link_libraries (d3d10retrace
195 install (TARGETS d3d10retrace RUNTIME DESTINATION bin)
198 if (WIN32 AND DirectX_D3D10_1_INCLUDE_DIR)
200 OUTPUT d3dretrace_d3d10_1.cpp
201 COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/d3d10_1retrace.py > ${CMAKE_CURRENT_BINARY_DIR}/d3dretrace_d3d10_1.cpp
207 ${CMAKE_SOURCE_DIR}/dispatch/dispatch.py
208 ${CMAKE_SOURCE_DIR}/specs/d3d10_1.py
209 ${CMAKE_SOURCE_DIR}/specs/d3d10.py
210 ${CMAKE_SOURCE_DIR}/specs/d3d10sdklayers.py
211 ${CMAKE_SOURCE_DIR}/specs/d3dcommon.py
212 ${CMAKE_SOURCE_DIR}/specs/dxgi.py
213 ${CMAKE_SOURCE_DIR}/specs/dxgitype.py
214 ${CMAKE_SOURCE_DIR}/specs/dxgiformat.py
215 ${CMAKE_SOURCE_DIR}/specs/winapi.py
216 ${CMAKE_SOURCE_DIR}/specs/stdapi.py
219 include_directories (SYSTEM ${DirectX_D3D10_1_INCLUDE_DIR})
220 add_executable (d3d10_1retrace
222 d3dretrace_d3d10_1.cpp
225 target_link_libraries (d3d10_1retrace
229 install (TARGETS d3d10_1retrace RUNTIME DESTINATION bin)
232 if (WIN32 AND DirectX_D3D11_INCLUDE_DIR)
234 OUTPUT d3dretrace_d3d11.cpp
235 COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/d3d11retrace.py > ${CMAKE_CURRENT_BINARY_DIR}/d3dretrace_d3d11.cpp
241 ${CMAKE_SOURCE_DIR}/dispatch/dispatch.py
242 ${CMAKE_SOURCE_DIR}/specs/d3d11_1.py
243 ${CMAKE_SOURCE_DIR}/specs/d3d11.py
244 ${CMAKE_SOURCE_DIR}/specs/d3d11sdklayers.py
245 ${CMAKE_SOURCE_DIR}/specs/d3dcommon.py
246 ${CMAKE_SOURCE_DIR}/specs/dxgi.py
247 ${CMAKE_SOURCE_DIR}/specs/dxgitype.py
248 ${CMAKE_SOURCE_DIR}/specs/dxgiformat.py
249 ${CMAKE_SOURCE_DIR}/specs/winapi.py
250 ${CMAKE_SOURCE_DIR}/specs/stdapi.py
253 include_directories (SYSTEM ${DirectX_D3D11_INCLUDE_DIR})
254 add_executable (d3d11retrace
259 target_link_libraries (d3d11retrace
263 install (TARGETS d3d11retrace RUNTIME DESTINATION bin)