David Neto | 2065e59 | 2016-03-17 16:23:57 -0400 | [diff] [blame] | 1 | # Copyright (c) 2015-2016 The Khronos Group Inc. |
| 2 | # |
| 3 | # Permission is hereby granted, free of charge, to any person obtaining a |
| 4 | # copy of this software and/or associated documentation files (the |
| 5 | # "Materials"), to deal in the Materials without restriction, including |
| 6 | # without limitation the rights to use, copy, modify, merge, publish, |
| 7 | # distribute, sublicense, and/or sell copies of the Materials, and to |
| 8 | # permit persons to whom the Materials are furnished to do so, subject to |
| 9 | # the following conditions: |
| 10 | # |
| 11 | # The above copyright notice and this permission notice shall be included |
| 12 | # in all copies or substantial portions of the Materials. |
| 13 | # |
| 14 | # MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS |
| 15 | # KHRONOS STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS |
| 16 | # SPECIFICATIONS AND HEADER INFORMATION ARE LOCATED AT |
| 17 | # https://www.khronos.org/registry/ |
| 18 | # |
| 19 | # THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
| 20 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
| 21 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. |
| 22 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY |
| 23 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, |
| 24 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE |
| 25 | # MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. |
| 26 | |
| 27 | # |
| 28 | # The SPIR-V headers from the SPIR-V Registry |
| 29 | # https://www.khronos.org/registry/spir-v/ |
| 30 | # |
James Knight | b8d95fb | 2017-09-27 22:57:36 -0400 | [diff] [blame] | 31 | cmake_minimum_required(VERSION 2.8.11) |
David Neto | 2065e59 | 2016-03-17 16:23:57 -0400 | [diff] [blame] | 32 | project(SPIRV-Headers) |
| 33 | |
| 34 | # There are two ways to use this project. |
| 35 | # |
| 36 | # Using this source tree directly from a CMake-based project: |
| 37 | # 1. Add an add_subdirectory directive to include this sub directory. |
| 38 | # 2. Use ${SPIRV-Headers_SOURCE_DIR}/include} in a target_include_directories |
| 39 | # command. |
| 40 | # |
| 41 | # Installing the headers first, then using them with an implicit include |
| 42 | # directory. To install the headers: |
| 43 | # 1. mkdir build ; cd build |
| 44 | # 2. cmake .. |
James Knight | 4ca4743 | 2017-09-27 23:05:35 -0400 | [diff] [blame] | 45 | # 3. cmake --build . --target install |
David Neto | 2065e59 | 2016-03-17 16:23:57 -0400 | [diff] [blame] | 46 | |
James Knight | 4ca4743 | 2017-09-27 23:05:35 -0400 | [diff] [blame] | 47 | file(GLOB_RECURSE HEADER_FILES |
| 48 | RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} |
| 49 | include/spirv/*) |
| 50 | foreach(HEADER_FILE ${HEADER_FILES}) |
| 51 | get_filename_component(HEADER_INSTALL_DIR ${HEADER_FILE} PATH) |
| 52 | install(FILES ${HEADER_FILE} DESTINATION ${HEADER_INSTALL_DIR}) |
| 53 | endforeach() |
| 54 | |
| 55 | # legacy |
David Neto | 2065e59 | 2016-03-17 16:23:57 -0400 | [diff] [blame] | 56 | add_custom_target(install-headers |
James Knight | 4ca4743 | 2017-09-27 23:05:35 -0400 | [diff] [blame] | 57 | COMMAND cmake -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/include/spirv |
James Knight | 7de7b23 | 2018-06-01 20:54:54 -0400 | [diff] [blame] | 58 | $ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/include/spirv) |
David Neto | 2065e59 | 2016-03-17 16:23:57 -0400 | [diff] [blame] | 59 | |
| 60 | add_subdirectory(example) |