charles-lunarg/vk-bootstrap

Can't find “vulkan/vulkan.h”

qingwabote opened this issue · 6 comments

I use git-submodule + CMake and download Vulkan-Headers directly.

“vulkan/vulkan.h” is not in my search path when I include VkBootstrap.h.

I fix it only if I modify PRIVATE link to PUBLIC here, or I did something wrong?

target_link_libraries(vk-bootstrap
        PRIVATE->PUBLIC
        vk-bootstrap-compiler-warnings
        vk-bootstrap-vulkan-headers
        ${CMAKE_DL_LIBS})

This is likely because vk-bootstrap is looking for vulkan in system locations, yet you did not install the headers in a system location.

One solution would be to set VK_BOOTSTRAP_VULKAN_HEADER_DIR to your submodule directory.

vk-bootstrap downloads the Vulkan-Headers automatically, but does not make it PUBLIC, this is weird.

Wait, so your project gets the vulkan-headers directly, but then vk-bootstrap can't find them? Or do you mean your application can't use the headers that vk-bootstrap downloads?

I didn't intend for users to use the vulkan-headers that vk-bootstrap downloads (opting to rely on the user to install header by default, and only downloading them if none are provided or found).

"Or do you mean your application can't use the headers that vk-bootstrap downloads?"
Yes, my application includes "VkBootstrap.h", but "VkBootstrap.h" can't find "vulkan/vulkan.h" that downloaded by vk-bootstrap cmake.
I don't want to use vulkan sdk or download vulkan-headers manually for now, so I modified vk-bootstrap's cmake to export vulkan-headers for out-of-the-box.

Oh I see. I could add an option that makes vk-bootstrap 'expose' the vulkan headers. Then you just set the option and can use vk-bootstrap's vulkan.h instead.

I would still suggest you install the SDK, specifically because it makes it super easy to get validation layers, an integral part of working with vulkan. And if you are not on windows, most package managers ship validation layers without the bloat of the rest of the SDK.

Thank you, I also think that I'll use the SDK early or late. One step at a time.