1 | <!--
|
---|
2 | Copyright 2018-2023 The Khronos Group Inc.
|
---|
3 |
|
---|
4 | SPDX-License-Identifier: Apache-2.0
|
---|
5 | -->
|
---|
6 |
|
---|
7 | # Build Instructions
|
---|
8 |
|
---|
9 | Instructions for building this repository.
|
---|
10 |
|
---|
11 | ```bash
|
---|
12 | git clone https://github.com/KhronosGroup/Vulkan-Headers.git
|
---|
13 |
|
---|
14 | cd Vulkan-Headers/
|
---|
15 |
|
---|
16 | # Configure the project
|
---|
17 | cmake -S . -B build/
|
---|
18 |
|
---|
19 | # Because Vulkan-Headers is header only we don't need to build anything.
|
---|
20 | # Users can install it where they need to.
|
---|
21 | cmake --install build --prefix build/install
|
---|
22 | ```
|
---|
23 |
|
---|
24 | See the official [CMake documentation](https://cmake.org/cmake/help/latest/index.html) for more information.
|
---|
25 |
|
---|
26 | ## Installed Files
|
---|
27 |
|
---|
28 | The `install` target installs the following files under the directory
|
---|
29 | indicated by *install_dir*:
|
---|
30 |
|
---|
31 | - *install_dir*`/include/vulkan` : The header files found in the
|
---|
32 | `include/vulkan` directory of this repository
|
---|
33 | - *install_dir*`/share/cmake/VulkanHeaders`: The CMake config files needed
|
---|
34 | for find_package support
|
---|
35 | - *install_dir*`/share/vulkan/registry` : The registry files found in the
|
---|
36 | `registry` directory of this repository
|
---|
37 |
|
---|
38 | ## Usage in CMake
|
---|
39 |
|
---|
40 | ```cmake
|
---|
41 | find_package(VulkanHeaders REQUIRED CONFIG)
|
---|
42 |
|
---|
43 | target_link_libraries(foobar PRIVATE Vulkan::Headers)
|
---|
44 |
|
---|
45 | message(STATUS "Vulkan Headers Version: ${VulkanHeaders_VERSION}")
|
---|
46 | ```
|
---|