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.
This commit is contained in:
baldurk
2017-09-19 16:56:38 +01:00
parent 6ec2aa55a0
commit ba64ae6274
+7 -1
View File
@@ -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)