blob: 4e11532ef6b0d6a92b5c455841bdbdabc5b4979e [file] [log] [blame]
Courtney Goeltzenleuchter62b2e852014-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 Wu60a20b82015-01-10 23:15:51 +08004cmake_minimum_required(VERSION 2.8.11)
Courtney Goeltzenleuchter62b2e852014-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 Wu60a20b82015-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 Wu468e3c32014-08-04 08:03:57 +080015if (CMAKE_COMPILER_IS_GNUCC)
Chia-I Wu7c66b6b2014-12-16 00:07:11 +080016 set(COMMON_COMPILE_FLAGS "-Wall -Wextra -Wno-sign-compare -Wno-unused-parameter -Wno-missing-field-initializers")
Chia-I Wu5a782ae2014-12-19 11:34:46 +080017 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 ${COMMON_COMPILE_FLAGS}")
Chia-I Wu7c66b6b2014-12-16 00:07:11 +080018 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COMMON_COMPILE_FLAGS}")
Chia-I Wu468e3c32014-08-04 08:03:57 +080019 if (UNIX)
20 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden")
Chia-I Wucb5f2e62015-01-18 11:09:29 +080021 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden")
Chia-I Wu468e3c32014-08-04 08:03:57 +080022 endif()
23endif()
Chia-I Wu155be032014-08-02 09:14:28 +080024
Ian Elliott81ac44c2015-01-13 17:52:38 -070025if (NOT WIN32)
26 # Hard code our LunarGLASS and glslang paths for now
27 get_filename_component(GLSLANG_PREFIX ../glslang ABSOLUTE)
28 get_filename_component(LUNARGLASS_PREFIX ../LunarGLASS ABSOLUTE)
Courtney Goeltzenleuchter62b2e852014-10-03 15:34:53 -060029
Ian Elliott81ac44c2015-01-13 17:52:38 -070030 if(NOT EXISTS ${GLSLANG_PREFIX})
31 message(FATAL_ERROR "Necessary glslang components do not exist: " ${GLSLANG_PREFIX})
32 endif()
Courtney Goeltzenleuchter62b2e852014-10-03 15:34:53 -060033
Ian Elliott81ac44c2015-01-13 17:52:38 -070034 if(NOT EXISTS ${LUNARGLASS_PREFIX})
35 message(FATAL_ERROR "Necessary LunarGLASS components do not exist: " ${GLSLANG_PREFIX})
36 endif()
Courtney Goeltzenleuchter62b2e852014-10-03 15:34:53 -060037endif()
38
Chia-I Wu5f72d0f2014-08-01 11:21:23 +080039# loader: Generic XGL ICD loader
Chia-I Wu41eddec2014-08-03 09:50:47 +080040# icd: Device dependent (DD) XGL components
Courtney Goeltzenleuchter2220a3b2014-07-24 08:36:15 -060041# tests: XGL tests
Chia-I Wu41eddec2014-08-03 09:50:47 +080042add_subdirectory(loader)
Ian Elliott81ac44c2015-01-13 17:52:38 -070043if (NOT WIN32)
44 add_subdirectory(icd)
45 add_subdirectory(tests)
46endif()
47 add_subdirectory(layers)
48if (NOT WIN32)
49 add_subdirectory(demos)
50endif()
51 add_subdirectory(tools/glave)