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/winapi.py
105 ${CMAKE_SOURCE_DIR}/specs/stdapi.py
107 add_library (d3d9trace MODULE d3d9.def d3d9trace.cpp d3d9shader.cpp)
108 target_link_libraries (d3d9trace
114 set_target_properties (d3d9trace PROPERTIES
118 install (TARGETS d3d9trace LIBRARY DESTINATION ${WRAPPER_INSTALL_DIR})
122 if (DirectX_D3D10_INCLUDE_DIR)
123 include_directories (SYSTEM ${DirectX_D3D10_INCLUDE_DIR})
125 OUTPUT d3d10trace.cpp
126 COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/d3d10trace.py > ${CMAKE_CURRENT_BINARY_DIR}/d3d10trace.cpp
131 ${CMAKE_SOURCE_DIR}/dispatch/dispatch.py
132 ${CMAKE_SOURCE_DIR}/specs/d3d10.py
133 ${CMAKE_SOURCE_DIR}/specs/d3d10misc.py
134 ${CMAKE_SOURCE_DIR}/specs/d3d10sdklayers.py
135 ${CMAKE_SOURCE_DIR}/specs/d3d10shader.py
136 ${CMAKE_SOURCE_DIR}/specs/d3d10effect.py
137 ${CMAKE_SOURCE_DIR}/specs/d3dcommon.py
138 ${CMAKE_SOURCE_DIR}/specs/dxgi.py
139 ${CMAKE_SOURCE_DIR}/specs/dxgitype.py
140 ${CMAKE_SOURCE_DIR}/specs/dxgiformat.py
141 ${CMAKE_SOURCE_DIR}/specs/winapi.py
142 ${CMAKE_SOURCE_DIR}/specs/stdapi.py
144 add_library (d3d10trace MODULE d3d10.def d3d10trace.cpp d3d10shader.cpp)
145 target_link_libraries (d3d10trace
151 set_target_properties (d3d10trace PROPERTIES
155 install (TARGETS d3d10trace LIBRARY DESTINATION ${WRAPPER_INSTALL_DIR})
159 if (DirectX_D3D10_1_INCLUDE_DIR)
160 include_directories (SYSTEM ${DirectX_D3D10_1_INCLUDE_DIR})
162 OUTPUT d3d10_1trace.cpp
163 COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/d3d10_1trace.py > ${CMAKE_CURRENT_BINARY_DIR}/d3d10_1trace.cpp
168 ${CMAKE_SOURCE_DIR}/dispatch/dispatch.py
169 ${CMAKE_SOURCE_DIR}/specs/d3d10_1.py
170 ${CMAKE_SOURCE_DIR}/specs/d3d10.py
171 ${CMAKE_SOURCE_DIR}/specs/d3d10sdklayers.py
172 ${CMAKE_SOURCE_DIR}/specs/d3dcommon.py
173 ${CMAKE_SOURCE_DIR}/specs/dxgi.py
174 ${CMAKE_SOURCE_DIR}/specs/dxgitype.py
175 ${CMAKE_SOURCE_DIR}/specs/dxgiformat.py
176 ${CMAKE_SOURCE_DIR}/specs/winapi.py
177 ${CMAKE_SOURCE_DIR}/specs/stdapi.py
179 add_library (d3d10_1trace MODULE d3d10_1.def d3d10_1trace.cpp)
180 target_link_libraries (d3d10_1trace
186 set_target_properties (d3d10_1trace
190 install (TARGETS d3d10_1trace LIBRARY DESTINATION ${WRAPPER_INSTALL_DIR})
194 if (DirectX_D3D11_INCLUDE_DIR)
195 if (DirectX_D3D11_1_INCLUDE_DIR)
201 include_directories (SYSTEM ${DirectX_D3D11_INCLUDE_DIR})
203 OUTPUT d3d11trace.cpp
204 COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/d3d11trace.py ${HAVE_D3D11_1} > ${CMAKE_CURRENT_BINARY_DIR}/d3d11trace.cpp
209 ${CMAKE_SOURCE_DIR}/specs/d3d11_1.py
210 ${CMAKE_SOURCE_DIR}/specs/d3d11.py
211 ${CMAKE_SOURCE_DIR}/specs/d3d11sdklayers.py
212 ${CMAKE_SOURCE_DIR}/specs/d3dcommon.py
213 ${CMAKE_SOURCE_DIR}/specs/dxgi.py
214 ${CMAKE_SOURCE_DIR}/specs/dxgitype.py
215 ${CMAKE_SOURCE_DIR}/specs/dxgiformat.py
216 ${CMAKE_SOURCE_DIR}/specs/winapi.py
217 ${CMAKE_SOURCE_DIR}/specs/stdapi.py
219 add_library (d3d11trace MODULE d3d11.def d3d11trace.cpp)
220 target_link_libraries (d3d11trace
226 set_target_properties (d3d11trace
230 install (TARGETS d3d11trace LIBRARY DESTINATION ${WRAPPER_INSTALL_DIR})
236 COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/wgltrace.py > ${CMAKE_CURRENT_BINARY_DIR}/wgltrace.cpp
241 ${CMAKE_SOURCE_DIR}/dispatch/dispatch.py
242 ${CMAKE_SOURCE_DIR}/specs/wglapi.py
243 ${CMAKE_SOURCE_DIR}/specs/wglenum.py
244 ${CMAKE_SOURCE_DIR}/specs/glapi.py
245 ${CMAKE_SOURCE_DIR}/specs/glparams.py
246 ${CMAKE_SOURCE_DIR}/specs/gltypes.py
247 ${CMAKE_SOURCE_DIR}/specs/winapi.py
248 ${CMAKE_SOURCE_DIR}/specs/stdapi.py
250 add_library (wgltrace MODULE opengl32.def
255 add_dependencies (wgltrace glproc)
256 target_link_libraries (wgltrace
263 set_target_properties (wgltrace PROPERTIES
267 install (TARGETS wgltrace LIBRARY DESTINATION ${WRAPPER_INSTALL_DIR})
273 COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/cgltrace.py > ${CMAKE_CURRENT_BINARY_DIR}/cgltrace.cpp
278 ${CMAKE_SOURCE_DIR}/specs/cglapi.py
279 ${CMAKE_SOURCE_DIR}/specs/glapi.py
280 ${CMAKE_SOURCE_DIR}/specs/glparams.py
281 ${CMAKE_SOURCE_DIR}/specs/gltypes.py
282 ${CMAKE_SOURCE_DIR}/specs/stdapi.py
285 add_library (cgltrace SHARED
291 add_dependencies (cgltrace glproc)
293 set_target_properties (cgltrace PROPERTIES
294 # OpenGL framework name
295 PREFIX "" OUTPUT_NAME "OpenGL" SUFFIX ""
296 # Specificy the version and reexport GLU symbols
297 LINK_FLAGS "-compatibility_version 1 -current_version 1.0.0 -Wl,-reexport_library,/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGLU.dylib"
300 target_link_libraries (cgltrace
306 ${CMAKE_THREAD_LIBS_INIT}
310 install (TARGETS cgltrace LIBRARY DESTINATION ${WRAPPER_INSTALL_DIR})
315 COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/glxtrace.py > ${CMAKE_CURRENT_BINARY_DIR}/glxtrace.cpp
320 ${CMAKE_SOURCE_DIR}/specs/glxapi.py
321 ${CMAKE_SOURCE_DIR}/specs/glapi.py
322 ${CMAKE_SOURCE_DIR}/specs/glparams.py
323 ${CMAKE_SOURCE_DIR}/specs/gltypes.py
324 ${CMAKE_SOURCE_DIR}/specs/stdapi.py
327 add_library (glxtrace SHARED
333 add_dependencies (glxtrace glproc)
335 set_target_properties (glxtrace PROPERTIES
336 # avoid the default "lib" prefix
338 # Prevent symbol relocations internal to our wrapper library to be
339 # overwritten by the application.
340 LINK_FLAGS "-Wl,-Bsymbolic -Wl,-Bsymbolic-functions"
343 target_link_libraries (glxtrace
350 ${CMAKE_THREAD_LIBS_INIT}
354 install (TARGETS glxtrace LIBRARY DESTINATION ${WRAPPER_INSTALL_DIR})
358 if (ENABLE_EGL AND NOT WIN32 AND NOT APPLE)
362 COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/egltrace.py > ${CMAKE_CURRENT_BINARY_DIR}/egltrace.cpp
367 ${CMAKE_SOURCE_DIR}/specs/eglapi.py
368 ${CMAKE_SOURCE_DIR}/specs/glesapi.py
369 ${CMAKE_SOURCE_DIR}/specs/glapi.py
370 ${CMAKE_SOURCE_DIR}/specs/glparams.py
371 ${CMAKE_SOURCE_DIR}/specs/gltypes.py
372 ${CMAKE_SOURCE_DIR}/specs/stdapi.py
375 add_library (egltrace SHARED
379 ${CMAKE_SOURCE_DIR}/helpers/eglsize.cpp
382 add_dependencies (egltrace glproc)
384 set_target_properties (egltrace PROPERTIES
385 # avoid the default "lib" prefix
387 # Prevent symbol relocations internal to our wrapper library to be
388 # overwritten by the application.
389 LINK_FLAGS "-Wl,-Bsymbolic -Wl,-Bsymbolic-functions"
392 target_link_libraries (egltrace
398 ${CMAKE_THREAD_LIBS_INIT}
402 install (TARGETS egltrace LIBRARY DESTINATION ${WRAPPER_INSTALL_DIR})