1 ##############################################################################
6 ${CMAKE_CURRENT_SOURCE_DIR}
7 ${CMAKE_SOURCE_DIR}/helpers
8 ${CMAKE_BINARY_DIR}/dispatch
9 ${CMAKE_SOURCE_DIR}/dispatch
15 # Silence warnings about @nn suffix mismatch
16 set (CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,--enable-stdcall-fixup")
20 if (DirectX_D3D_INCLUDE_DIR)
21 include_directories (SYSTEM ${DirectX_D3D_INCLUDE_DIR})
24 COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/ddrawtrace.py > ${CMAKE_CURRENT_BINARY_DIR}/ddrawtrace.cpp
29 ${CMAKE_SOURCE_DIR}/dispatch/dispatch.py
30 ${CMAKE_SOURCE_DIR}/specs/d3d.py
31 ${CMAKE_SOURCE_DIR}/specs/d3dtypes.py
32 ${CMAKE_SOURCE_DIR}/specs/d3dcaps.py
33 ${CMAKE_SOURCE_DIR}/specs/ddraw.py
34 ${CMAKE_SOURCE_DIR}/specs/winapi.py
35 ${CMAKE_SOURCE_DIR}/specs/stdapi.py
37 add_library (ddrawtrace MODULE ddraw.def ddrawtrace.cpp)
38 target_link_libraries (ddrawtrace
43 set_target_properties (ddrawtrace PROPERTIES
47 install (TARGETS ddrawtrace LIBRARY DESTINATION ${WRAPPER_INSTALL_DIR})
51 if (DirectX_D3D8_INCLUDE_DIR AND DirectX_D3DX9_INCLUDE_DIR)
52 include_directories (SYSTEM ${DirectX_D3D8_INCLUDE_DIR} ${DirectX_D3DX9_INCLUDE_DIR})
55 COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/d3d8trace.py > ${CMAKE_CURRENT_BINARY_DIR}/d3d8trace.cpp
60 ${CMAKE_SOURCE_DIR}/dispatch/dispatch.py
61 ${CMAKE_SOURCE_DIR}/specs/d3d8.py
62 ${CMAKE_SOURCE_DIR}/specs/d3d8types.py
63 ${CMAKE_SOURCE_DIR}/specs/d3d8caps.py
64 ${CMAKE_SOURCE_DIR}/specs/winapi.py
65 ${CMAKE_SOURCE_DIR}/specs/stdapi.py
67 add_library (d3d8trace MODULE d3d8.def d3d8trace.cpp d3dshader.cpp)
68 target_link_libraries (d3d8trace
73 set_target_properties (d3d8trace PROPERTIES
77 install (TARGETS d3d8trace LIBRARY DESTINATION ${WRAPPER_INSTALL_DIR})
81 if (DirectX_D3DX9_INCLUDE_DIR)
82 include_directories (SYSTEM ${DirectX_D3DX9_INCLUDE_DIR})
85 COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/d3d9trace.py > ${CMAKE_CURRENT_BINARY_DIR}/d3d9trace.cpp
90 ${CMAKE_SOURCE_DIR}/dispatch/dispatch.py
91 ${CMAKE_SOURCE_DIR}/specs/d3d9.py
92 ${CMAKE_SOURCE_DIR}/specs/d3d9types.py
93 ${CMAKE_SOURCE_DIR}/specs/d3d9caps.py
94 ${CMAKE_SOURCE_DIR}/specs/winapi.py
95 ${CMAKE_SOURCE_DIR}/specs/stdapi.py
97 add_library (d3d9trace MODULE d3d9.def d3d9trace.cpp d3dshader.cpp)
98 target_link_libraries (d3d9trace
103 set_target_properties (d3d9trace PROPERTIES
107 install (TARGETS d3d9trace LIBRARY DESTINATION ${WRAPPER_INSTALL_DIR})
111 if (DirectX_D3DX10_INCLUDE_DIR)
112 include_directories (SYSTEM ${DirectX_D3DX10_INCLUDE_DIR})
114 OUTPUT d3d10trace.cpp
115 COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/d3d10trace.py > ${CMAKE_CURRENT_BINARY_DIR}/d3d10trace.cpp
120 ${CMAKE_SOURCE_DIR}/dispatch/dispatch.py
121 ${CMAKE_SOURCE_DIR}/specs/d3d10misc.py
122 ${CMAKE_SOURCE_DIR}/specs/d3d10.py
123 ${CMAKE_SOURCE_DIR}/specs/d3d10sdklayers.py
124 ${CMAKE_SOURCE_DIR}/specs/d3dcommon.py
125 ${CMAKE_SOURCE_DIR}/specs/dxgi.py
126 ${CMAKE_SOURCE_DIR}/specs/dxgitype.py
127 ${CMAKE_SOURCE_DIR}/specs/dxgiformat.py
128 ${CMAKE_SOURCE_DIR}/specs/winapi.py
129 ${CMAKE_SOURCE_DIR}/specs/stdapi.py
131 add_library (d3d10trace MODULE d3d10.def d3d10trace.cpp)
132 target_link_libraries (d3d10trace
137 set_target_properties (d3d10trace PROPERTIES
141 install (TARGETS d3d10trace LIBRARY DESTINATION ${WRAPPER_INSTALL_DIR})
145 if (DirectX_D3DX10_INCLUDE_DIR AND DirectX_D3D10_1_INCLUDE_DIR)
146 include_directories (SYSTEM ${DirectX_D3D10_1_INCLUDE_DIR})
148 OUTPUT d3d10_1trace.cpp
149 COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/d3d10_1trace.py > ${CMAKE_CURRENT_BINARY_DIR}/d3d10_1trace.cpp
154 ${CMAKE_SOURCE_DIR}/dispatch/dispatch.py
155 ${CMAKE_SOURCE_DIR}/specs/d3d10_1.py
156 ${CMAKE_SOURCE_DIR}/specs/d3d10.py
157 ${CMAKE_SOURCE_DIR}/specs/d3d10sdklayers.py
158 ${CMAKE_SOURCE_DIR}/specs/d3dcommon.py
159 ${CMAKE_SOURCE_DIR}/specs/dxgi.py
160 ${CMAKE_SOURCE_DIR}/specs/dxgitype.py
161 ${CMAKE_SOURCE_DIR}/specs/dxgiformat.py
162 ${CMAKE_SOURCE_DIR}/specs/winapi.py
163 ${CMAKE_SOURCE_DIR}/specs/stdapi.py
165 add_library (d3d10_1trace MODULE d3d10_1.def d3d10_1trace.cpp)
166 target_link_libraries (d3d10_1trace
171 set_target_properties (d3d10_1trace
175 install (TARGETS d3d10_1trace LIBRARY DESTINATION ${WRAPPER_INSTALL_DIR})
179 if (DirectX_D3DX11_INCLUDE_DIR)
180 include_directories (SYSTEM ${DirectX_D3DX11_INCLUDE_DIR})
182 OUTPUT d3d11trace.cpp
183 COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/d3d11trace.py > ${CMAKE_CURRENT_BINARY_DIR}/d3d11trace.cpp
188 ${CMAKE_SOURCE_DIR}/specs/d3d11.py
189 ${CMAKE_SOURCE_DIR}/specs/d3d11sdklayers.py
190 ${CMAKE_SOURCE_DIR}/specs/d3dcommon.py
191 ${CMAKE_SOURCE_DIR}/specs/dxgi.py
192 ${CMAKE_SOURCE_DIR}/specs/dxgitype.py
193 ${CMAKE_SOURCE_DIR}/specs/dxgiformat.py
194 ${CMAKE_SOURCE_DIR}/specs/winapi.py
195 ${CMAKE_SOURCE_DIR}/specs/stdapi.py
197 add_library (d3d11trace MODULE d3d11.def d3d11trace.cpp)
198 target_link_libraries (d3d11trace
203 set_target_properties (d3d11trace
207 install (TARGETS d3d11trace LIBRARY DESTINATION ${WRAPPER_INSTALL_DIR})
213 COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/wgltrace.py > ${CMAKE_CURRENT_BINARY_DIR}/wgltrace.cpp
218 ${CMAKE_SOURCE_DIR}/dispatch/dispatch.py
219 ${CMAKE_SOURCE_DIR}/specs/wglapi.py
220 ${CMAKE_SOURCE_DIR}/specs/wglenum.py
221 ${CMAKE_SOURCE_DIR}/specs/glapi.py
222 ${CMAKE_SOURCE_DIR}/specs/glparams.py
223 ${CMAKE_SOURCE_DIR}/specs/gltypes.py
224 ${CMAKE_SOURCE_DIR}/specs/winapi.py
225 ${CMAKE_SOURCE_DIR}/specs/stdapi.py
227 add_library (wgltrace MODULE opengl32.def
231 add_dependencies (wgltrace glproc)
232 target_link_libraries (wgltrace
238 set_target_properties (wgltrace PROPERTIES
242 install (TARGETS wgltrace LIBRARY DESTINATION ${WRAPPER_INSTALL_DIR})
248 COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/cgltrace.py > ${CMAKE_CURRENT_BINARY_DIR}/cgltrace.cpp
253 ${CMAKE_SOURCE_DIR}/specs/cglapi.py
254 ${CMAKE_SOURCE_DIR}/specs/glapi.py
255 ${CMAKE_SOURCE_DIR}/specs/glparams.py
256 ${CMAKE_SOURCE_DIR}/specs/gltypes.py
257 ${CMAKE_SOURCE_DIR}/specs/stdapi.py
260 add_library (cgltrace SHARED
265 add_dependencies (cgltrace glproc)
267 set_target_properties (cgltrace PROPERTIES
268 # OpenGL framework name
269 PREFIX "" OUTPUT_NAME "OpenGL" SUFFIX ""
270 # Specificy the version and reexport GLU symbols
271 LINK_FLAGS "-compatibility_version 1 -current_version 1.0.0 -Wl,-reexport_library,/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGLU.dylib"
274 target_link_libraries (cgltrace
279 ${CMAKE_THREAD_LIBS_INIT}
283 install (TARGETS cgltrace LIBRARY DESTINATION ${WRAPPER_INSTALL_DIR})
288 COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/glxtrace.py > ${CMAKE_CURRENT_BINARY_DIR}/glxtrace.cpp
293 ${CMAKE_SOURCE_DIR}/specs/glxapi.py
294 ${CMAKE_SOURCE_DIR}/specs/glapi.py
295 ${CMAKE_SOURCE_DIR}/specs/glparams.py
296 ${CMAKE_SOURCE_DIR}/specs/gltypes.py
297 ${CMAKE_SOURCE_DIR}/specs/stdapi.py
300 add_library (glxtrace SHARED
305 add_dependencies (glxtrace glproc)
307 set_target_properties (glxtrace PROPERTIES
308 # avoid the default "lib" prefix
310 # Prevent symbol relocations internal to our wrapper library to be
311 # overwritten by the application.
312 LINK_FLAGS "-Wl,-Bsymbolic -Wl,-Bsymbolic-functions"
315 target_link_libraries (glxtrace
321 ${CMAKE_THREAD_LIBS_INIT}
325 install (TARGETS glxtrace LIBRARY DESTINATION ${WRAPPER_INSTALL_DIR})
329 if (ENABLE_EGL AND NOT WIN32 AND NOT APPLE)
333 COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/egltrace.py > ${CMAKE_CURRENT_BINARY_DIR}/egltrace.cpp
338 ${CMAKE_SOURCE_DIR}/specs/eglapi.py
339 ${CMAKE_SOURCE_DIR}/specs/glesapi.py
340 ${CMAKE_SOURCE_DIR}/specs/glapi.py
341 ${CMAKE_SOURCE_DIR}/specs/glparams.py
342 ${CMAKE_SOURCE_DIR}/specs/gltypes.py
343 ${CMAKE_SOURCE_DIR}/specs/stdapi.py
346 add_library (egltrace SHARED
351 add_dependencies (egltrace glproc)
353 set_target_properties (egltrace PROPERTIES
354 # avoid the default "lib" prefix
356 # Prevent symbol relocations internal to our wrapper library to be
357 # overwritten by the application.
358 LINK_FLAGS "-Wl,-Bsymbolic -Wl,-Bsymbolic-functions"
361 target_link_libraries (egltrace
366 ${CMAKE_THREAD_LIBS_INIT}
370 install (TARGETS egltrace LIBRARY DESTINATION ${WRAPPER_INSTALL_DIR})