Vulkan-Headers/BUILD.md

47 lines
1.2 KiB
Markdown
Raw Normal View History

<!--
Copyright 2018-2023 The Khronos Group Inc.
SPDX-License-Identifier: Apache-2.0
-->
# Build Instructions
2023-01-10 10:47:33 -07:00
Instructions for building this repository.
2023-01-10 10:47:33 -07:00
```bash
git clone https://github.com/KhronosGroup/Vulkan-Headers.git
2023-01-10 10:47:33 -07:00
cd Vulkan-Headers/
2023-01-10 10:47:33 -07:00
# Configure the project
cmake -S . -B build/
2023-01-10 10:47:33 -07:00
# Because Vulkan-Headers is header only we don't need to build anything.
# Users can install it where they need to.
cmake --install build --prefix build/install
```
2018-06-15 18:11:06 -07:00
2023-01-10 10:47:33 -07:00
See the official [CMake documentation](https://cmake.org/cmake/help/latest/index.html) for more information.
2018-06-15 18:11:06 -07:00
2023-01-10 10:47:33 -07:00
## Installed Files
2018-06-15 18:11:06 -07:00
The `install` target installs the following files under the directory
indicated by *install_dir*:
- *install_dir*`/include/vulkan` : The header files found in the
`include/vulkan` directory of this repository
2022-11-07 14:07:45 -07:00
- *install_dir*`/share/cmake/VulkanHeaders`: The CMake config files needed
for find_package support
2018-06-15 18:11:06 -07:00
- *install_dir*`/share/vulkan/registry` : The registry files found in the
`registry` directory of this repository
2023-01-10 10:47:33 -07:00
## Usage in CMake
2022-11-07 14:07:45 -07:00
```cmake
find_package(VulkanHeaders REQUIRED CONFIG)
target_link_libraries(foobar PRIVATE Vulkan::Headers)
2023-01-11 12:24:53 -07:00
message(STATUS "Vulkan Headers Version: ${VulkanHeaders_VERSION}")
2022-11-07 14:07:45 -07:00
```