CMakeLists.txt 1.16 KB
Newer Older
Xavier Chantry's avatar
Xavier Chantry committed
1 2
cmake_minimum_required(VERSION 2.6)

Eric Anholt's avatar
Eric Anholt committed
3
INCLUDE (CheckCCompilerFlag)
4
INCLUDE (CheckFunctionExists)
5
INCLUDE (CheckIncludeFile)
Nicolai Hähnle's avatar
Nicolai Hähnle committed
6 7 8 9 10 11

project (piglit)

include(${CMAKE_ROOT}/Modules/FindOpenGL.cmake)
include(${CMAKE_ROOT}/Modules/FindTIFF.cmake)
include(${CMAKE_ROOT}/Modules/FindGLUT.cmake)
12
include(${CMAKE_ROOT}/Modules/FindPNG.cmake)
Nicolai Hähnle's avatar
Nicolai Hähnle committed
13

Eric Anholt's avatar
Eric Anholt committed
14 15 16 17 18
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)

19 20 21 22 23 24 25 26
FIND_LIBRARY( GLEW_glew_LIBRARY GLEW
	/usr/lib
)

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

27 28 29 30 31
FIND_LIBRARY(OPENGL_egl_LIBRARY
      NAMES EGL
      PATHS /usr/lib
)

32 33 34
set(EXECUTABLE_OUTPUT_PATH ${piglit_SOURCE_DIR}/bin)
set(LIBRARY_OUTPUT_PATH ${piglit_SOURCE_DIR}/bin)

Nicolai Hähnle's avatar
Nicolai Hähnle committed
35
add_subdirectory (tests)
36 37

check_function_exists(strchrnul HAVE_STRCHRNUL)
38 39 40 41 42 43
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)
44 45 46 47 48

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