1 cmake_minimum_required (VERSION 2.8)
3 project (apitrace-tests)
5 find_package (OpenGL REQUIRED)
8 find_library (GLEW_glew_LIBRARY GLEW
12 find_path (GLEW_INCLUDE_DIR GL/glew.h
21 # Nobody likes to include windows.h:
22 # - Microsoft's GL/gl.h header depends on windows.h but doesn't include it;
23 # - GLEW temporarily defines the necessary defines but undefines them later
24 # - certain GLUT distributions don't include it;
25 # - most of our programs are meant to be portable so don't include it.
27 # We could try to replicate the windows.h definitions required by
28 # GL/gl.h, but the build time savings don't compensate the constant
29 # headaches that brings, so instead we force windows.h to be included
32 add_definitions (-FIwindows.h)
34 add_definitions (--include windows.h)
37 # Don't define min/max macros
38 add_definitions (-DNOMINMAX)
40 # MSVC & MinGW only define & use APIENTRY
41 add_definitions (-DGLAPIENTRY=__stdcall)
45 # Enable math constants defines
46 add_definitions (-D_USE_MATH_DEFINES)
48 # Silence several MSVC pedantic warnings
49 add_definitions (-D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS)
50 add_definitions (-D_SCL_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS)
51 add_definitions (-wd4244) # conversion' conversion from 'type1' to 'type2', possible loss of data
55 set (APITRACE_BINARY_DIR "${CMAKE_BINARY_DIR}/.." CACHE PATH "apitrace build directory")
60 add_subdirectory (apps)