summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
blob: e7ccaa19395cf927755685be422ae84dfe500c06 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
cmake_minimum_required(VERSION 2.6)

INCLUDE (CheckCCompilerFlag)
INCLUDE (CheckFunctionExists)
INCLUDE (CheckIncludeFile)

project (piglit)

include(${CMAKE_ROOT}/Modules/FindOpenGL.cmake)
include(${CMAKE_ROOT}/Modules/FindTIFF.cmake)
include(${CMAKE_ROOT}/Modules/FindGLUT.cmake)
include(${CMAKE_ROOT}/Modules/FindPNG.cmake)

CHECK_C_COMPILER_FLAG("-Wall" C_COMPILER_FLAG_WALL)
IF (C_COMPILER_FLAG_WALL)
	SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
ENDIF (C_COMPILER_FLAG_WALL)

FIND_LIBRARY( GLEW_glew_LIBRARY GLEW
	/usr/lib
)

FIND_PATH( GLEW_INCLUDE_DIR GL/glew.h
      /usr/include/GL
)

FIND_LIBRARY(OPENGL_egl_LIBRARY
      NAMES EGL
      PATHS /usr/lib
)

set(EXECUTABLE_OUTPUT_PATH ${piglit_SOURCE_DIR}/bin)
set(LIBRARY_OUTPUT_PATH ${piglit_SOURCE_DIR}/bin)

add_subdirectory (tests)

check_function_exists(strchrnul HAVE_STRCHRNUL)
check_function_exists(fopen_s   HAVE_FOPEN_S)

check_include_file(sys/types.h HAVE_SYS_TYPES_H)
check_include_file(sys/stat.h  HAVE_SYS_STAT_H)
check_include_file(unistd.h    HAVE_UNISTD_H)
check_include_file(fcntl.h     HAVE_FCNTL_H)

configure_file(
	"${piglit_SOURCE_DIR}/tests/util/config.h.in"
	"${piglit_SOURCE_DIR}/tests/util/config.h"
)