Courtney Goeltzenleuchter | a8c0628 | 2015-04-14 14:55:44 -0600 | [diff] [blame] | 1 | # The name of our project is "VULKAN". CMakeLists files in this project can |
| 2 | # refer to the root source directory of the project as ${VULKAN_SOURCE_DIR} and |
| 3 | # to the root binary directory of the project as ${VULKAN_BINARY_DIR}. |
Chia-I Wu | 60a20b8 | 2015-01-10 23:15:51 +0800 | [diff] [blame] | 4 | cmake_minimum_required(VERSION 2.8.11) |
Courtney Goeltzenleuchter | a8c0628 | 2015-04-14 14:55:44 -0600 | [diff] [blame] | 5 | project (VULKAN) |
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 | |
Lenny Komow | a5333ee | 2016-11-07 10:44:23 -0700 | [diff] [blame] | 8 | # The API_NAME allows renaming builds to avoid conflicts with installed SDKs |
David Pinedo | dba967a | 2015-07-09 12:44:38 -0600 | [diff] [blame] | 9 | # The MAJOR number of the version we're building, used in naming |
Lenny Komow | a5333ee | 2016-11-07 10:44:23 -0700 | [diff] [blame] | 10 | # <api-name>-<major>.dll (and other files). |
| 11 | set(API_NAME "Vulkan" CACHE STRING "API name to use when building") |
David Pinedo | c7a0e99 | 2016-01-06 16:34:27 -0700 | [diff] [blame] | 12 | set(MAJOR "1") |
Lenny Komow | a5333ee | 2016-11-07 10:44:23 -0700 | [diff] [blame] | 13 | string(TOLOWER ${API_NAME} API_LOWERCASE) |
David Pinedo | dba967a | 2015-07-09 12:44:38 -0600 | [diff] [blame] | 14 | |
Tony Barbour | 2f18b29 | 2016-02-25 15:44:10 -0700 | [diff] [blame] | 15 | find_package(PythonInterp 3 REQUIRED) |
Mark Lobodzinski | 7b3b819 | 2015-12-15 09:25:29 -0700 | [diff] [blame] | 16 | |
Tony Barbour | 3808074 | 2016-12-07 11:18:19 -0700 | [diff] [blame] | 17 | if(CMAKE_SYSTEM_NAME STREQUAL "Linux") |
Jason Ekstrand | 0d96642 | 2016-02-20 08:13:28 -0800 | [diff] [blame] | 18 | option(BUILD_WSI_XCB_SUPPORT "Build XCB WSI support" ON) |
Tony Barbour | b38f69d | 2016-04-12 13:35:51 -0600 | [diff] [blame] | 19 | option(BUILD_WSI_XLIB_SUPPORT "Build Xlib WSI support" ON) |
Tony Barbour | 5c8ad03 | 2016-12-07 10:19:21 -0700 | [diff] [blame] | 20 | option(BUILD_WSI_WAYLAND_SUPPORT "Build Wayland WSI support" ON) |
| 21 | option(BUILD_WSI_MIR_SUPPORT "Build Mir WSI support" ON) |
Tony Barbour | 685f9c0 | 2016-12-07 12:12:45 -0700 | [diff] [blame^] | 22 | option(DEMOS_WSI_SELECTION "Select WSI to use to build demos" XCB) |
Mark Lobodzinski | 28214d9 | 2015-11-25 13:26:15 -0700 | [diff] [blame] | 23 | endif() |
| 24 | |
Raul Tambre | cc2786d | 2016-10-01 13:20:32 +0300 | [diff] [blame] | 25 | set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake") |
Chia-I Wu | 60a20b8 | 2015-01-10 23:15:51 +0800 | [diff] [blame] | 26 | |
Mark Lobodzinski | bae3bd6 | 2016-11-18 14:44:37 -0700 | [diff] [blame] | 27 | set(SCRIPTS_DIR "${CMAKE_SOURCE_DIR}/scripts") |
| 28 | |
Courtney Goeltzenleuchter | 2220a3b | 2014-07-24 08:36:15 -0600 | [diff] [blame] | 29 | # Header file for CMake settings |
Courtney Goeltzenleuchter | 2220a3b | 2014-07-24 08:36:15 -0600 | [diff] [blame] | 30 | include_directories("${PROJECT_SOURCE_DIR}/include") |
| 31 | |
Tony Barbour | c6955a3 | 2015-12-16 14:57:33 -0700 | [diff] [blame] | 32 | if(NOT WIN32) |
| 33 | include(FindPkgConfig) |
| 34 | endif() |
Chia-I Wu | 155be03 | 2014-08-02 09:14:28 +0800 | [diff] [blame] | 35 | |
Chia-I Wu | 93d0618 | 2015-02-17 09:55:34 -0700 | [diff] [blame] | 36 | if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang") |
Ian Elliott | 3fdadc8 | 2015-02-13 14:04:01 -0700 | [diff] [blame] | 37 | set(COMMON_COMPILE_FLAGS "-Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers") |
Tony Barbour | 42869bc | 2015-02-05 14:14:33 -0700 | [diff] [blame] | 38 | set(COMMON_COMPILE_FLAGS "${COMMON_COMPILE_FLAGS} -fno-strict-aliasing -fno-builtin-memcmp") |
Chia-I Wu | 5a782ae | 2014-12-19 11:34:46 +0800 | [diff] [blame] | 39 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 ${COMMON_COMPILE_FLAGS}") |
Karl Schultz | e6917ca | 2016-05-12 10:28:57 -0600 | [diff] [blame] | 40 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COMMON_COMPILE_FLAGS} -std=c++11 -fno-rtti") |
Chia-I Wu | 468e3c3 | 2014-08-04 08:03:57 +0800 | [diff] [blame] | 41 | if (UNIX) |
| 42 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden") |
Chia-I Wu | cb5f2e6 | 2015-01-18 11:09:29 +0800 | [diff] [blame] | 43 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden") |
Chia-I Wu | 468e3c3 | 2014-08-04 08:03:57 +0800 | [diff] [blame] | 44 | endif() |
| 45 | endif() |
Chia-I Wu | 155be03 | 2014-08-02 09:14:28 +0800 | [diff] [blame] | 46 | |
Karl Schultz | e6917ca | 2016-05-12 10:28:57 -0600 | [diff] [blame] | 47 | if(WIN32) |
| 48 | # Disable RTTI |
| 49 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /GR-") |
| 50 | endif() |
| 51 | |
Dustin Graves | 7ef139e | 2016-03-15 15:39:08 -0600 | [diff] [blame] | 52 | if(NOT WIN32) |
Norbert Nopper | 886977f | 2016-09-08 09:31:36 +0200 | [diff] [blame] | 53 | if (BUILD_WSI_XCB_SUPPORT) |
| 54 | find_package(XCB REQUIRED) |
| 55 | endif() |
Dustin Graves | 7ef139e | 2016-03-15 15:39:08 -0600 | [diff] [blame] | 56 | set (BUILDTGT_DIR build) |
| 57 | set (BINDATA_DIR Bin) |
| 58 | set (LIBSOURCE_DIR Lib) |
| 59 | else() |
Mark Mueller | e87a48b | 2016-04-18 11:04:36 -0600 | [diff] [blame] | 60 | option(DISABLE_BUILD_PATH_DECORATION "Disable the decoration of the gslang and SPIRV-Tools build path with MSVC build type info" OFF) |
| 61 | option(DISABLE_BUILDTGT_DIR_DECORATION "Disable the decoration of the gslang and SPIRV-Tools build path with target info" OFF) |
| 62 | |
Dustin Graves | 7ef139e | 2016-03-15 15:39:08 -0600 | [diff] [blame] | 63 | # For Windows, since 32-bit and 64-bit items can co-exist, we build each in its own build directory. |
| 64 | # 32-bit target data goes in build32, and 64-bit target data goes into build. So, include/link the |
| 65 | # appropriate data at build time. |
Mark Mueller | e87a48b | 2016-04-18 11:04:36 -0600 | [diff] [blame] | 66 | if (DISABLE_BUILDTGT_DIR_DECORATION) |
| 67 | set (BUILDTGT_DIR "") |
| 68 | set (BINDATA_DIR "") |
| 69 | set (LIBSOURCE_DIR "") |
| 70 | elseif (CMAKE_CL_64) |
Dustin Graves | 7ef139e | 2016-03-15 15:39:08 -0600 | [diff] [blame] | 71 | set (BUILDTGT_DIR build) |
| 72 | set (BINDATA_DIR Bin) |
| 73 | set (LIBSOURCE_DIR Lib) |
| 74 | else() |
| 75 | set (BUILDTGT_DIR build32) |
| 76 | set (BINDATA_DIR Bin32) |
| 77 | set (LIBSOURCE_DIR Lib32) |
| 78 | endif() |
| 79 | endif() |
| 80 | |
Jason Ekstrand | 775a578 | 2015-10-10 08:43:07 -0700 | [diff] [blame] | 81 | option(BUILD_LOADER "Build loader" ON) |
Jason Ekstrand | 775a578 | 2015-10-10 08:43:07 -0700 | [diff] [blame] | 82 | option(BUILD_TESTS "Build tests" ON) |
| 83 | option(BUILD_LAYERS "Build layers" ON) |
| 84 | option(BUILD_DEMOS "Build demos" ON) |
Antoine Labour | e3795c1 | 2015-10-27 12:21:09 -0700 | [diff] [blame] | 85 | option(BUILD_VKJSON "Build vkjson" ON) |
Mark Mueller | e87a48b | 2016-04-18 11:04:36 -0600 | [diff] [blame] | 86 | option(CUSTOM_GLSLANG_BIN_ROOT "Use the user defined GLSLANG_BINARY_ROOT" OFF) |
| 87 | option(CUSTOM_SPIRV_TOOLS_BIN_ROOT "Use the user defined SPIRV_TOOLS_BINARY_ROOT" OFF) |
| 88 | |
| 89 | #Choose natural default paths for glslang and SPIRV-Tools binaries to support custom definition by the user on the CMake command line or in the GUI |
| 90 | set(GLSLANG_BINARY_ROOT "${CMAKE_BINARY_DIR}/../glslang" CACHE STRING "User defined path to the glslang binaries for this project") |
Mark Young | 3b019c6 | 2016-06-16 14:57:25 -0600 | [diff] [blame] | 91 | set(SPIRV_TOOLS_BINARY_ROOT "${CMAKE_BINARY_DIR}/../SPIRV-Tools" CACHE STRING "User defined path to the SPIRV-Tools binaries for this project") |
Mark Mueller | e87a48b | 2016-04-18 11:04:36 -0600 | [diff] [blame] | 92 | |
| 93 | # Define a variable for a default root location to the gslang, SPIRV-Tools and other external sources and cache it to allow the user to customize it as needed |
| 94 | set(EXTERNAL_SOURCE_ROOT "${CMAKE_SOURCE_DIR}/external" CACHE STRING "Root path to external sources such as glslang and SPIRV-Tools") |
| 95 | |
| 96 | |
| 97 | if (WIN32) |
| 98 | if(CUSTOM_GLSLANG_BIN_ROOT) |
| 99 | set(GSLANG_FINAL_BINARY_PATH ${GLSLANG_BINARY_ROOT}/${BUILDTGT_DIR}) |
| 100 | else() |
| 101 | set(GSLANG_FINAL_BINARY_PATH "${EXTERNAL_SOURCE_ROOT}/glslang/${BUILDTGT_DIR}") |
| 102 | endif() |
| 103 | |
| 104 | if(DISABLE_BUILD_PATH_DECORATION) |
| 105 | set (DEBUG_DECORATION "") |
| 106 | set (RELEASE_DECORATION "") |
| 107 | else() |
| 108 | set (DEBUG_DECORATION "Debug") |
| 109 | set (RELEASE_DECORATION "Release") |
| 110 | endif() |
| 111 | |
| 112 | # Take some steps to set up a variable pointing to the final glslang binaries given the variety of input options |
| 113 | set (GLSLANG_SEARCH_PATH "${GSLANG_FINAL_BINARY_PATH}/glslang/${RELEASE_DECORATION}" |
| 114 | "${GSLANG_FINAL_BINARY_PATH}/glslang/OSDependent/Windows/${RELEASE_DECORATION}" |
| 115 | "${GSLANG_FINAL_BINARY_PATH}/hlsl/${RELEASE_DECORATION}" |
| 116 | "${GSLANG_FINAL_BINARY_PATH}/OGLCompilersDLL/${RELEASE_DECORATION}" |
| 117 | "${GSLANG_FINAL_BINARY_PATH}/SPIRV/${RELEASE_DECORATION}" ) |
| 118 | |
| 119 | set (GLSLANG_DEBUG_SEARCH_PATH "${GSLANG_FINAL_BINARY_PATH}/glslang/${DEBUG_DECORATION}" |
| 120 | "${GSLANG_FINAL_BINARY_PATH}/glslang/OSDependent/Windows/${DEBUG_DECORATION}" |
| 121 | "${GSLANG_FINAL_BINARY_PATH}/hlsl/${DEBUG_DECORATION}" |
| 122 | "${GSLANG_FINAL_BINARY_PATH}/OGLCompilersDLL/${DEBUG_DECORATION}" |
| 123 | "${GSLANG_FINAL_BINARY_PATH}/SPIRV/${DEBUG_DECORATION}") |
| 124 | |
| 125 | if(CUSTOM_SPIRV_TOOLS_BIN_ROOT) |
Mark Young | 3b019c6 | 2016-06-16 14:57:25 -0600 | [diff] [blame] | 126 | set (SPIRV_TOOLS_SEARCH_PATH "${SPIRV_TOOLS_BINARY_ROOT}/${BUILDTGT_DIR}/source/${RELEASE_DECORATION}") |
| 127 | set (SPIRV_TOOLS_DEBUG_SEARCH_PATH "${SPIRV_TOOLS_BINARY_ROOT}/${BUILDTGT_DIR}/source/${DEBUG_DECORATION}") |
Mark Mueller | e87a48b | 2016-04-18 11:04:36 -0600 | [diff] [blame] | 128 | else() |
| 129 | set (SPIRV_TOOLS_SEARCH_PATH "${EXTERNAL_SOURCE_ROOT}/spirv-tools/${BUILDTGT_DIR}/source/${RELEASE_DECORATION}") |
| 130 | set (SPIRV_TOOLS_DEBUG_SEARCH_PATH "${EXTERNAL_SOURCE_ROOT}/spirv-tools/${BUILDTGT_DIR}/source/${DEBUG_DECORATION}") |
| 131 | endif() |
| 132 | else() |
| 133 | #non windows |
| 134 | if(CUSTOM_GLSLANG_BIN_ROOT) |
| 135 | set (GLSLANG_SEARCH_PATH "${GLSLANG_BINARY_ROOT}/install/lib" |
| 136 | "${GLSLANG_BINARY_ROOT}/glslang" |
| 137 | "${GLSLANG_BINARY_ROOT}/glslang/OSDependent/Unix" |
| 138 | "${GLSLANG_BINARY_ROOT}/OGLCompilersDLL" |
| 139 | "${GLSLANG_BINARY_ROOT}/SPIRV" |
| 140 | "${GLSLANG_BINARY_ROOT}/hlsl" |
| 141 | "${GLSLANG_BINARY_ROOT}/StandAlone") |
| 142 | else() |
| 143 | set (GLSLANG_SEARCH_PATH "${EXTERNAL_SOURCE_ROOT}/glslang/${BUILDTGT_DIR}/install/lib" "${CMAKE_SOURCE_DIR}/../x86_64/lib/glslang" ) |
| 144 | endif() |
| 145 | |
| 146 | if(CUSTOM_SPIRV_TOOLS_BIN_ROOT) |
Mark Young | 3b019c6 | 2016-06-16 14:57:25 -0600 | [diff] [blame] | 147 | set (SPIRV_TOOLS_SEARCH_PATH "${SPIRV_TOOLS_BINARY_ROOT}/source" ) |
Mark Mueller | e87a48b | 2016-04-18 11:04:36 -0600 | [diff] [blame] | 148 | else() |
| 149 | set (SPIRV_TOOLS_SEARCH_PATH "${EXTERNAL_SOURCE_ROOT}/spirv-tools/${BUILDTGT_DIR}/source" "${CMAKE_SOURCE_DIR}/../x86_64/lib/spirv-tools" ) |
| 150 | endif() |
| 151 | endif() |
Courtney Goeltzenleuchter | 62b2e85 | 2014-10-03 15:34:53 -0600 | [diff] [blame] | 152 | |
Dustin Graves | 7ef139e | 2016-03-15 15:39:08 -0600 | [diff] [blame] | 153 | find_program(GLSLANG_VALIDATOR NAMES glslangValidator |
Jon Ashburn | d288cb9 | 2016-05-02 08:39:14 -0600 | [diff] [blame] | 154 | HINTS "${CMAKE_SOURCE_DIR}/external/glslang/${BUILDTGT_DIR}/install/bin" |
Mark Mueller | e87a48b | 2016-04-18 11:04:36 -0600 | [diff] [blame] | 155 | "${GLSLANG_BINARY_ROOT}/StandAlone" |
| 156 | "${PROJECT_SOURCE_DIR}/external/${BINDATA_DIR}") |
Jason Ekstrand | 775a578 | 2015-10-10 08:43:07 -0700 | [diff] [blame] | 157 | |
Mark Mueller | e87a48b | 2016-04-18 11:04:36 -0600 | [diff] [blame] | 158 | find_path(GLSLANG_SPIRV_INCLUDE_DIR SPIRV/spirv.hpp HINTS "${EXTERNAL_SOURCE_ROOT}/glslang" |
| 159 | "${CMAKE_SOURCE_DIR}/../glslang" |
| 160 | DOC "Path to SPIRV/spirv.hpp") |
Dustin Graves | 7ef139e | 2016-03-15 15:39:08 -0600 | [diff] [blame] | 161 | |
Mark Mueller | e87a48b | 2016-04-18 11:04:36 -0600 | [diff] [blame] | 162 | find_path(SPIRV_TOOLS_INCLUDE_DIR spirv-tools/libspirv.h HINTS "${EXTERNAL_SOURCE_ROOT}/spirv-tools/include" |
| 163 | "${EXTERNAL_SOURCE_ROOT}/SPIRV-Tools/include" |
| 164 | "${CMAKE_SOURCE_DIR}/../spirv-tools/include" |
| 165 | "${CMAKE_SOURCE_DIR}/../SPIRV-Tools/include" |
| 166 | "${EXTERNAL_SOURCE_ROOT}/source/spirv-tools/external/include" |
| 167 | DOC "Path to spirv-tools/libspirv.h") |
Dustin Graves | 7ef139e | 2016-03-15 15:39:08 -0600 | [diff] [blame] | 168 | |
| 169 | find_library(GLSLANG_LIB NAMES glslang |
| 170 | HINTS ${GLSLANG_SEARCH_PATH} ) |
| 171 | |
| 172 | find_library(OGLCompiler_LIB NAMES OGLCompiler |
| 173 | HINTS ${GLSLANG_SEARCH_PATH} ) |
| 174 | |
| 175 | find_library(OSDependent_LIB NAMES OSDependent |
| 176 | HINTS ${GLSLANG_SEARCH_PATH} ) |
| 177 | |
Cody Northrop | 53cd7ef | 2016-04-14 11:18:30 -0600 | [diff] [blame] | 178 | find_library(HLSL_LIB NAMES HLSL |
| 179 | HINTS ${GLSLANG_SEARCH_PATH} ) |
| 180 | |
Dustin Graves | 7ef139e | 2016-03-15 15:39:08 -0600 | [diff] [blame] | 181 | find_library(SPIRV_LIB NAMES SPIRV |
| 182 | HINTS ${GLSLANG_SEARCH_PATH} ) |
| 183 | |
Mark Young | 40fa980 | 2016-08-26 16:54:43 -0600 | [diff] [blame] | 184 | find_library(SPIRV_REMAPPER_LIB NAMES SPVRemapper |
| 185 | HINTS ${GLSLANG_SEARCH_PATH} ) |
| 186 | |
Dustin Graves | 7ef139e | 2016-03-15 15:39:08 -0600 | [diff] [blame] | 187 | find_library(SPIRV_TOOLS_LIB NAMES SPIRV-Tools |
| 188 | HINTS ${SPIRV_TOOLS_SEARCH_PATH} ) |
| 189 | |
Dustin Graves | 7ef139e | 2016-03-15 15:39:08 -0600 | [diff] [blame] | 190 | if (WIN32) |
Dustin Graves | 7ef139e | 2016-03-15 15:39:08 -0600 | [diff] [blame] | 191 | add_library(glslang STATIC IMPORTED) |
| 192 | add_library(OGLCompiler STATIC IMPORTED) |
| 193 | add_library(OSDependent STATIC IMPORTED) |
Cody Northrop | 53cd7ef | 2016-04-14 11:18:30 -0600 | [diff] [blame] | 194 | add_library(HLSL STATIC IMPORTED) |
Dustin Graves | 7ef139e | 2016-03-15 15:39:08 -0600 | [diff] [blame] | 195 | add_library(SPIRV STATIC IMPORTED) |
Mark Young | 40fa980 | 2016-08-26 16:54:43 -0600 | [diff] [blame] | 196 | add_library(SPVRemapper STATIC IMPORTED) |
Dustin Graves | 7ef139e | 2016-03-15 15:39:08 -0600 | [diff] [blame] | 197 | add_library(Loader STATIC IMPORTED) |
| 198 | add_library(SPIRV-Tools STATIC IMPORTED) |
| 199 | |
Karl Schultz | 104c762 | 2016-07-18 09:40:37 -0600 | [diff] [blame] | 200 | find_library(GLSLANG_DLIB NAMES glslangd |
Dustin Graves | 7ef139e | 2016-03-15 15:39:08 -0600 | [diff] [blame] | 201 | HINTS ${GLSLANG_DEBUG_SEARCH_PATH} ) |
Karl Schultz | 104c762 | 2016-07-18 09:40:37 -0600 | [diff] [blame] | 202 | find_library(OGLCompiler_DLIB NAMES OGLCompilerd |
Dustin Graves | 7ef139e | 2016-03-15 15:39:08 -0600 | [diff] [blame] | 203 | HINTS ${GLSLANG_DEBUG_SEARCH_PATH} ) |
Karl Schultz | 104c762 | 2016-07-18 09:40:37 -0600 | [diff] [blame] | 204 | find_library(OSDependent_DLIB NAMES OSDependentd |
Dustin Graves | 7ef139e | 2016-03-15 15:39:08 -0600 | [diff] [blame] | 205 | HINTS ${GLSLANG_DEBUG_SEARCH_PATH} ) |
Karl Schultz | 104c762 | 2016-07-18 09:40:37 -0600 | [diff] [blame] | 206 | find_library(HLSL_DLIB NAMES HLSLd |
Cody Northrop | 53cd7ef | 2016-04-14 11:18:30 -0600 | [diff] [blame] | 207 | HINTS ${GLSLANG_DEBUG_SEARCH_PATH} ) |
Karl Schultz | 104c762 | 2016-07-18 09:40:37 -0600 | [diff] [blame] | 208 | find_library(SPIRV_DLIB NAMES SPIRVd |
Dustin Graves | 7ef139e | 2016-03-15 15:39:08 -0600 | [diff] [blame] | 209 | HINTS ${GLSLANG_DEBUG_SEARCH_PATH} ) |
Mark Young | 40fa980 | 2016-08-26 16:54:43 -0600 | [diff] [blame] | 210 | find_library(SPIRV_REMAPPER_DLIB NAMES SPVRemapperd |
| 211 | HINTS ${GLSLANG_DEBUG_SEARCH_PATH} ) |
Dustin Graves | 7ef139e | 2016-03-15 15:39:08 -0600 | [diff] [blame] | 212 | find_library(SPIRV_TOOLS_DLIB NAMES SPIRV-Tools |
| 213 | HINTS ${SPIRV_TOOLS_DEBUG_SEARCH_PATH} ) |
| 214 | |
| 215 | set_target_properties(glslang PROPERTIES |
| 216 | IMPORTED_LOCATION "${GLSLANG_LIB}" |
| 217 | IMPORTED_LOCATION_DEBUG "${GLSLANG_DLIB}") |
| 218 | set_target_properties(OGLCompiler PROPERTIES |
| 219 | IMPORTED_LOCATION "${OGLCompiler_LIB}" |
| 220 | IMPORTED_LOCATION_DEBUG "${OGLCompiler_DLIB}") |
| 221 | set_target_properties(OSDependent PROPERTIES |
| 222 | IMPORTED_LOCATION "${OSDependent_LIB}" |
| 223 | IMPORTED_LOCATION_DEBUG "${OSDependent_DLIB}") |
Cody Northrop | 53cd7ef | 2016-04-14 11:18:30 -0600 | [diff] [blame] | 224 | set_target_properties(HLSL PROPERTIES |
| 225 | IMPORTED_LOCATION "${HLSL_LIB}" |
| 226 | IMPORTED_LOCATION_DEBUG "${HLSL_DLIB}") |
Dustin Graves | 7ef139e | 2016-03-15 15:39:08 -0600 | [diff] [blame] | 227 | set_target_properties(SPIRV PROPERTIES |
| 228 | IMPORTED_LOCATION "${SPIRV_LIB}" |
| 229 | IMPORTED_LOCATION_DEBUG "${SPIRV_DLIB}") |
Mark Young | 40fa980 | 2016-08-26 16:54:43 -0600 | [diff] [blame] | 230 | set_target_properties(SPVRemapper PROPERTIES |
| 231 | IMPORTED_LOCATION "${SPIRV_REMAPPER_LIB}" |
| 232 | IMPORTED_LOCATION_DEBUG "${SPIRV_REMAPPER_DLIB}") |
Dustin Graves | 7ef139e | 2016-03-15 15:39:08 -0600 | [diff] [blame] | 233 | set_target_properties(SPIRV-Tools PROPERTIES |
| 234 | IMPORTED_LOCATION "${SPIRV_TOOLS_LIB}" |
| 235 | IMPORTED_LOCATION_DEBUG "${SPIRV_TOOLS_DLIB}") |
| 236 | |
Mark Young | 40fa980 | 2016-08-26 16:54:43 -0600 | [diff] [blame] | 237 | set (GLSLANG_LIBRARIES glslang OGLCompiler OSDependent HLSL SPIRV SPVRemapper) |
Dustin Graves | 7ef139e | 2016-03-15 15:39:08 -0600 | [diff] [blame] | 238 | set (SPIRV_TOOLS_LIBRARIES SPIRV-Tools) |
| 239 | else () |
Mark Young | 40fa980 | 2016-08-26 16:54:43 -0600 | [diff] [blame] | 240 | set (GLSLANG_LIBRARIES ${GLSLANG_LIB} ${OGLCompiler_LIB} ${OSDependent_LIB} ${HLSL_LIB} ${SPIRV_LIB} ${SPIRV_REMAPPER_LIB}) |
Dustin Graves | 7ef139e | 2016-03-15 15:39:08 -0600 | [diff] [blame] | 241 | set (SPIRV_TOOLS_LIBRARIES ${SPIRV_TOOLS_LIB}) |
Courtney Goeltzenleuchter | 3efe712 | 2015-10-14 17:00:44 -0600 | [diff] [blame] | 242 | endif() |
| 243 | |
Tony Barbour | a70e3fe | 2016-03-01 16:40:39 -0700 | [diff] [blame] | 244 | set (PYTHON_CMD ${PYTHON_EXECUTABLE}) |
| 245 | |
Tony Barbour | b4ab874 | 2015-05-21 11:07:47 -0600 | [diff] [blame] | 246 | if(NOT WIN32) |
Adam Jackson | 05487a2 | 2015-07-23 16:29:26 -0400 | [diff] [blame] | 247 | include(GNUInstallDirs) |
Dor Askayo | a4a2f9f | 2016-10-22 22:20:29 +0300 | [diff] [blame] | 248 | |
Dor Askayo | 9b588e8 | 2016-10-22 20:42:44 +0300 | [diff] [blame] | 249 | add_definitions(-DSYSCONFDIR="${CMAKE_INSTALL_FULL_SYSCONFDIR}") |
| 250 | add_definitions(-DDATADIR="${CMAKE_INSTALL_FULL_DATADIR}") |
Dor Askayo | a4a2f9f | 2016-10-22 22:20:29 +0300 | [diff] [blame] | 251 | |
| 252 | # Make sure /etc is searched by the loader |
| 253 | if (NOT (CMAKE_INSTALL_FULL_SYSCONFDIR STREQUAL "/etc")) |
| 254 | add_definitions(-DEXTRASYSCONFDIR="/etc") |
| 255 | endif() |
| 256 | |
| 257 | # Make sure /usr/share is searched by the loader |
| 258 | if (NOT (CMAKE_INSTALL_FULL_DATADIR STREQUAL "/usr/share")) |
| 259 | add_definitions(-DEXTRADATADIR="/usr/share") |
James Jones | ac945bc | 2015-07-23 17:39:37 -0700 | [diff] [blame] | 260 | endif() |
Courtney Goeltzenleuchter | 62b2e85 | 2014-10-03 15:34:53 -0600 | [diff] [blame] | 261 | endif() |
| 262 | |
Karl Schultz | 60931a2 | 2016-10-12 17:36:35 -0600 | [diff] [blame] | 263 | if(UNIX) |
John Zupin | 35ab0d7 | 2016-10-27 13:15:27 -0600 | [diff] [blame] | 264 | install(DIRECTORY "${PROJECT_SOURCE_DIR}/include/vulkan" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) |
Karl Schultz | 60931a2 | 2016-10-12 17:36:35 -0600 | [diff] [blame] | 265 | endif() |
| 266 | |
Courtney Goeltzenleuchter | a8c0628 | 2015-04-14 14:55:44 -0600 | [diff] [blame] | 267 | # loader: Generic VULKAN ICD loader |
Courtney Goeltzenleuchter | a8c0628 | 2015-04-14 14:55:44 -0600 | [diff] [blame] | 268 | # tests: VULKAN tests |
Jason Ekstrand | 775a578 | 2015-10-10 08:43:07 -0700 | [diff] [blame] | 269 | if(BUILD_LOADER) |
| 270 | add_subdirectory(loader) |
| 271 | endif() |
| 272 | |
Tony Barbour | 2a199c1 | 2015-07-09 17:31:46 -0600 | [diff] [blame] | 273 | if(BUILD_TESTS) |
| 274 | add_subdirectory(tests) |
| 275 | endif() |
Jason Ekstrand | 775a578 | 2015-10-10 08:43:07 -0700 | [diff] [blame] | 276 | |
| 277 | if(BUILD_LAYERS) |
| 278 | add_subdirectory(layers) |
| 279 | endif() |
| 280 | |
| 281 | if(BUILD_DEMOS) |
| 282 | add_subdirectory(demos) |
| 283 | endif() |
| 284 | |
Antoine Labour | e3795c1 | 2015-10-27 12:21:09 -0700 | [diff] [blame] | 285 | if(BUILD_VKJSON) |
| 286 | add_subdirectory(libs/vkjson) |
| 287 | endif() |