From 2ed3359a526b808cc6f06115e2e55bb03699d072 Mon Sep 17 00:00:00 2001 From: Nuno Subtil Date: Thu, 7 Feb 2019 19:32:29 -0800 Subject: [PATCH] build: Define library targets for nested builds- Adds alias interface libraries Vulkan::Headers and Vulkan::Registry that export include paths. These are meant to be used by dependent projects in a nested build configuration to obtain the path to the Vulkan headers and registry directories. Change-Id: I0801f4a23ef654064c1b0878543cd48965954756 --- CMakeLists.txt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1c1d81f..2640891 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -36,6 +36,15 @@ endif() # -------------------------------------------------------------------------------------------------------------------------------- +# define exported targets for nested project builds to consume +add_library(Vulkan-Headers INTERFACE) +target_include_directories(Vulkan-Headers INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/include") +add_library(Vulkan::Headers ALIAS Vulkan-Headers) + +add_library(Vulkan-Registry INTERFACE) +target_include_directories(Vulkan-Registry INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/registry") +add_library(Vulkan::Registry ALIAS Vulkan-Registry) + install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/include/vulkan" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/registry" DESTINATION ${CMAKE_INSTALL_DATADIR}/vulkan)