+ install (TARGETS wgltrace RUNTIME DESTINATION wrappers)
+
+elseif (APPLE)
+ include_directories (${X11_INCLUDE_DIR})
+
+ # libGL.dylib
+ add_custom_command (
+ OUTPUT cgltrace.cpp
+ COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/cgltrace.py > ${CMAKE_CURRENT_BINARY_DIR}/cgltrace.cpp
+ DEPENDS cgltrace.py gltrace.py trace.py glxapi.py glapi.py glparams.py gltypes.py stdapi.py
+ )
+
+ add_library (cgltrace SHARED cgltrace.cpp trace_writer.cpp os_posix.cpp ${CMAKE_CURRENT_BINARY_DIR}/glproc.hpp)
+
+ set_target_properties (cgltrace PROPERTIES
+ # libGL.dylib
+ OUTPUT_NAME GL
+ # match the version
+ LINK_FLAGS "-compatibility_version 1 -current_version 1.0.0"
+ RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/wrappers
+ LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/wrappers
+ )
+
+ target_link_libraries (cgltrace dl)