]> git.cworth.org Git - apitrace/blobdiff - CMakeLists.txt
Grow gl size helpers.
[apitrace] / CMakeLists.txt
index 6f2ccfd23ef40311502f90f2906dc208ca8b75b7..26d3d023bbf664836280757f80a8c0a42225e88f 100644 (file)
@@ -1,9 +1,17 @@
-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)
@@ -21,26 +29,8 @@ find_path (GLEW_INCLUDE_DIR GL/glew.h
 )
 
 if (WIN32)
-       # Nobody likes to include windows.h:
-       # - Microsoft's GL/gl.h header depends on windows.h but doesn't include it;
-       # - GLEW temporarily defines the necessary defines but undefines them later
-       # - certain GLUT distributions don't include it;
-       # - most of our programs are meant to be portable so don't include it.
-       #
-       # We could try to replicate the windows.h definitions required by
-       # GL/gl.h, but the build time savings don't compensate the constant
-       # headaches that brings, so instead we force windows.h to be included
-       # on every file.
-       if (MSVC)
-               add_definitions (-FIwindows.h)
-       else (MSVC)
-               add_definitions (--include windows.h)
-       endif (MSVC)
-
        # MSVC & MinGW only define & use APIENTRY
        add_definitions (-DGLAPIENTRY=__stdcall)
-
-       link_libraries (winmm)
 endif (WIN32)
 
 if (MSVC)
@@ -93,35 +83,35 @@ else (NOT ZLIB_FOUND)
        link_libraries (${ZLIB_LIBRARIES})
 endif (NOT ZLIB_FOUND)
 
-include_directories (${CMAKE_CURRENT_SOURCE_DIR})
+include_directories (${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/include)
 
 if (WIN32)
        # Put wrappers in a separate directory
        set (LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/wrappers)
 
        # d3d8.dll
-       if (DirectX_D3D8_FOUND)
-               include_directories (${DirectX_D3D8_INCLUDE_DIR})
-               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
-               )
-               add_library (d3d8 SHARED d3d8.def d3d8.cpp log.cpp os_win32.cpp)
-               set_target_properties (d3d8 PROPERTIES PREFIX "")
-       endif (DirectX_D3D8_FOUND)
+    #if (DirectX_D3D8_FOUND)
+       #       include_directories (${DirectX_D3D8_INCLUDE_DIR})
+       #       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 winapi.py stdapi.py
+       #       )
+       #       add_library (d3d8 SHARED d3d8.def d3d8.cpp log.cpp os_win32.cpp)
+       #       set_target_properties (d3d8 PROPERTIES PREFIX "")
+       #endif (DirectX_D3D8_FOUND)
 
        # d3d9.dll
-       if (DirectX_D3DX9_FOUND)
-               include_directories (${DirectX_D3DX9_INCLUDE_DIR})
-               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
-               )
-               add_library (d3d9 SHARED d3d9.def d3d9.cpp log.cpp os_win32.cpp)
-               set_target_properties (d3d9 PROPERTIES PREFIX "")
-       endif (DirectX_D3DX9_FOUND)
+    #if (DirectX_D3DX9_FOUND)
+       #       include_directories (${DirectX_D3DX9_INCLUDE_DIR})
+       #       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 winapi.py stdapi.py
+       #       )
+       #       add_library (d3d9 SHARED d3d9.def d3d9.cpp log.cpp os_win32.cpp)
+       #       set_target_properties (d3d9 PROPERTIES PREFIX "")
+       #endif (DirectX_D3DX9_FOUND)
 
        # d3d10.dll
        #if (DirectX_D3D10_FOUND)
@@ -129,7 +119,7 @@ if (WIN32)
        #       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)
        #       set_target_properties (d3d10 PROPERTIES PREFIX "")
@@ -139,7 +129,7 @@ if (WIN32)
        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
+               DEPENDS opengl32.py trace.py wglapi.py glenum.py glapi.py glenum.py winapi.py stdapi.py
        )
        add_library (opengl SHARED opengl32.def opengl32.cpp log.cpp os_win32.cpp)
        set_target_properties (opengl PROPERTIES
@@ -155,7 +145,7 @@ else ()
        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 dl.py base.py
+               DEPENDS glxtrace.py trace.py glapi.py glenum.py stdapi.py
        )
 
        add_library (glxtrace SHARED glxtrace.cpp log.cpp os_posix.cpp)
@@ -170,7 +160,7 @@ if (GLEW_INCLUDE_DIR)
        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 dl.py base.py
+               DEPENDS glretrace.py glapi.py glenum.py stdapi.py
        )
 
        include_directories (