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_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--enable-stdcall-fixup")
27 set (CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,--enable-stdcall-fixup")
31 if (DirectX_D3D_INCLUDE_DIR)
32 include_directories (SYSTEM ${DirectX_D3D_INCLUDE_DIR})
35 COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/ddrawtrace.py > ${CMAKE_CURRENT_BINARY_DIR}/ddrawtrace.cpp
40 ${CMAKE_SOURCE_DIR}/dispatch/dispatch.py
41 ${CMAKE_SOURCE_DIR}/specs/d3d.py
42 ${CMAKE_SOURCE_DIR}/specs/d3dtypes.py
43 ${CMAKE_SOURCE_DIR}/specs/d3dcaps.py
44 ${CMAKE_SOURCE_DIR}/specs/ddraw.py
45 ${CMAKE_SOURCE_DIR}/specs/winapi.py
46 ${CMAKE_SOURCE_DIR}/specs/stdapi.py
48 add_library (ddrawtrace MODULE ddraw.def ddrawtrace.cpp)
49 target_link_libraries (ddrawtrace
55 set_target_properties (ddrawtrace PROPERTIES
59 install (TARGETS ddrawtrace LIBRARY DESTINATION ${WRAPPER_INSTALL_DIR})
63 if (DirectX_D3D8_INCLUDE_DIR AND DirectX_D3DX9_INCLUDE_DIR)
64 include_directories (SYSTEM ${DirectX_D3D8_INCLUDE_DIR} ${DirectX_D3DX9_INCLUDE_DIR})
67 COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/d3d8trace.py > ${CMAKE_CURRENT_BINARY_DIR}/d3d8trace.cpp
72 ${CMAKE_SOURCE_DIR}/dispatch/dispatch.py
73 ${CMAKE_SOURCE_DIR}/specs/d3d8.py
74 ${CMAKE_SOURCE_DIR}/specs/d3d8types.py
75 ${CMAKE_SOURCE_DIR}/specs/d3d8caps.py
76 ${CMAKE_SOURCE_DIR}/specs/winapi.py
77 ${CMAKE_SOURCE_DIR}/specs/stdapi.py
79 add_library (d3d8trace MODULE d3d8.def d3d8trace.cpp d3d9shader.cpp)
80 target_link_libraries (d3d8trace
86 set_target_properties (d3d8trace PROPERTIES
90 install (TARGETS d3d8trace LIBRARY DESTINATION ${WRAPPER_INSTALL_DIR})
94 if (DirectX_D3DX9_INCLUDE_DIR)
95 include_directories (SYSTEM ${DirectX_D3DX9_INCLUDE_DIR})
98 COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/d3d9trace.py > ${CMAKE_CURRENT_BINARY_DIR}/d3d9trace.cpp
103 ${CMAKE_SOURCE_DIR}/dispatch/dispatch.py
104 ${CMAKE_SOURCE_DIR}/specs/d3d9.py
105 ${CMAKE_SOURCE_DIR}/specs/d3d9types.py
106 ${CMAKE_SOURCE_DIR}/specs/d3d9caps.py
107 ${CMAKE_SOURCE_DIR}/specs/d3d9dxva2.py
108 ${CMAKE_SOURCE_DIR}/specs/winapi.py
109 ${CMAKE_SOURCE_DIR}/specs/stdapi.py
111 add_library (d3d9trace MODULE d3d9.def d3d9trace.cpp d3d9shader.cpp)
112 target_link_libraries (d3d9trace
118 set_target_properties (d3d9trace PROPERTIES
122 install (TARGETS d3d9trace LIBRARY DESTINATION ${WRAPPER_INSTALL_DIR})
126 if (DirectX_D3D10_INCLUDE_DIR)
127 include_directories (SYSTEM ${DirectX_D3D10_INCLUDE_DIR})
129 OUTPUT d3d10trace.cpp
130 COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/d3d10trace.py > ${CMAKE_CURRENT_BINARY_DIR}/d3d10trace.cpp
136 ${CMAKE_SOURCE_DIR}/dispatch/dispatch.py
137 ${CMAKE_SOURCE_DIR}/specs/d3d10.py
138 ${CMAKE_SOURCE_DIR}/specs/d3d10misc.py
139 ${CMAKE_SOURCE_DIR}/specs/d3d10sdklayers.py
140 ${CMAKE_SOURCE_DIR}/specs/d3d10shader.py
141 ${CMAKE_SOURCE_DIR}/specs/d3d10effect.py
142 ${CMAKE_SOURCE_DIR}/specs/d3dcommon.py
143 ${CMAKE_SOURCE_DIR}/specs/dxgi.py
144 ${CMAKE_SOURCE_DIR}/specs/dxgitype.py
145 ${CMAKE_SOURCE_DIR}/specs/dxgiformat.py
146 ${CMAKE_SOURCE_DIR}/specs/winapi.py
147 ${CMAKE_SOURCE_DIR}/specs/stdapi.py
149 add_library (d3d10trace MODULE
154 target_link_libraries (d3d10trace
160 set_target_properties (d3d10trace PROPERTIES
164 install (TARGETS d3d10trace LIBRARY DESTINATION ${WRAPPER_INSTALL_DIR})
168 if (DirectX_D3D10_1_INCLUDE_DIR)
169 include_directories (SYSTEM ${DirectX_D3D10_1_INCLUDE_DIR})
171 OUTPUT d3d10_1trace.cpp
172 COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/d3d10_1trace.py > ${CMAKE_CURRENT_BINARY_DIR}/d3d10_1trace.cpp
178 ${CMAKE_SOURCE_DIR}/dispatch/dispatch.py
179 ${CMAKE_SOURCE_DIR}/specs/d3d10_1.py
180 ${CMAKE_SOURCE_DIR}/specs/d3d10.py
181 ${CMAKE_SOURCE_DIR}/specs/d3d10sdklayers.py
182 ${CMAKE_SOURCE_DIR}/specs/d3dcommon.py
183 ${CMAKE_SOURCE_DIR}/specs/dxgi.py
184 ${CMAKE_SOURCE_DIR}/specs/dxgitype.py
185 ${CMAKE_SOURCE_DIR}/specs/dxgiformat.py
186 ${CMAKE_SOURCE_DIR}/specs/winapi.py
187 ${CMAKE_SOURCE_DIR}/specs/stdapi.py
189 add_library (d3d10_1trace MODULE
194 target_link_libraries (d3d10_1trace
200 set_target_properties (d3d10_1trace
204 install (TARGETS d3d10_1trace LIBRARY DESTINATION ${WRAPPER_INSTALL_DIR})
208 if (DirectX_D3D11_INCLUDE_DIR)
209 if (DirectX_D3D11_1_INCLUDE_DIR)
215 include_directories (SYSTEM ${DirectX_D3D11_INCLUDE_DIR})
217 OUTPUT d3d11trace.cpp
218 COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/d3d11trace.py ${HAVE_D3D11_1} > ${CMAKE_CURRENT_BINARY_DIR}/d3d11trace.cpp
224 ${CMAKE_SOURCE_DIR}/specs/d3d11_1.py
225 ${CMAKE_SOURCE_DIR}/specs/d3d11.py
226 ${CMAKE_SOURCE_DIR}/specs/d3d11sdklayers.py
227 ${CMAKE_SOURCE_DIR}/specs/d3dcommon.py
228 ${CMAKE_SOURCE_DIR}/specs/dxgi.py
229 ${CMAKE_SOURCE_DIR}/specs/dxgitype.py
230 ${CMAKE_SOURCE_DIR}/specs/dxgiformat.py
231 ${CMAKE_SOURCE_DIR}/specs/winapi.py
232 ${CMAKE_SOURCE_DIR}/specs/stdapi.py
234 add_library (d3d11trace MODULE
239 target_link_libraries (d3d11trace
245 set_target_properties (d3d11trace
249 install (TARGETS d3d11trace LIBRARY DESTINATION ${WRAPPER_INSTALL_DIR})
252 # d2d1.dll, dwrite.dll
253 if (DirectX_D2D1_INCLUDE_DIR)
254 include_directories (SYSTEM ${DirectX_D2D1_INCLUDE_DIR})
258 COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/d2d1trace.py > ${CMAKE_CURRENT_BINARY_DIR}/d2d1trace.cpp
262 ${CMAKE_SOURCE_DIR}/specs/d2d1.py
263 ${CMAKE_SOURCE_DIR}/specs/d2d1.py
264 ${CMAKE_SOURCE_DIR}/specs/d2dbasetypes.py
265 ${CMAKE_SOURCE_DIR}/specs/d2derr.py
266 ${CMAKE_SOURCE_DIR}/specs/dwrite.py
267 ${CMAKE_SOURCE_DIR}/specs/dcommon.py
268 ${CMAKE_SOURCE_DIR}/specs/dxgi.py
269 ${CMAKE_SOURCE_DIR}/specs/dxgitype.py
270 ${CMAKE_SOURCE_DIR}/specs/dxgiformat.py
271 ${CMAKE_SOURCE_DIR}/specs/winapi.py
272 ${CMAKE_SOURCE_DIR}/specs/stdapi.py
274 add_library (d2d1trace SHARED d2d1.def d2d1trace.cpp)
275 target_link_libraries (d2d1trace
281 set_target_properties (d2d1trace
285 # http://www.cmake.org/pipermail/cmake/2009-March/028221.html
286 install (TARGETS d2d1trace
287 RUNTIME DESTINATION ${WRAPPER_INSTALL_DIR} COMPONENT RUNTIME
288 LIBRARY DESTINATION ${WRAPPER_INSTALL_DIR} COMPONENT RUNTIME
291 # dwrite.dll is just an empty stub for d2d1.dll
292 add_library (dwritetrace MODULE dwrite.def dwritetrace.cpp)
293 target_link_libraries (dwritetrace d2d1trace)
294 set_target_properties (dwritetrace
298 install (TARGETS dwritetrace LIBRARY DESTINATION ${WRAPPER_INSTALL_DIR})
299 endif (DirectX_D2D1_INCLUDE_DIR)
304 COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/wgltrace.py > ${CMAKE_CURRENT_BINARY_DIR}/wgltrace.cpp
309 ${CMAKE_SOURCE_DIR}/dispatch/dispatch.py
310 ${CMAKE_SOURCE_DIR}/specs/wglapi.py
311 ${CMAKE_SOURCE_DIR}/specs/wglenum.py
312 ${CMAKE_SOURCE_DIR}/specs/glapi.py
313 ${CMAKE_SOURCE_DIR}/specs/glparams.py
314 ${CMAKE_SOURCE_DIR}/specs/gltypes.py
315 ${CMAKE_SOURCE_DIR}/specs/winapi.py
316 ${CMAKE_SOURCE_DIR}/specs/stdapi.py
318 add_library (wgltrace MODULE opengl32.def
323 add_dependencies (wgltrace glproc)
324 target_link_libraries (wgltrace
331 set_target_properties (wgltrace PROPERTIES
335 install (TARGETS wgltrace LIBRARY DESTINATION ${WRAPPER_INSTALL_DIR})
341 COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/cgltrace.py > ${CMAKE_CURRENT_BINARY_DIR}/cgltrace.cpp
346 ${CMAKE_SOURCE_DIR}/specs/cglapi.py
347 ${CMAKE_SOURCE_DIR}/specs/glapi.py
348 ${CMAKE_SOURCE_DIR}/specs/glparams.py
349 ${CMAKE_SOURCE_DIR}/specs/gltypes.py
350 ${CMAKE_SOURCE_DIR}/specs/stdapi.py
353 add_library (cgltrace SHARED
359 add_dependencies (cgltrace glproc)
361 set_target_properties (cgltrace PROPERTIES
362 # OpenGL framework name
363 PREFIX "" OUTPUT_NAME "OpenGL" SUFFIX ""
364 # Specificy the version and reexport GLU symbols
365 LINK_FLAGS "-compatibility_version 1 -current_version 1.0.0 -Wl,-reexport_library,/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGLU.dylib"
368 target_link_libraries (cgltrace
374 ${CMAKE_THREAD_LIBS_INIT}
378 install (TARGETS cgltrace LIBRARY DESTINATION ${WRAPPER_INSTALL_DIR})
383 COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/glxtrace.py > ${CMAKE_CURRENT_BINARY_DIR}/glxtrace.cpp
388 ${CMAKE_SOURCE_DIR}/specs/glxapi.py
389 ${CMAKE_SOURCE_DIR}/specs/glapi.py
390 ${CMAKE_SOURCE_DIR}/specs/glparams.py
391 ${CMAKE_SOURCE_DIR}/specs/gltypes.py
392 ${CMAKE_SOURCE_DIR}/specs/stdapi.py
395 add_library (glxtrace SHARED
401 add_dependencies (glxtrace glproc)
403 set_target_properties (glxtrace PROPERTIES
404 # avoid the default "lib" prefix
406 # Prevent symbol relocations internal to our wrapper library to be
407 # overwritten by the application.
408 LINK_FLAGS "-Wl,-Bsymbolic -Wl,-Bsymbolic-functions"
411 target_link_libraries (glxtrace
417 ${CMAKE_THREAD_LIBS_INIT}
421 install (TARGETS glxtrace LIBRARY DESTINATION ${WRAPPER_INSTALL_DIR})
425 if (ENABLE_EGL AND NOT WIN32 AND NOT APPLE)
429 COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/egltrace.py > ${CMAKE_CURRENT_BINARY_DIR}/egltrace.cpp
434 ${CMAKE_SOURCE_DIR}/specs/eglapi.py
435 ${CMAKE_SOURCE_DIR}/specs/glesapi.py
436 ${CMAKE_SOURCE_DIR}/specs/glapi.py
437 ${CMAKE_SOURCE_DIR}/specs/glparams.py
438 ${CMAKE_SOURCE_DIR}/specs/gltypes.py
439 ${CMAKE_SOURCE_DIR}/specs/stdapi.py
442 add_library (egltrace SHARED
446 ${CMAKE_SOURCE_DIR}/helpers/eglsize.cpp
449 add_dependencies (egltrace glproc)
451 set_target_properties (egltrace PROPERTIES
452 # avoid the default "lib" prefix
454 # Prevent symbol relocations internal to our wrapper library to be
455 # overwritten by the application.
456 LINK_FLAGS "-Wl,-Bsymbolic -Wl,-Bsymbolic-functions"
459 target_link_libraries (egltrace
465 ${CMAKE_THREAD_LIBS_INIT}
469 install (TARGETS egltrace LIBRARY DESTINATION ${WRAPPER_INSTALL_DIR})