Skip to content

Commit

Permalink
Add 'Vulkan-Headers' package (#67)
Browse files Browse the repository at this point in the history
* Add 'Vulkan-Headers' package

* Update version

* Update PR number

* fix docs for Vulkan and SPIRV Headers
  • Loading branch information
rbsheth committed Nov 20, 2019
1 parent 01d12d6 commit 3951b62
Show file tree
Hide file tree
Showing 6 changed files with 81 additions and 1 deletion.
1 change: 1 addition & 0 deletions cmake/configs/default.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ hunter_default_version(TCLAP VERSION 1.2.2-p1)
hunter_default_version(TIFF VERSION 4.0.2-p5)
hunter_default_version(Tesseract VERSION 3.05.01-hunter-3)
hunter_default_version(Urho3D VERSION 1.7-p15)
hunter_default_version(Vulkan-Headers VERSION 1.1.127-p0)
hunter_default_version(VulkanMemoryAllocator VERSION 2.1.0-p0)
hunter_default_version(WDC VERSION 1.1.5)
hunter_default_version(WTL VERSION 9.1.5321)
Expand Down
31 changes: 31 additions & 0 deletions cmake/projects/Vulkan-Headers/hunter.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Copyright (c) 2019, Rahul Sheth
# All rights reserved.

# !!! DO NOT PLACE HEADER GUARDS HERE !!!

include(hunter_add_version)
include(hunter_cacheable)
include(hunter_cmake_args)
include(hunter_download)
include(hunter_pick_scheme)

hunter_add_version(
PACKAGE_NAME
Vulkan-Headers
VERSION
1.1.127-p0
URL
"https://github.com/cpp-pm/Vulkan-Headers/archive/v1.1.127-p0.tar.gz"
SHA1
6dc8553af090daafa19ccb823d6e137ec89df4bd
)

hunter_cmake_args(
Vulkan-Headers
CMAKE_ARGS
VULKAN_HEADERS_SKIP_INSTALL=OFF
)

hunter_pick_scheme(DEFAULT url_sha1_cmake)
hunter_cacheable(Vulkan-Headers)
hunter_download(PACKAGE_NAME Vulkan-Headers)
2 changes: 1 addition & 1 deletion docs/packages/pkg/SPIRV-Headers.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.. spelling::

SPIRV-Headers
SPIRV

.. index::
single: unsorted ; SPIRV-Headers
Expand Down
20 changes: 20 additions & 0 deletions docs/packages/pkg/Vulkan-Headers.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
.. spelling::

Vulkan

.. index::
single: graphics ; Vulkan-Headers

.. _pkg.Vulkan-Headers:

Vulkan-Headers
==============

- `Official <https://github.com/KhronosGroup/Vulkan-Headers>`__
- `Example <https://github.com/cpp-pm/hunter/blob/master/examples/Vulkan-Headers/CMakeLists.txt>`__
- Added by `Rahul Sheth <https://github.com/rbsheth>`__ (`pr-67 <https://github.com/cpp-pm/hunter/pull/67>`__)

.. literalinclude:: /../examples/Vulkan-Headers/CMakeLists.txt
:language: cmake
:start-after: # DOCUMENTATION_START {
:end-before: # DOCUMENTATION_END }
18 changes: 18 additions & 0 deletions examples/Vulkan-Headers/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright (c) 2016-2019, Ruslan Baratov
# All rights reserved.

cmake_minimum_required(VERSION 3.2)

# Emulate HunterGate:
# * https://github.com/hunter-packages/gate
include("../common.cmake")

project(download-Vulkan-Headers)

# DOCUMENTATION_START {
hunter_add_package(Vulkan-Headers)
find_package(Vulkan-Headers CONFIG REQUIRED)

add_executable(boo boo.cpp)
target_link_libraries(boo PUBLIC Vulkan-Headers::Vulkan-Headers)
# DOCUMENTATION_END }
10 changes: 10 additions & 0 deletions examples/Vulkan-Headers/boo.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#include <vulkan/vulkan.h>

// Vertex buffer and attributes
struct {
VkDeviceMemory memory;
VkBuffer buffer;
} vertices;

int main() {
}

0 comments on commit 3951b62

Please sign in to comment.