Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/KhronosGroup/Vulkan-Headers.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuan Ramos <juan@lunarg.com>2022-11-07 22:42:34 +0300
committerJuan Ramos <114601453+juan-lunarg@users.noreply.github.com>2022-11-08 20:22:11 +0300
commite55c3116c119b594851e8a5289319a6305544a92 (patch)
treedc867a8cf7e4ddc6042b8f6040b13d1e633f2667 /CMakeLists.txt
parent9cc8473bb9e7b35df4f44585c073ebaa08e86dfb (diff)
cmake: Add VULKAN_HEADERS_INSTALL option
This allows projects which consume this repo with add_subdirectory to turn on/off the install logic, which can be undesirable.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt9
1 files changed, 8 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 09b047c..7819608 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -28,4 +28,11 @@ add_library(Vulkan-Registry INTERFACE)
target_include_directories(Vulkan-Registry INTERFACE $<BUILD_INTERFACE:"${CMAKE_CURRENT_SOURCE_DIR}/registry">)
add_library(Vulkan::Registry ALIAS Vulkan-Registry)
-include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/install.cmake)
+# https://cmake.org/cmake/help/latest/variable/PROJECT_IS_TOP_LEVEL.html
+string(COMPARE EQUAL ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR} PROJECT_IS_TOP_LEVEL)
+
+option(VULKAN_HEADERS_INSTALL "Install Vulkan Headers" ${PROJECT_IS_TOP_LEVEL})
+
+if (VULKAN_HEADERS_INSTALL)
+ include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/install.cmake)
+endif()