FindVulkan: check CMake config file of each library first and follow their target name convention
FindVulkan tends to assume that Vulkan libraries have been installed through Vulkan SDK of LunarG, which is just one way to install Vulkan libraries, but not the only way. When you build each library yourself from sources, you can ends up with libraries installed in different locations, with CMake config files (they have been added progressively to each library).
These CMake config files should have precedence in FindVulkan, because it's more robust. Moreover they may not define the same target names than the one defined in FindVulkan. So it would be nice to deprecate several target names in favor of target names of these config files to avoid a mess of inconsistent target names in projects depending on Vulkan.
- vulkan-headers:
- config file:
VulkanHeadersConfig.cmake
- targets in config file:
Vulkan::Headers
,Vulkan::Registry
- targets in module file:
Vulkan::Headers
- config file:
- vulkan-loader:
- config file:
VulkanLoaderConfig.cmake
- targets in config file:
Vulkan::Loader
- targets in module file:
Vulkan::Vulkan
- config file:
- glslang:
- config file:
glslangConfig.cmake
- targets in config file:
glslang::glslang
,glslang::SPIRV
,glslang::HLSL
,glslang::SPVRemapper
,glslang::glslang-standalone
,glslang::spirv-remap
- targets in module file:
Vulkan::glslang
,Vulkan::glslangValidator
- config file:
- SPIRV-Headers:
- config file:
SPIRV-HeadersConfig.cmake
- targets in config file:
SPIRV-Headers::SPIRV-Headers
- targets in module file: ?
- config file:
- SPIRV-Tools (config files are not very neat, some coordination with library maintainers would be wise):
- config files:
SPIRV-ToolsConfig.cmake
,SPIRV-Tools-optConfig.cmake
,SPIRV-Tools-linkConfig.cmake
,SPIRV-Tools-reduceConfig.cmake
,SPIRV-Tools-lintConfig.cmake
,SPIRV-Tools-diffConfig.cmake
- targets in config file:
SPIRV-Tools-shared
if shared elseSPIRV-Tools-static
,SPIRV-Tools-opt
,SPIRV-Tools-link
,SPIRV-Tools-reduce
,SPIRV-Tools-lint
,SPIRV-Tools-diff
- targets in module file:
Vulkan::SPIRV-Tools
- config files:
- volk:
- config file:
volkConfig.cmake
- targets in config file:
volk::volk
,volk::volk_headers
- targets in module file:
Vulkan::volk
- config file:
Edited by SpaceIm