1 ##############################################################################
6 ${CMAKE_CURRENT_SOURCE_DIR}
7 ${CMAKE_SOURCE_DIR}/helpers
8 ${CMAKE_BINARY_DIR}/dispatch
9 ${CMAKE_SOURCE_DIR}/dispatch
12 add_library (common_trace STATIC
16 set_target_properties (common_trace PROPERTIES
17 # Ensure it can be statically linked in shared libraries
18 COMPILE_FLAGS "${CMAKE_SHARED_LIBRARY_CXX_FLAGS}"
23 # Silence warnings about @nn suffix mismatch
24 set (CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,--enable-stdcall-fixup")
28 if (DirectX_D3D_INCLUDE_DIR)
29 include_directories (SYSTEM ${DirectX_D3D_INCLUDE_DIR})
32 COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/ddrawtrace.py > ${CMAKE_CURRENT_BINARY_DIR}/ddrawtrace.cpp
37 ${CMAKE_SOURCE_DIR}/dispatch/dispatch.py
38 ${CMAKE_SOURCE_DIR}/specs/d3d.py
39 ${CMAKE_SOURCE_DIR}/specs/d3dtypes.py
40 ${CMAKE_SOURCE_DIR}/specs/d3dcaps.py
41 ${CMAKE_SOURCE_DIR}/specs/ddraw.py
42 ${CMAKE_SOURCE_DIR}/specs/winapi.py
43 ${CMAKE_SOURCE_DIR}/specs/stdapi.py
45 add_library (ddrawtrace MODULE ddraw.def ddrawtrace.cpp)
46 target_link_libraries (ddrawtrace
52 set_target_properties (ddrawtrace PROPERTIES
56 install (TARGETS ddrawtrace LIBRARY DESTINATION ${WRAPPER_INSTALL_DIR})
60 if (DirectX_D3D8_INCLUDE_DIR AND DirectX_D3DX9_INCLUDE_DIR)
61 include_directories (SYSTEM ${DirectX_D3D8_INCLUDE_DIR} ${DirectX_D3DX9_INCLUDE_DIR})
64 COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/d3d8trace.py > ${CMAKE_CURRENT_BINARY_DIR}/d3d8trace.cpp
69 ${CMAKE_SOURCE_DIR}/dispatch/dispatch.py
70 ${CMAKE_SOURCE_DIR}/specs/d3d8.py
71 ${CMAKE_SOURCE_DIR}/specs/d3d8types.py
72 ${CMAKE_SOURCE_DIR}/specs/d3d8caps.py
73 ${CMAKE_SOURCE_DIR}/specs/winapi.py
74 ${CMAKE_SOURCE_DIR}/specs/stdapi.py
76 add_library (d3d8trace MODULE d3d8.def d3d8trace.cpp d3d9shader.cpp)
77 target_link_libraries (d3d8trace
83 set_target_properties (d3d8trace PROPERTIES
87 install (TARGETS d3d8trace LIBRARY DESTINATION ${WRAPPER_INSTALL_DIR})
91 if (DirectX_D3DX9_INCLUDE_DIR)
92 include_directories (SYSTEM ${DirectX_D3DX9_INCLUDE_DIR})
95 COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/d3d9trace.py > ${CMAKE_CURRENT_BINARY_DIR}/d3d9trace.cpp
100 ${CMAKE_SOURCE_DIR}/dispatch/dispatch.py
101 ${CMAKE_SOURCE_DIR}/specs/d3d9.py
102 ${CMAKE_SOURCE_DIR}/specs/d3d9types.py
103 ${CMAKE_SOURCE_DIR}/specs/d3d9caps.py
104 ${CMAKE_SOURCE_DIR}/specs/d3d9dxva2.py
105 ${CMAKE_SOURCE_DIR}/specs/winapi.py
106 ${CMAKE_SOURCE_DIR}/specs/stdapi.py
108 add_library (d3d9trace MODULE d3d9.def d3d9trace.cpp d3d9shader.cpp)
109 target_link_libraries (d3d9trace
115 set_target_properties (d3d9trace PROPERTIES
119 install (TARGETS d3d9trace LIBRARY DESTINATION ${WRAPPER_INSTALL_DIR})
123 if (DirectX_D3D10_INCLUDE_DIR)
124 include_directories (SYSTEM ${DirectX_D3D10_INCLUDE_DIR})
126 OUTPUT d3d10trace.cpp
127 COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/d3d10trace.py > ${CMAKE_CURRENT_BINARY_DIR}/d3d10trace.cpp
133 ${CMAKE_SOURCE_DIR}/dispatch/dispatch.py
134 ${CMAKE_SOURCE_DIR}/specs/d3d10.py
135 ${CMAKE_SOURCE_DIR}/specs/d3d10misc.py
136 ${CMAKE_SOURCE_DIR}/specs/d3d10sdklayers.py
137 ${CMAKE_SOURCE_DIR}/specs/d3d10shader.py
138 ${CMAKE_SOURCE_DIR}/specs/d3d10effect.py
139 ${CMAKE_SOURCE_DIR}/specs/d3dcommon.py
140 ${CMAKE_SOURCE_DIR}/specs/dxgi.py
141 ${CMAKE_SOURCE_DIR}/specs/dxgitype.py
142 ${CMAKE_SOURCE_DIR}/specs/dxgiformat.py
143 ${CMAKE_SOURCE_DIR}/specs/winapi.py
144 ${CMAKE_SOURCE_DIR}/specs/stdapi.py
146 add_library (d3d10trace MODULE
151 target_link_libraries (d3d10trace
157 set_target_properties (d3d10trace PROPERTIES
161 install (TARGETS d3d10trace LIBRARY DESTINATION ${WRAPPER_INSTALL_DIR})
165 if (DirectX_D3D10_1_INCLUDE_DIR)
166 include_directories (SYSTEM ${DirectX_D3D10_1_INCLUDE_DIR})
168 OUTPUT d3d10_1trace.cpp
169 COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/d3d10_1trace.py > ${CMAKE_CURRENT_BINARY_DIR}/d3d10_1trace.cpp
175 ${CMAKE_SOURCE_DIR}/dispatch/dispatch.py
176 ${CMAKE_SOURCE_DIR}/specs/d3d10_1.py
177 ${CMAKE_SOURCE_DIR}/specs/d3d10.py
178 ${CMAKE_SOURCE_DIR}/specs/d3d10sdklayers.py
179 ${CMAKE_SOURCE_DIR}/specs/d3dcommon.py
180 ${CMAKE_SOURCE_DIR}/specs/dxgi.py
181 ${CMAKE_SOURCE_DIR}/specs/dxgitype.py
182 ${CMAKE_SOURCE_DIR}/specs/dxgiformat.py
183 ${CMAKE_SOURCE_DIR}/specs/winapi.py
184 ${CMAKE_SOURCE_DIR}/specs/stdapi.py
186 add_library (d3d10_1trace MODULE
191 target_link_libraries (d3d10_1trace
197 set_target_properties (d3d10_1trace
201 install (TARGETS d3d10_1trace LIBRARY DESTINATION ${WRAPPER_INSTALL_DIR})
205 if (DirectX_D3D11_INCLUDE_DIR)
206 if (DirectX_D3D11_1_INCLUDE_DIR)
212 include_directories (SYSTEM ${DirectX_D3D11_INCLUDE_DIR})
214 OUTPUT d3d11trace.cpp
215 COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/d3d11trace.py ${HAVE_D3D11_1} > ${CMAKE_CURRENT_BINARY_DIR}/d3d11trace.cpp
221 ${CMAKE_SOURCE_DIR}/specs/d3d11_1.py
222 ${CMAKE_SOURCE_DIR}/specs/d3d11.py
223 ${CMAKE_SOURCE_DIR}/specs/d3d11sdklayers.py
224 ${CMAKE_SOURCE_DIR}/specs/d3dcommon.py
225 ${CMAKE_SOURCE_DIR}/specs/dxgi.py
226 ${CMAKE_SOURCE_DIR}/specs/dxgitype.py
227 ${CMAKE_SOURCE_DIR}/specs/dxgiformat.py
228 ${CMAKE_SOURCE_DIR}/specs/winapi.py
229 ${CMAKE_SOURCE_DIR}/specs/stdapi.py
231 add_library (d3d11trace MODULE
236 target_link_libraries (d3d11trace
242 set_target_properties (d3d11trace
246 install (TARGETS d3d11trace LIBRARY DESTINATION ${WRAPPER_INSTALL_DIR})
249 # d2d1.dll, dwrite.dll
250 if (DirectX_D2D1_INCLUDE_DIR)
251 include_directories (SYSTEM ${DirectX_D2D1_INCLUDE_DIR})
255 COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/d2d1trace.py > ${CMAKE_CURRENT_BINARY_DIR}/d2d1trace.cpp
259 ${CMAKE_SOURCE_DIR}/specs/d2d1.py
260 ${CMAKE_SOURCE_DIR}/specs/d2d1.py
261 ${CMAKE_SOURCE_DIR}/specs/d2dbasetypes.py
262 ${CMAKE_SOURCE_DIR}/specs/d2derr.py
263 ${CMAKE_SOURCE_DIR}/specs/dwrite.py
264 ${CMAKE_SOURCE_DIR}/specs/dcommon.py
265 ${CMAKE_SOURCE_DIR}/specs/dxgi.py
266 ${CMAKE_SOURCE_DIR}/specs/dxgitype.py
267 ${CMAKE_SOURCE_DIR}/specs/dxgiformat.py
268 ${CMAKE_SOURCE_DIR}/specs/winapi.py
269 ${CMAKE_SOURCE_DIR}/specs/stdapi.py
271 add_library (d2d1 MODULE d2d1.def d2d1trace.cpp)
272 target_link_libraries (d2d1
278 set_target_properties (d2d1
282 install (TARGETS d2d1 LIBRARY DESTINATION ${WRAPPER_INSTALL_DIR})
285 OUTPUT dwritetrace.cpp
286 COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/dwritetrace.py > ${CMAKE_CURRENT_BINARY_DIR}/dwritetrace.cpp
290 ${CMAKE_SOURCE_DIR}/specs/d2d1.py
291 ${CMAKE_SOURCE_DIR}/specs/d2d1.py
292 ${CMAKE_SOURCE_DIR}/specs/d2dbasetypes.py
293 ${CMAKE_SOURCE_DIR}/specs/d2derr.py
294 ${CMAKE_SOURCE_DIR}/specs/dwrite.py
295 ${CMAKE_SOURCE_DIR}/specs/dcommon.py
296 ${CMAKE_SOURCE_DIR}/specs/dxgi.py
297 ${CMAKE_SOURCE_DIR}/specs/dxgitype.py
298 ${CMAKE_SOURCE_DIR}/specs/dxgiformat.py
299 ${CMAKE_SOURCE_DIR}/specs/winapi.py
300 ${CMAKE_SOURCE_DIR}/specs/stdapi.py
302 add_library (dwrite MODULE dwrite.def dwritetrace.cpp)
303 target_link_libraries (dwrite
309 set_target_properties (dwrite
313 install (TARGETS dwrite LIBRARY DESTINATION ${WRAPPER_INSTALL_DIR})
314 endif (DirectX_D2D1_INCLUDE_DIR)
319 COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/wgltrace.py > ${CMAKE_CURRENT_BINARY_DIR}/wgltrace.cpp
324 ${CMAKE_SOURCE_DIR}/dispatch/dispatch.py
325 ${CMAKE_SOURCE_DIR}/specs/wglapi.py
326 ${CMAKE_SOURCE_DIR}/specs/wglenum.py
327 ${CMAKE_SOURCE_DIR}/specs/glapi.py
328 ${CMAKE_SOURCE_DIR}/specs/glparams.py
329 ${CMAKE_SOURCE_DIR}/specs/gltypes.py
330 ${CMAKE_SOURCE_DIR}/specs/winapi.py
331 ${CMAKE_SOURCE_DIR}/specs/stdapi.py
333 add_library (wgltrace MODULE opengl32.def
338 add_dependencies (wgltrace glproc)
339 target_link_libraries (wgltrace
346 set_target_properties (wgltrace PROPERTIES
350 install (TARGETS wgltrace LIBRARY DESTINATION ${WRAPPER_INSTALL_DIR})
356 COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/cgltrace.py > ${CMAKE_CURRENT_BINARY_DIR}/cgltrace.cpp
361 ${CMAKE_SOURCE_DIR}/specs/cglapi.py
362 ${CMAKE_SOURCE_DIR}/specs/glapi.py
363 ${CMAKE_SOURCE_DIR}/specs/glparams.py
364 ${CMAKE_SOURCE_DIR}/specs/gltypes.py
365 ${CMAKE_SOURCE_DIR}/specs/stdapi.py
368 add_library (cgltrace SHARED
374 add_dependencies (cgltrace glproc)
376 set_target_properties (cgltrace PROPERTIES
377 # OpenGL framework name
378 PREFIX "" OUTPUT_NAME "OpenGL" SUFFIX ""
379 # Specificy the version and reexport GLU symbols
380 LINK_FLAGS "-compatibility_version 1 -current_version 1.0.0 -Wl,-reexport_library,/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGLU.dylib"
383 target_link_libraries (cgltrace
389 ${CMAKE_THREAD_LIBS_INIT}
393 install (TARGETS cgltrace LIBRARY DESTINATION ${WRAPPER_INSTALL_DIR})
398 COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/glxtrace.py > ${CMAKE_CURRENT_BINARY_DIR}/glxtrace.cpp
403 ${CMAKE_SOURCE_DIR}/specs/glxapi.py
404 ${CMAKE_SOURCE_DIR}/specs/glapi.py
405 ${CMAKE_SOURCE_DIR}/specs/glparams.py
406 ${CMAKE_SOURCE_DIR}/specs/gltypes.py
407 ${CMAKE_SOURCE_DIR}/specs/stdapi.py
410 add_library (glxtrace SHARED
416 add_dependencies (glxtrace glproc)
418 set_target_properties (glxtrace PROPERTIES
419 # avoid the default "lib" prefix
421 # Prevent symbol relocations internal to our wrapper library to be
422 # overwritten by the application.
423 LINK_FLAGS "-Wl,-Bsymbolic -Wl,-Bsymbolic-functions"
426 target_link_libraries (glxtrace
432 ${CMAKE_THREAD_LIBS_INIT}
436 install (TARGETS glxtrace LIBRARY DESTINATION ${WRAPPER_INSTALL_DIR})
440 if (ENABLE_EGL AND NOT WIN32 AND NOT APPLE)
444 COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/egltrace.py > ${CMAKE_CURRENT_BINARY_DIR}/egltrace.cpp
449 ${CMAKE_SOURCE_DIR}/specs/eglapi.py
450 ${CMAKE_SOURCE_DIR}/specs/glesapi.py
451 ${CMAKE_SOURCE_DIR}/specs/glapi.py
452 ${CMAKE_SOURCE_DIR}/specs/glparams.py
453 ${CMAKE_SOURCE_DIR}/specs/gltypes.py
454 ${CMAKE_SOURCE_DIR}/specs/stdapi.py
457 add_library (egltrace SHARED
461 ${CMAKE_SOURCE_DIR}/helpers/eglsize.cpp
464 add_dependencies (egltrace glproc)
466 set_target_properties (egltrace PROPERTIES
467 # avoid the default "lib" prefix
469 # Prevent symbol relocations internal to our wrapper library to be
470 # overwritten by the application.
471 LINK_FLAGS "-Wl,-Bsymbolic -Wl,-Bsymbolic-functions"
474 target_link_libraries (egltrace
480 ${CMAKE_THREAD_LIBS_INIT}
484 install (TARGETS egltrace LIBRARY DESTINATION ${WRAPPER_INSTALL_DIR})