From fe0c9e1c14ff09f56788250b6635eea7fa024d22 Mon Sep 17 00:00:00 2001 From: dan sinclair Date: Tue, 5 Nov 2019 04:47:43 -0500 Subject: [PATCH] Allow setting vulkan paths. (#419) This CL adds VULKAN_HPP_VULKAN_HEADERS_SRC_DIR and VULKAN_HPP_PATH variables to the CMakeLists file. --- CMakeLists.txt | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2ed7cda..e6fd466 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -36,13 +36,21 @@ else(MSVC) add_compile_options(-Wall) endif(MSVC) -file(TO_NATIVE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/Vulkan-Headers/registry/vk.xml vk_spec) +if (NOT DEFINED VULKAN_HPP_VULKAN_HEADERS_SRC_DIR) + set(VULKAN_HPP_VULKAN_HEADERS_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/Vulkan-Headers") +endif() +file(TO_NATIVE_PATH ${VULKAN_HPP_VULKAN_HEADERS_SRC_DIR}/registry/vk.xml vk_spec) string(REPLACE "\\" "\\\\" vk_spec ${vk_spec}) add_definitions(-DVK_SPEC="${vk_spec}") -file(TO_NATIVE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/vulkan/vulkan.hpp vulkan_hpp) +if (NOT DEFINED VULKAN_HPP_PATH) + set(VULKAN_HPP_PATH "${CMAKE_CURRENT_SOURCE_DIR}/vulkan") +endif() +file(TO_NATIVE_PATH ${VULKAN_HPP_PATH}/vulkan.hpp vulkan_hpp) string(REPLACE "\\" "\\\\" vulkan_hpp ${vulkan_hpp}) add_definitions(-DVULKAN_HPP_FILE="${vulkan_hpp}") +include_directories(${VULKAN_HPP_PATH}) + set(HEADERS VulkanHppGenerator.hpp