Courtney Goeltzenleuchter | 2220a3b | 2014-07-24 08:36:15 -0600 | [diff] [blame] | 1 | # The name of our project is "XGL". CMakeLists files in this project can |
| 2 | # refer to the root source directory of the project as ${XGL_SOURCE_DIR} and |
| 3 | # to the root binary directory of the project as ${XGL_BINARY_DIR}. |
| 4 | cmake_minimum_required (VERSION 2.6) |
| 5 | project (XGL) |
| 6 | set (XGL_VERSION_MAJOR 0) |
| 7 | set (XGL_VERSION_MINOR 1) |
Courtney Goeltzenleuchter | 1d22ed8 | 2014-08-01 13:01:47 -0600 | [diff] [blame] | 8 | # set (CMAKE_VERBOSE_MAKEFILE 1) |
Courtney Goeltzenleuchter | 2220a3b | 2014-07-24 08:36:15 -0600 | [diff] [blame] | 9 | |
| 10 | # Header file for CMake settings |
| 11 | configure_file ( |
| 12 | "${PROJECT_SOURCE_DIR}/include/XGLConfig.h.in" |
| 13 | "${PROJECT_BINARY_DIR}/XGLConfig.h" |
| 14 | ) |
| 15 | |
| 16 | include_directories("${PROJECT_BINARY_DIR}") |
Courtney Goeltzenleuchter | 2220a3b | 2014-07-24 08:36:15 -0600 | [diff] [blame] | 17 | include_directories("${PROJECT_SOURCE_DIR}/include") |
| 18 | |
Chia-I Wu | 155be03 | 2014-08-02 09:14:28 +0800 | [diff] [blame] | 19 | |
| 20 | include(FindPkgConfig) |
| 21 | pkg_check_modules(LIBDRM REQUIRED libdrm) |
| 22 | if (NOT LIBDRM_FOUND) |
| 23 | message(FATAL_ERROR "libdrm not found") |
| 24 | endif() |
| 25 | |
Chia-I Wu | 1930060 | 2014-08-04 08:03:57 +0800 | [diff] [blame^] | 26 | if (CMAKE_COMPILER_IS_GNUCC) |
| 27 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -Werror -Wall -Wextra -Wno-sign-compare -Wno-unused-parameter") |
| 28 | if (UNIX) |
| 29 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden") |
| 30 | endif() |
| 31 | endif() |
Chia-I Wu | 155be03 | 2014-08-02 09:14:28 +0800 | [diff] [blame] | 32 | |
Courtney Goeltzenleuchter | cec7295 | 2014-08-01 18:06:40 -0600 | [diff] [blame] | 33 | set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake") |
| 34 | include(GetGitRevisionDescription) |
| 35 | get_git_head_revision(GIT_REFSPEC GIT_SHA1) |
Chia-I Wu | 763e559 | 2014-08-01 15:31:12 +0800 | [diff] [blame] | 36 | |
Chia-I Wu | 5f72d0f | 2014-08-01 11:21:23 +0800 | [diff] [blame] | 37 | # loader: Generic XGL ICD loader |
Chia-I Wu | b72e87d | 2014-08-03 09:50:47 +0800 | [diff] [blame] | 38 | # icd: Device dependent (DD) XGL components |
Courtney Goeltzenleuchter | 2220a3b | 2014-07-24 08:36:15 -0600 | [diff] [blame] | 39 | # tests: XGL tests |
Chia-I Wu | b72e87d | 2014-08-03 09:50:47 +0800 | [diff] [blame] | 40 | add_subdirectory(loader) |
| 41 | add_subdirectory(icd) |
| 42 | add_subdirectory(tests) |