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 SHARED d2d1.def d2d1trace.cpp)
272 target_link_libraries (d2d1
278 set_target_properties (d2d1
282 # http://www.cmake.org/pipermail/cmake/2009-March/028221.html
283 install (TARGETS d2d1
284 RUNTIME DESTINATION ${WRAPPER_INSTALL_DIR} COMPONENT RUNTIME
285 LIBRARY DESTINATION ${WRAPPER_INSTALL_DIR} COMPONENT RUNTIME
288 # dwrite.dll is just an empty stub for d2d1.dll
289 add_library (dwrite MODULE dwrite.def)
290 target_link_libraries (dwrite d2d1)
291 set_target_properties (dwrite
295 install (TARGETS dwrite LIBRARY DESTINATION ${WRAPPER_INSTALL_DIR})
296 endif (DirectX_D2D1_INCLUDE_DIR)
301 COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/wgltrace.py > ${CMAKE_CURRENT_BINARY_DIR}/wgltrace.cpp
306 ${CMAKE_SOURCE_DIR}/dispatch/dispatch.py
307 ${CMAKE_SOURCE_DIR}/specs/wglapi.py
308 ${CMAKE_SOURCE_DIR}/specs/wglenum.py
309 ${CMAKE_SOURCE_DIR}/specs/glapi.py
310 ${CMAKE_SOURCE_DIR}/specs/glparams.py
311 ${CMAKE_SOURCE_DIR}/specs/gltypes.py
312 ${CMAKE_SOURCE_DIR}/specs/winapi.py
313 ${CMAKE_SOURCE_DIR}/specs/stdapi.py
315 add_library (wgltrace MODULE opengl32.def
320 add_dependencies (wgltrace glproc)
321 target_link_libraries (wgltrace
328 set_target_properties (wgltrace PROPERTIES
332 install (TARGETS wgltrace LIBRARY DESTINATION ${WRAPPER_INSTALL_DIR})
338 COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/cgltrace.py > ${CMAKE_CURRENT_BINARY_DIR}/cgltrace.cpp
343 ${CMAKE_SOURCE_DIR}/specs/cglapi.py
344 ${CMAKE_SOURCE_DIR}/specs/glapi.py
345 ${CMAKE_SOURCE_DIR}/specs/glparams.py
346 ${CMAKE_SOURCE_DIR}/specs/gltypes.py
347 ${CMAKE_SOURCE_DIR}/specs/stdapi.py
350 add_library (cgltrace SHARED
356 add_dependencies (cgltrace glproc)
358 set_target_properties (cgltrace PROPERTIES
359 # OpenGL framework name
360 PREFIX "" OUTPUT_NAME "OpenGL" SUFFIX ""
361 # Specificy the version and reexport GLU symbols
362 LINK_FLAGS "-compatibility_version 1 -current_version 1.0.0 -Wl,-reexport_library,/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGLU.dylib"
365 target_link_libraries (cgltrace
371 ${CMAKE_THREAD_LIBS_INIT}
375 install (TARGETS cgltrace LIBRARY DESTINATION ${WRAPPER_INSTALL_DIR})
380 COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/glxtrace.py > ${CMAKE_CURRENT_BINARY_DIR}/glxtrace.cpp
385 ${CMAKE_SOURCE_DIR}/specs/glxapi.py
386 ${CMAKE_SOURCE_DIR}/specs/glapi.py
387 ${CMAKE_SOURCE_DIR}/specs/glparams.py
388 ${CMAKE_SOURCE_DIR}/specs/gltypes.py
389 ${CMAKE_SOURCE_DIR}/specs/stdapi.py
392 add_library (glxtrace SHARED
398 add_dependencies (glxtrace glproc)
400 set_target_properties (glxtrace PROPERTIES
401 # avoid the default "lib" prefix
403 # Prevent symbol relocations internal to our wrapper library to be
404 # overwritten by the application.
405 LINK_FLAGS "-Wl,-Bsymbolic -Wl,-Bsymbolic-functions"
408 target_link_libraries (glxtrace
414 ${CMAKE_THREAD_LIBS_INIT}
418 install (TARGETS glxtrace LIBRARY DESTINATION ${WRAPPER_INSTALL_DIR})
422 if (ENABLE_EGL AND NOT WIN32 AND NOT APPLE)
426 COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/egltrace.py > ${CMAKE_CURRENT_BINARY_DIR}/egltrace.cpp
431 ${CMAKE_SOURCE_DIR}/specs/eglapi.py
432 ${CMAKE_SOURCE_DIR}/specs/glesapi.py
433 ${CMAKE_SOURCE_DIR}/specs/glapi.py
434 ${CMAKE_SOURCE_DIR}/specs/glparams.py
435 ${CMAKE_SOURCE_DIR}/specs/gltypes.py
436 ${CMAKE_SOURCE_DIR}/specs/stdapi.py
439 add_library (egltrace SHARED
443 ${CMAKE_SOURCE_DIR}/helpers/eglsize.cpp
446 add_dependencies (egltrace glproc)
448 set_target_properties (egltrace PROPERTIES
449 # avoid the default "lib" prefix
451 # Prevent symbol relocations internal to our wrapper library to be
452 # overwritten by the application.
453 LINK_FLAGS "-Wl,-Bsymbolic -Wl,-Bsymbolic-functions"
456 target_link_libraries (egltrace
462 ${CMAKE_THREAD_LIBS_INIT}
466 install (TARGETS egltrace LIBRARY DESTINATION ${WRAPPER_INSTALL_DIR})