From 3703ef88ff1693310c1ca159f411a9d4ebe52dda Mon Sep 17 00:00:00 2001 From: Adam Sawicki Date: Tue, 29 Nov 2022 16:06:36 +0100 Subject: [PATCH] Fixing CMakeLists.txt for older Cmake See #303 --- CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index a1397dc..df35846 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,6 +2,9 @@ cmake_minimum_required(VERSION 3.9) project(VulkanMemoryAllocator) +# 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) + if(PROJECT_IS_TOP_LEVEL) find_package(Vulkan REQUIRED) endif()