-cmake_minimum_required (VERSION 2.6)
+cmake_minimum_required (VERSION 2.8)
project (apitrace)
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)
+
find_package (PythonInterp REQUIRED)
find_package (OpenGL REQUIRED)
find_package (ZLIB)
add_definitions (-wd4244) # conversion from 'type1' to 'type2', possible loss of data
add_definitions (-wd4505) # unreferenced local function has been removed
add_definitions (-wd4800) # forcing value to bool 'true' or 'false' (performance warning)
+ # XXX: it's safer to use ssize_t everywhere instead of disabling warning
+ add_definitions (-wd4018) # signed/unsigned mismatch
# Use static runtime
# http://www.cmake.org/Wiki/CMake_FAQ#How_can_I_build_my_MSVC_application_with_a_static_runtime.3F
endif (${flag_var} MATCHES "/MD")
endforeach (flag_var)
else ()
+ # Adjust warnings
add_definitions (-Wall)
+ # XXX: it's safer to use ssize_t everywhere instead of disabling warning
+ add_definitions (-Wno-sign-compare) # comparison between signed and unsigned integer expressions
endif ()
# Use bundled ZLIB if system one can't be found
# add_custom_command (
# OUTPUT d3d8.cpp
# COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/d3d8.py > ${CMAKE_CURRENT_BINARY_DIR}/d3d8.cpp
- # DEPENDS d3d8.py d3d8types.py d3d8caps.py windows.py base.py
+ # DEPENDS d3d8.py d3d8types.py d3d8caps.py winapi.py stdapi.py
# )
- # add_library (d3d8 SHARED d3d8.def d3d8.cpp log.cpp os_win32.cpp)
+ # add_library (d3d8 SHARED d3d8.def d3d8.cpp trace_write.cpp os_win32.cpp)
# set_target_properties (d3d8 PROPERTIES PREFIX "")
#endif (DirectX_D3D8_FOUND)
# add_custom_command (
# OUTPUT d3d9.cpp
# COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/d3d9.py > ${CMAKE_CURRENT_BINARY_DIR}/d3d9.cpp
- # DEPENDS d3d9.py d3d9types.py d3d9caps.py d3dshader.py windows.py base.py
+ # DEPENDS d3d9.py d3d9types.py d3d9caps.py d3dshader.py winapi.py stdapi.py
# )
- # add_library (d3d9 SHARED d3d9.def d3d9.cpp log.cpp os_win32.cpp)
+ # add_library (d3d9 SHARED d3d9.def d3d9.cpp trace_write.cpp os_win32.cpp)
# set_target_properties (d3d9 PROPERTIES PREFIX "")
#endif (DirectX_D3DX9_FOUND)
# add_custom_command (
# OUTPUT d3d10.cpp
# COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/d3d10misc.py > ${CMAKE_CURRENT_BINARY_DIR}/d3d10.cpp
- # DEPENDS d3d10misc.py windows.py base.py
+ # DEPENDS d3d10misc.py winapi.py stdapi.py
# )
- # add_library (d3d10 SHARED d3d10.def d3d10.cpp log.cpp os_win32.cpp)
+ # add_library (d3d10 SHARED d3d10.def d3d10.cpp trace_write.cpp os_win32.cpp)
# set_target_properties (d3d10 PROPERTIES PREFIX "")
#endif (DirectX_D3D10_FOUND)
# opengl32.dll
add_custom_command (
OUTPUT opengl32.cpp
- COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/opengl32.py > ${CMAKE_CURRENT_BINARY_DIR}/opengl32.cpp
- DEPENDS opengl32.py trace.py wglapi.py glapi.py windows.py base.py
+ COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/wgltrace.py > ${CMAKE_CURRENT_BINARY_DIR}/opengl32.cpp
+ DEPENDS wgltrace.py trace.py wglapi.py glapi.py glenum.py winapi.py stdapi.py
)
- add_library (opengl SHARED opengl32.def opengl32.cpp log.cpp os_win32.cpp)
+ add_library (opengl SHARED opengl32.def opengl32.cpp trace_write.cpp os_win32.cpp)
set_target_properties (opengl PROPERTIES
PREFIX ""
OUTPUT_NAME opengl32)
add_custom_command (
OUTPUT glxtrace.cpp
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/glxtrace.py > ${CMAKE_CURRENT_BINARY_DIR}/glxtrace.cpp
- DEPENDS glxtrace.py trace.py glapi.py base.py
+ DEPENDS glxtrace.py trace.py glxapi.py glapi.py glenum.py stdapi.py
)
- add_library (glxtrace SHARED glxtrace.cpp log.cpp os_posix.cpp)
+ add_library (glxtrace SHARED glxtrace.cpp trace_write.cpp os_posix.cpp)
set_target_properties (glxtrace PROPERTIES PREFIX "")
target_link_libraries (glxtrace dl)
endif ()
add_custom_command (
OUTPUT glretrace.cpp
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/glretrace.py > ${CMAKE_CURRENT_BINARY_DIR}/glretrace.cpp
- DEPENDS glretrace.py glapi.py base.py
+ DEPENDS glretrace.py retrace.py glapi.py glenum.py stdapi.py
)
include_directories (