Courtney Goeltzenleuchter | a43bbd8 | 2014-10-03 15:34:53 -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}. |
Chia-I Wu | c362459 | 2015-01-10 23:15:51 +0800 | [diff] [blame] | 4 | cmake_minimum_required(VERSION 2.8.11) |
Courtney Goeltzenleuchter | a43bbd8 | 2014-10-03 15:34:53 -0600 | [diff] [blame] | 5 | project (XGL) |
Courtney Goeltzenleuchter | 1d22ed8 | 2014-08-01 13:01:47 -0600 | [diff] [blame] | 6 | # set (CMAKE_VERBOSE_MAKEFILE 1) |
Courtney Goeltzenleuchter | 2220a3b | 2014-07-24 08:36:15 -0600 | [diff] [blame] | 7 | |
Chia-I Wu | c362459 | 2015-01-10 23:15:51 +0800 | [diff] [blame] | 8 | set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake") |
| 9 | |
Courtney Goeltzenleuchter | 2220a3b | 2014-07-24 08:36:15 -0600 | [diff] [blame] | 10 | # Header file for CMake settings |
Courtney Goeltzenleuchter | 2220a3b | 2014-07-24 08:36:15 -0600 | [diff] [blame] | 11 | include_directories("${PROJECT_SOURCE_DIR}/include") |
| 12 | |
Chia-I Wu | 155be03 | 2014-08-02 09:14:28 +0800 | [diff] [blame] | 13 | include(FindPkgConfig) |
Chia-I Wu | 155be03 | 2014-08-02 09:14:28 +0800 | [diff] [blame] | 14 | |
Chia-I Wu | 084c886 | 2015-02-17 09:55:34 -0700 | [diff] [blame] | 15 | if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang") |
Ian Elliott | 661dc37 | 2015-02-13 14:04:01 -0700 | [diff] [blame] | 16 | set(COMMON_COMPILE_FLAGS "-Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers") |
Tony Barbour | f435160 | 2015-02-05 14:14:33 -0700 | [diff] [blame] | 17 | set(COMMON_COMPILE_FLAGS "${COMMON_COMPILE_FLAGS} -fno-strict-aliasing -fno-builtin-memcmp") |
Chia-I Wu | bba8fc0 | 2014-12-19 11:34:46 +0800 | [diff] [blame] | 18 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 ${COMMON_COMPILE_FLAGS}") |
Chia-I Wu | f0f1a0d | 2014-12-16 00:07:11 +0800 | [diff] [blame] | 19 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COMMON_COMPILE_FLAGS}") |
Chia-I Wu | 1930060 | 2014-08-04 08:03:57 +0800 | [diff] [blame] | 20 | if (UNIX) |
| 21 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden") |
Chia-I Wu | 33ada63 | 2015-01-18 11:09:29 +0800 | [diff] [blame] | 22 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden") |
Chia-I Wu | 1930060 | 2014-08-04 08:03:57 +0800 | [diff] [blame] | 23 | endif() |
| 24 | endif() |
Chia-I Wu | 155be03 | 2014-08-02 09:14:28 +0800 | [diff] [blame] | 25 | |
Ian Elliott | 2d4ab1e | 2015-01-13 17:52:38 -0700 | [diff] [blame] | 26 | if (NOT WIN32) |
| 27 | # Hard code our LunarGLASS and glslang paths for now |
| 28 | get_filename_component(GLSLANG_PREFIX ../glslang ABSOLUTE) |
| 29 | get_filename_component(LUNARGLASS_PREFIX ../LunarGLASS ABSOLUTE) |
Courtney Goeltzenleuchter | a43bbd8 | 2014-10-03 15:34:53 -0600 | [diff] [blame] | 30 | |
Ian Elliott | 2d4ab1e | 2015-01-13 17:52:38 -0700 | [diff] [blame] | 31 | if(NOT EXISTS ${GLSLANG_PREFIX}) |
| 32 | message(FATAL_ERROR "Necessary glslang components do not exist: " ${GLSLANG_PREFIX}) |
| 33 | endif() |
Courtney Goeltzenleuchter | a43bbd8 | 2014-10-03 15:34:53 -0600 | [diff] [blame] | 34 | |
Ian Elliott | 2d4ab1e | 2015-01-13 17:52:38 -0700 | [diff] [blame] | 35 | if(NOT EXISTS ${LUNARGLASS_PREFIX}) |
| 36 | message(FATAL_ERROR "Necessary LunarGLASS components do not exist: " ${GLSLANG_PREFIX}) |
| 37 | endif() |
Jon Ashburn | 1a97d6c | 2015-03-18 09:29:11 -0600 | [diff] [blame] | 38 | if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") |
| 39 | set(PYTHON_CMD "python3") |
| 40 | endif() |
| 41 | else() |
| 42 | set(PYTHON_CMD "py") |
Courtney Goeltzenleuchter | a43bbd8 | 2014-10-03 15:34:53 -0600 | [diff] [blame] | 43 | endif() |
| 44 | |
Chia-I Wu | 5f72d0f | 2014-08-01 11:21:23 +0800 | [diff] [blame] | 45 | # loader: Generic XGL ICD loader |
Chia-I Wu | b72e87d | 2014-08-03 09:50:47 +0800 | [diff] [blame] | 46 | # icd: Device dependent (DD) XGL components |
Courtney Goeltzenleuchter | 2220a3b | 2014-07-24 08:36:15 -0600 | [diff] [blame] | 47 | # tests: XGL tests |
Chia-I Wu | b72e87d | 2014-08-03 09:50:47 +0800 | [diff] [blame] | 48 | add_subdirectory(loader) |
David Pinedo | 691c6b2 | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 49 | add_subdirectory(icd) |
Ian Elliott | 2d4ab1e | 2015-01-13 17:52:38 -0700 | [diff] [blame] | 50 | if (NOT WIN32) |
Ian Elliott | 2d4ab1e | 2015-01-13 17:52:38 -0700 | [diff] [blame] | 51 | add_subdirectory(tests) |
| 52 | endif() |
Chia-I Wu | 3bf69c7 | 2015-03-28 09:59:21 +0800 | [diff] [blame] | 53 | #add_subdirectory(layers) |
Piers Daniell | 188f820 | 2015-02-24 13:58:47 -0700 | [diff] [blame] | 54 | add_subdirectory(libs) |
David Pinedo | 691c6b2 | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 55 | add_subdirectory(demos) |
Chia-I Wu | 3bf69c7 | 2015-03-28 09:59:21 +0800 | [diff] [blame] | 56 | #add_subdirectory(tools/glave) |