blob: 441133a1f88a049d103fb198d28edc63dd6e68de [file] [log] [blame]
Courtney Goeltzenleuchtera43bbd82014-10-03 15:34:53 -06001# 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}.
Chia-I Wuc3624592015-01-10 23:15:51 +08004cmake_minimum_required(VERSION 2.8.11)
Courtney Goeltzenleuchtera43bbd82014-10-03 15:34:53 -06005project (XGL)
Courtney Goeltzenleuchter1d22ed82014-08-01 13:01:47 -06006# set (CMAKE_VERBOSE_MAKEFILE 1)
Courtney Goeltzenleuchter2220a3b2014-07-24 08:36:15 -06007
Chia-I Wuc3624592015-01-10 23:15:51 +08008set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake")
9
Courtney Goeltzenleuchter2220a3b2014-07-24 08:36:15 -060010# Header file for CMake settings
Courtney Goeltzenleuchter2220a3b2014-07-24 08:36:15 -060011include_directories("${PROJECT_SOURCE_DIR}/include")
12
Chia-I Wu155be032014-08-02 09:14:28 +080013include(FindPkgConfig)
Chia-I Wu155be032014-08-02 09:14:28 +080014
Chia-I Wu19300602014-08-04 08:03:57 +080015if (CMAKE_COMPILER_IS_GNUCC)
Chia-I Wuf0f1a0d2014-12-16 00:07:11 +080016 set(COMMON_COMPILE_FLAGS "-Wall -Wextra -Wno-sign-compare -Wno-unused-parameter -Wno-missing-field-initializers")
Chia-I Wubba8fc02014-12-19 11:34:46 +080017 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 ${COMMON_COMPILE_FLAGS}")
Chia-I Wuf0f1a0d2014-12-16 00:07:11 +080018 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COMMON_COMPILE_FLAGS}")
Chia-I Wu19300602014-08-04 08:03:57 +080019 if (UNIX)
20 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden")
Chia-I Wu33ada632015-01-18 11:09:29 +080021 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden")
Chia-I Wu19300602014-08-04 08:03:57 +080022 endif()
23endif()
Chia-I Wu155be032014-08-02 09:14:28 +080024
Courtney Goeltzenleuchtera43bbd82014-10-03 15:34:53 -060025# Hard code our LunarGLASS and glslang paths for now
26get_filename_component(GLSLANG_PREFIX ../glslang ABSOLUTE)
27get_filename_component(LUNARGLASS_PREFIX ../LunarGLASS ABSOLUTE)
28
29if(NOT EXISTS ${GLSLANG_PREFIX})
30 message(FATAL_ERROR "Necessary glslang components do not exist: " ${GLSLANG_PREFIX})
31endif()
32
33if(NOT EXISTS ${LUNARGLASS_PREFIX})
34 message(FATAL_ERROR "Necessary LunarGLASS components do not exist: " ${GLSLANG_PREFIX})
35endif()
36
Chia-I Wu5f72d0f2014-08-01 11:21:23 +080037# loader: Generic XGL ICD loader
Chia-I Wub72e87d2014-08-03 09:50:47 +080038# icd: Device dependent (DD) XGL components
Courtney Goeltzenleuchter2220a3b2014-07-24 08:36:15 -060039# tests: XGL tests
Chia-I Wub72e87d2014-08-03 09:50:47 +080040add_subdirectory(loader)
41add_subdirectory(icd)
42add_subdirectory(tests)
Courtney Goeltzenleuchter58dc67a2015-01-14 15:21:10 -070043# add_subdirectory(layers)
Chia-I Wu81d45b22014-09-13 11:12:55 +080044add_subdirectory(demos)
Courtney Goeltzenleuchter58dc67a2015-01-14 15:21:10 -070045# add_subdirectory(tools/glave)