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}"
21 set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
25 # Silence warnings about @nn suffix mismatch
26 set (CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,--enable-stdcall-fixup")
30 if (DirectX_D3D_INCLUDE_DIR)
31 include_directories (SYSTEM ${DirectX_D3D_INCLUDE_DIR})
34 COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/ddrawtrace.py > ${CMAKE_CURRENT_BINARY_DIR}/ddrawtrace.cpp
39 ${CMAKE_SOURCE_DIR}/dispatch/dispatch.py
40 ${CMAKE_SOURCE_DIR}/specs/d3d.py
41 ${CMAKE_SOURCE_DIR}/specs/d3dtypes.py
42 ${CMAKE_SOURCE_DIR}/specs/d3dcaps.py
43 ${CMAKE_SOURCE_DIR}/specs/ddraw.py
44 ${CMAKE_SOURCE_DIR}/specs/winapi.py
45 ${CMAKE_SOURCE_DIR}/specs/stdapi.py
47 add_library (ddrawtrace MODULE ddraw.def ddrawtrace.cpp)
48 target_link_libraries (ddrawtrace
54 set_target_properties (ddrawtrace PROPERTIES
58 install (TARGETS ddrawtrace LIBRARY DESTINATION ${WRAPPER_INSTALL_DIR})
62 if (DirectX_D3D8_INCLUDE_DIR AND DirectX_D3DX9_INCLUDE_DIR)
63 include_directories (SYSTEM ${DirectX_D3D8_INCLUDE_DIR} ${DirectX_D3DX9_INCLUDE_DIR})
66 COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/d3d8trace.py > ${CMAKE_CURRENT_BINARY_DIR}/d3d8trace.cpp
71 ${CMAKE_SOURCE_DIR}/dispatch/dispatch.py
72 ${CMAKE_SOURCE_DIR}/specs/d3d8.py
73 ${CMAKE_SOURCE_DIR}/specs/d3d8types.py
74 ${CMAKE_SOURCE_DIR}/specs/d3d8caps.py
75 ${CMAKE_SOURCE_DIR}/specs/winapi.py
76 ${CMAKE_SOURCE_DIR}/specs/stdapi.py
78 add_library (d3d8trace MODULE d3d8.def d3d8trace.cpp d3d9shader.cpp)
79 target_link_libraries (d3d8trace
85 set_target_properties (d3d8trace PROPERTIES
89 install (TARGETS d3d8trace LIBRARY DESTINATION ${WRAPPER_INSTALL_DIR})
93 if (DirectX_D3DX9_INCLUDE_DIR)
94 include_directories (SYSTEM ${DirectX_D3DX9_INCLUDE_DIR})
97 COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/d3d9trace.py > ${CMAKE_CURRENT_BINARY_DIR}/d3d9trace.cpp
102 ${CMAKE_SOURCE_DIR}/dispatch/dispatch.py
103 ${CMAKE_SOURCE_DIR}/specs/d3d9.py
104 ${CMAKE_SOURCE_DIR}/specs/d3d9types.py
105 ${CMAKE_SOURCE_DIR}/specs/d3d9caps.py
106 ${CMAKE_SOURCE_DIR}/specs/d3d9dxva2.py
107 ${CMAKE_SOURCE_DIR}/specs/winapi.py
108 ${CMAKE_SOURCE_DIR}/specs/stdapi.py
110 add_library (d3d9trace MODULE d3d9.def d3d9trace.cpp d3d9shader.cpp)
111 target_link_libraries (d3d9trace
117 set_target_properties (d3d9trace PROPERTIES
121 install (TARGETS d3d9trace LIBRARY DESTINATION ${WRAPPER_INSTALL_DIR})
125 if (DirectX_D3D10_INCLUDE_DIR)
126 include_directories (SYSTEM ${DirectX_D3D10_INCLUDE_DIR})
128 OUTPUT d3d10trace.cpp
129 COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/d3d10trace.py > ${CMAKE_CURRENT_BINARY_DIR}/d3d10trace.cpp
135 ${CMAKE_SOURCE_DIR}/dispatch/dispatch.py
136 ${CMAKE_SOURCE_DIR}/specs/d3d10.py
137 ${CMAKE_SOURCE_DIR}/specs/d3d10misc.py
138 ${CMAKE_SOURCE_DIR}/specs/d3d10sdklayers.py
139 ${CMAKE_SOURCE_DIR}/specs/d3d10shader.py
140 ${CMAKE_SOURCE_DIR}/specs/d3d10effect.py
141 ${CMAKE_SOURCE_DIR}/specs/d3dcommon.py
142 ${CMAKE_SOURCE_DIR}/specs/dxgi.py
143 ${CMAKE_SOURCE_DIR}/specs/dxgitype.py
144 ${CMAKE_SOURCE_DIR}/specs/dxgiformat.py
145 ${CMAKE_SOURCE_DIR}/specs/winapi.py
146 ${CMAKE_SOURCE_DIR}/specs/stdapi.py
148 add_library (d3d10trace MODULE
153 target_link_libraries (d3d10trace
159 set_target_properties (d3d10trace PROPERTIES
163 install (TARGETS d3d10trace LIBRARY DESTINATION ${WRAPPER_INSTALL_DIR})
167 if (DirectX_D3D10_1_INCLUDE_DIR)
168 include_directories (SYSTEM ${DirectX_D3D10_1_INCLUDE_DIR})
170 OUTPUT d3d10_1trace.cpp
171 COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/d3d10_1trace.py > ${CMAKE_CURRENT_BINARY_DIR}/d3d10_1trace.cpp
177 ${CMAKE_SOURCE_DIR}/dispatch/dispatch.py
178 ${CMAKE_SOURCE_DIR}/specs/d3d10_1.py
179 ${CMAKE_SOURCE_DIR}/specs/d3d10.py
180 ${CMAKE_SOURCE_DIR}/specs/d3d10sdklayers.py
181 ${CMAKE_SOURCE_DIR}/specs/d3dcommon.py
182 ${CMAKE_SOURCE_DIR}/specs/dxgi.py
183 ${CMAKE_SOURCE_DIR}/specs/dxgitype.py
184 ${CMAKE_SOURCE_DIR}/specs/dxgiformat.py
185 ${CMAKE_SOURCE_DIR}/specs/winapi.py
186 ${CMAKE_SOURCE_DIR}/specs/stdapi.py
188 add_library (d3d10_1trace MODULE
193 target_link_libraries (d3d10_1trace
199 set_target_properties (d3d10_1trace
203 install (TARGETS d3d10_1trace LIBRARY DESTINATION ${WRAPPER_INSTALL_DIR})
207 if (DirectX_D3D11_INCLUDE_DIR)
208 if (DirectX_D3D11_1_INCLUDE_DIR)
214 include_directories (SYSTEM ${DirectX_D3D11_INCLUDE_DIR})
216 OUTPUT d3d11trace.cpp
217 COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/d3d11trace.py ${HAVE_D3D11_1} > ${CMAKE_CURRENT_BINARY_DIR}/d3d11trace.cpp
223 ${CMAKE_SOURCE_DIR}/specs/d3d11_1.py
224 ${CMAKE_SOURCE_DIR}/specs/d3d11.py
225 ${CMAKE_SOURCE_DIR}/specs/d3d11sdklayers.py
226 ${CMAKE_SOURCE_DIR}/specs/d3dcommon.py
227 ${CMAKE_SOURCE_DIR}/specs/dxgi.py
228 ${CMAKE_SOURCE_DIR}/specs/dxgitype.py
229 ${CMAKE_SOURCE_DIR}/specs/dxgiformat.py
230 ${CMAKE_SOURCE_DIR}/specs/winapi.py
231 ${CMAKE_SOURCE_DIR}/specs/stdapi.py
233 add_library (d3d11trace MODULE
238 target_link_libraries (d3d11trace
244 set_target_properties (d3d11trace
248 install (TARGETS d3d11trace LIBRARY DESTINATION ${WRAPPER_INSTALL_DIR})
251 # d2d1.dll, dwrite.dll
252 if (DirectX_D2D1_INCLUDE_DIR)
253 include_directories (SYSTEM ${DirectX_D2D1_INCLUDE_DIR})
257 COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/d2d1trace.py > ${CMAKE_CURRENT_BINARY_DIR}/d2d1trace.cpp
261 ${CMAKE_SOURCE_DIR}/specs/d2d1.py
262 ${CMAKE_SOURCE_DIR}/specs/d2d1.py
263 ${CMAKE_SOURCE_DIR}/specs/d2dbasetypes.py
264 ${CMAKE_SOURCE_DIR}/specs/d2derr.py
265 ${CMAKE_SOURCE_DIR}/specs/dwrite.py
266 ${CMAKE_SOURCE_DIR}/specs/dcommon.py
267 ${CMAKE_SOURCE_DIR}/specs/dxgi.py
268 ${CMAKE_SOURCE_DIR}/specs/dxgitype.py
269 ${CMAKE_SOURCE_DIR}/specs/dxgiformat.py
270 ${CMAKE_SOURCE_DIR}/specs/winapi.py
271 ${CMAKE_SOURCE_DIR}/specs/stdapi.py
273 add_library (d2d1trace SHARED d2d1.def d2d1trace.cpp)
274 target_link_libraries (d2d1trace
280 set_target_properties (d2d1trace
284 # http://www.cmake.org/pipermail/cmake/2009-March/028221.html
285 install (TARGETS d2d1trace
286 RUNTIME DESTINATION ${WRAPPER_INSTALL_DIR} COMPONENT RUNTIME
287 LIBRARY DESTINATION ${WRAPPER_INSTALL_DIR} COMPONENT RUNTIME
290 # dwrite.dll is just an empty stub for d2d1.dll
291 add_library (dwritetrace MODULE dwrite.def dwritetrace.cpp)
292 target_link_libraries (dwritetrace d2d1trace)
293 set_target_properties (dwritetrace
297 install (TARGETS dwritetrace LIBRARY DESTINATION ${WRAPPER_INSTALL_DIR})
298 endif (DirectX_D2D1_INCLUDE_DIR)
303 COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/wgltrace.py > ${CMAKE_CURRENT_BINARY_DIR}/wgltrace.cpp
308 ${CMAKE_SOURCE_DIR}/dispatch/dispatch.py
309 ${CMAKE_SOURCE_DIR}/specs/wglapi.py
310 ${CMAKE_SOURCE_DIR}/specs/wglenum.py
311 ${CMAKE_SOURCE_DIR}/specs/glapi.py
312 ${CMAKE_SOURCE_DIR}/specs/glparams.py
313 ${CMAKE_SOURCE_DIR}/specs/gltypes.py
314 ${CMAKE_SOURCE_DIR}/specs/winapi.py
315 ${CMAKE_SOURCE_DIR}/specs/stdapi.py
317 add_library (wgltrace MODULE opengl32.def
322 add_dependencies (wgltrace glproc)
323 target_link_libraries (wgltrace
330 set_target_properties (wgltrace PROPERTIES
334 install (TARGETS wgltrace LIBRARY DESTINATION ${WRAPPER_INSTALL_DIR})
340 COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/cgltrace.py > ${CMAKE_CURRENT_BINARY_DIR}/cgltrace.cpp
345 ${CMAKE_SOURCE_DIR}/specs/cglapi.py
346 ${CMAKE_SOURCE_DIR}/specs/glapi.py
347 ${CMAKE_SOURCE_DIR}/specs/glparams.py
348 ${CMAKE_SOURCE_DIR}/specs/gltypes.py
349 ${CMAKE_SOURCE_DIR}/specs/stdapi.py
352 add_library (cgltrace SHARED
358 add_dependencies (cgltrace glproc)
360 set_target_properties (cgltrace PROPERTIES
361 # OpenGL framework name
362 PREFIX "" OUTPUT_NAME "OpenGL" SUFFIX ""
363 # Specificy the version and reexport GLU symbols
364 LINK_FLAGS "-compatibility_version 1 -current_version 1.0.0 -Wl,-reexport_library,/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGLU.dylib"
367 target_link_libraries (cgltrace
373 ${CMAKE_THREAD_LIBS_INIT}
377 install (TARGETS cgltrace LIBRARY DESTINATION ${WRAPPER_INSTALL_DIR})
382 COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/glxtrace.py > ${CMAKE_CURRENT_BINARY_DIR}/glxtrace.cpp
387 ${CMAKE_SOURCE_DIR}/specs/glxapi.py
388 ${CMAKE_SOURCE_DIR}/specs/glapi.py
389 ${CMAKE_SOURCE_DIR}/specs/glparams.py
390 ${CMAKE_SOURCE_DIR}/specs/gltypes.py
391 ${CMAKE_SOURCE_DIR}/specs/stdapi.py
394 add_library (glxtrace SHARED
400 add_dependencies (glxtrace glproc)
402 set_target_properties (glxtrace PROPERTIES
403 # avoid the default "lib" prefix
405 # Prevent symbol relocations internal to our wrapper library to be
406 # overwritten by the application.
407 LINK_FLAGS "-Wl,-Bsymbolic -Wl,-Bsymbolic-functions"
410 target_link_libraries (glxtrace
416 ${CMAKE_THREAD_LIBS_INIT}
420 install (TARGETS glxtrace LIBRARY DESTINATION ${WRAPPER_INSTALL_DIR})
424 if (ENABLE_EGL AND NOT WIN32 AND NOT APPLE)
428 COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/egltrace.py > ${CMAKE_CURRENT_BINARY_DIR}/egltrace.cpp
433 ${CMAKE_SOURCE_DIR}/specs/eglapi.py
434 ${CMAKE_SOURCE_DIR}/specs/glesapi.py
435 ${CMAKE_SOURCE_DIR}/specs/glapi.py
436 ${CMAKE_SOURCE_DIR}/specs/glparams.py
437 ${CMAKE_SOURCE_DIR}/specs/gltypes.py
438 ${CMAKE_SOURCE_DIR}/specs/stdapi.py
441 add_library (egltrace SHARED
445 ${CMAKE_SOURCE_DIR}/helpers/eglsize.cpp
448 add_dependencies (egltrace glproc)
450 set_target_properties (egltrace PROPERTIES
451 # avoid the default "lib" prefix
453 # Prevent symbol relocations internal to our wrapper library to be
454 # overwritten by the application.
455 LINK_FLAGS "-Wl,-Bsymbolic -Wl,-Bsymbolic-functions"
458 target_link_libraries (egltrace
464 ${CMAKE_THREAD_LIBS_INIT}
468 install (TARGETS egltrace LIBRARY DESTINATION ${WRAPPER_INSTALL_DIR})