From ba64ae62743ddcdf0c208a256c1cda443f0ba070 Mon Sep 17 00:00:00 2001 From: baldurk Date: Tue, 19 Sep 2017 16:56:38 +0100 Subject: [PATCH] Add a warning if only CMAKE_INSTALL_PREFIX is customised * VULKAN_LAYER_FOLDER points outside the prefix to /etc in absolute, so usually if you customise one you'll want to customise the other. * This is especially true if you're pointing the install prefix at some non-root location, and you want make install to succeed instead of failing to write to /etc. --- renderdoc/driver/vulkan/CMakeLists.txt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/renderdoc/driver/vulkan/CMakeLists.txt b/renderdoc/driver/vulkan/CMakeLists.txt index 9ddd2ba7d..b5d52c67b 100644 --- a/renderdoc/driver/vulkan/CMakeLists.txt +++ b/renderdoc/driver/vulkan/CMakeLists.txt @@ -40,11 +40,17 @@ set(sources set(definitions ${RDOC_DEFINITIONS}) +set(VULKAN_LAYER_FOLDER_DEFAULT /etc/vulkan/implicit_layer.d) + +if(NOT CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT AND NOT DEFINED VULKAN_LAYER_FOLDER) + message(WARNING "*** CMAKE_INSTALL_PREFIX has been customised to ${CMAKE_INSTALL_PREFIX}, but VULKAN_LAYER_FOLDER is not customised and defaults to ${VULKAN_LAYER_FOLDER_DEFAULT}. This may not do what you expect, e.g. installing to a non-root location ***") +endif() + # This must be specified separately because it needs to go in /etc regardless of what the install # prefix is, since the loader only looks in a set location (and /usr/share is reserved for distribution # packages). For people who want to 'make install' to another folder, perhaps for preparing a package, # they can set this variable to make sure it stays local -set(VULKAN_LAYER_FOLDER /etc/vulkan/implicit_layer.d CACHE PATH "Path to install the vulkan layer file") +set(VULKAN_LAYER_FOLDER ${VULKAN_LAYER_FOLDER_DEFAULT} CACHE PATH "Path to install the vulkan layer file") if(ANDROID) list(APPEND sources vk_posix.cpp vk_android.cpp vk_layer_android.cpp)