set (CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
-# Set default built type
-if (NOT CMAKE_BUILD_TYPE)
- set (CMAKE_BUILD_TYPE Debug
- CACHE
- STRING "Choose the build type, options are: None, Debug, Release, RelWithDebInfo, or MinSizeRel."
- FORCE)
-endif (NOT CMAKE_BUILD_TYPE)
-
set (CMAKE_USE_PYTHON_VERSION 2.6)
find_package (PythonInterp REQUIRED)
find_package (PNG)
find_package (X11 REQUIRED)
- # We use GLX on MacOSX, which is in a separate library
- if (APPLE)
- find_library (X11_GL_LIB GL ${X11_LIB_SEARCH_PATH})
- set(X11_LIBRARIES ${X11_LIBRARIES} ${X11_GL_LIB})
- endif (APPLE)
else (NOT WIN32)
find_package (DirectX)
endif (NOT WIN32)
add_custom_command (
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/glproc.hpp
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/glproc.py > ${CMAKE_CURRENT_BINARY_DIR}/glproc.hpp
- DEPENDS glproc.py dispatch.py wglapi.py glxapi.py glapi.py gltypes.py stdapi.py
+ DEPENDS glproc.py dispatch.py wglapi.py glxapi.py cglapi.py glapi.py gltypes.py stdapi.py
)
if (WIN32)
add_custom_command (
OUTPUT d3d8.cpp
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/d3d8.py > ${CMAKE_CURRENT_BINARY_DIR}/d3d8.cpp
- DEPENDS d3d8.py trace.py d3d8types.py d3d8caps.py d3dshader.py winapi.py stdapi.py
+ DEPENDS d3d8.py trace.py d3d8types.py d3d8caps.py winapi.py stdapi.py
)
- add_library (d3d8 SHARED d3d8.def d3d8.cpp trace_write.cpp os_win32.cpp)
+ add_library (d3d8 SHARED d3d8.def d3d8.cpp d3dshader.cpp trace_write.cpp os_win32.cpp)
set_target_properties (d3d8
PROPERTIES PREFIX ""
RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/wrappers
add_custom_command (
OUTPUT d3d9.cpp
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/d3d9.py > ${CMAKE_CURRENT_BINARY_DIR}/d3d9.cpp
- DEPENDS d3d9.py trace.py d3d9types.py d3d9caps.py d3dshader.py winapi.py stdapi.py
+ DEPENDS d3d9.py trace.py d3d9types.py d3d9caps.py winapi.py stdapi.py
)
- add_library (d3d9 SHARED d3d9.def d3d9.cpp trace_write.cpp os_win32.cpp)
+ add_library (d3d9 SHARED d3d9.def d3d9.cpp d3dshader.cpp trace_write.cpp os_win32.cpp)
set_target_properties (d3d9
PROPERTIES PREFIX ""
RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/wrappers
endif (MINGW)
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_write.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)
+
+ # Symbolic link from system's libGL.dylib
+ add_custom_command (
+ TARGET cgltrace
+ COMMAND ln -sf /System/Library/Frameworks/OpenGL.framework/Libraries/libGL.dylib ${PROJECT_BINARY_DIR}/wrappers/libGL.system.dylib
+ )
+
+ install (TARGETS cgltrace LIBRARY DESTINATION lib)
else ()
include_directories (${X11_INCLUDE_DIR})
# Prevent symbol relocations internal to our wrapper library to be
# overwritten by the application.
- if (NOT APPLE)
- set_target_properties (glxtrace PROPERTIES
- LINK_FLAGS "-Wl,-Bsymbolic -Wl,-Bsymbolic-functions"
- )
- endif (NOT APPLE)
+ set_target_properties (glxtrace PROPERTIES
+ LINK_FLAGS "-Wl,-Bsymbolic -Wl,-Bsymbolic-functions"
+ )
target_link_libraries (glxtrace dl)
)
add_custom_command (
- OUTPUT glretrace_state.cpp
- COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/glstate.py > ${CMAKE_CURRENT_BINARY_DIR}/glretrace_state.cpp
+ OUTPUT glstate_params.cpp
+ COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/glstate.py > ${CMAKE_CURRENT_BINARY_DIR}/glstate_params.cpp
DEPENDS glstate.py glparams.py gltypes.py stdapi.py
)
add_executable (glretrace
glretrace_gl.cpp
+ glretrace_cgl.cpp
glretrace_glx.cpp
glretrace_wgl.cpp
glretrace_main.cpp
- glretrace_state.cpp
+ glstate.cpp
+ glstate_params.cpp
retrace.cpp
${glws}
image.cpp
)
if (NOT WIN32)
- target_link_libraries (glretrace ${X11_LIBRARIES})
+ target_link_libraries (glretrace ${X11_X11_LIB})
+
+ # We use GLX on MacOSX, which is in a separate library
+ if (APPLE)
+ find_library (X11_GL_LIB GL ${X11_LIB_SEARCH_PATH})
+ find_library (APPLICATIONSERVICES ApplicationServices)
+ target_link_libraries (glretrace ${X11_GL_LIB} ${APPLICATIONSERVICES})
+ endif (APPLE)
endif (NOT WIN32)
install (TARGETS glretrace RUNTIME DESTINATION bin)
##############################################################################
# Packaging
+install (FILES LICENSE README TODO DESTINATION doc)
+
set (CPACK_PACKAGE_VERSION_MAJOR "1")
set (CPACK_PACKAGE_VERSION_MINOR "0")