John Kessenich | d49d524 | 2015-06-26 16:29:10 -0600 | [diff] [blame] | 1 | cmake_minimum_required(VERSION 2.8) |
| 2 | |
Lei Zhang | 414eb60 | 2016-03-04 16:22:34 -0500 | [diff] [blame] | 3 | enable_testing() |
| 4 | |
Chad Versace | 4cbf748 | 2015-08-31 14:27:04 -0700 | [diff] [blame] | 5 | set(CMAKE_INSTALL_PREFIX "install" CACHE STRING "prefix") |
John Kessenich | d49d524 | 2015-06-26 16:29:10 -0600 | [diff] [blame] | 6 | |
| 7 | project(glslang) |
| 8 | |
| 9 | if(WIN32) |
John Kessenich | d49d524 | 2015-06-26 16:29:10 -0600 | [diff] [blame] | 10 | include(ChooseMSVCCRT.cmake) |
baldurk | 876a0e3 | 2015-11-16 18:03:28 +0100 | [diff] [blame] | 11 | add_definitions(-DGLSLANG_OSINCLUDE_WIN32) |
John Kessenich | d49d524 | 2015-06-26 16:29:10 -0600 | [diff] [blame] | 12 | elseif(UNIX) |
| 13 | add_definitions(-fPIC) |
baldurk | 876a0e3 | 2015-11-16 18:03:28 +0100 | [diff] [blame] | 14 | add_definitions(-DGLSLANG_OSINCLUDE_UNIX) |
John Kessenich | d49d524 | 2015-06-26 16:29:10 -0600 | [diff] [blame] | 15 | else(WIN32) |
Eric Engestrom | 6a6d6dd | 2016-04-03 01:17:13 +0100 | [diff] [blame^] | 16 | message("unknown platform") |
John Kessenich | d49d524 | 2015-06-26 16:29:10 -0600 | [diff] [blame] | 17 | endif(WIN32) |
| 18 | |
| 19 | if(CMAKE_COMPILER_IS_GNUCXX) |
| 20 | add_definitions(-std=c++11) |
| 21 | elseif(${CMAKE_CXX_COMPILER_ID} MATCHES "Clang") |
| 22 | add_definitions(-std=c++11) |
| 23 | endif() |
| 24 | |
Lei Zhang | 414eb60 | 2016-03-04 16:22:34 -0500 | [diff] [blame] | 25 | # We depend on these for later projects, so they should come first. |
| 26 | add_subdirectory(External) |
| 27 | |
John Kessenich | d49d524 | 2015-06-26 16:29:10 -0600 | [diff] [blame] | 28 | add_subdirectory(glslang) |
| 29 | add_subdirectory(OGLCompilersDLL) |
| 30 | add_subdirectory(StandAlone) |
| 31 | add_subdirectory(SPIRV) |
Lei Zhang | 414eb60 | 2016-03-04 16:22:34 -0500 | [diff] [blame] | 32 | |
| 33 | add_subdirectory(gtests) |