nvpro_core icon indicating copy to clipboard operation
nvpro_core copied to clipboard

Incorrect Vulkan SDK `Include` directory case on Linux

Open Triang3l opened this issue 2 years ago • 0 comments

cmake/find/FindVulkanSDK.cmake contains the following code for obtaining the path to the Vulkan SDK headers:

if(EXISTS "${VULKANSDK_ROOT_DIR}/Include/vulkan/vulkan.h")
  SET(VULKANSDK_INCLUDE_DIR "${VULKANSDK_ROOT_DIR}/Include" CACHE PATH "path")
else()
  SET(VULKANSDK_INCLUDE_DIR "${VULKANSDK_ROOT_DIR}" CACHE PATH "path")
endif()

Due to case sensitivity of paths in Linux file systems, it's unable to find vulkan.h in the include directory, as it attempts to locate it in Include starting with the capital I (which is the directory name in the Windows release of the Vulkan SDK).

Adding an elseif trying the include directory resolves this issue and makes CMake succeed for me, but I'm not sure what fix would look the nicest here. I haven't checked the paths in the macOS version of the SDK, but for Windows, just looking for include would be enough as the file systems usually used on Windows are case-insensitive, so Include will be located too. Or possibly, a WIN32/UNIX conditional would be the best here, though the simplest solution will probably be just to check the include directory.

The way I'm invoking CMake is VULKAN_SDK=/path/to/VulkanSDK/1.3.224.1/x86_64/ cmake . from within the vk_order_independent_transparency sample directory, due to issues with locating libshaderc_combined.a unless the explicit Vulkan SDK path is specified, at least on the distribution that I'm using (ALT Linux Workstation 10).

Triang3l avatar Sep 18 '22 12:09 Triang3l