[CMake] Find Vulkan on 32 bit builds

Andreas Naumann Andreas-Naumann at gmx.net
Sun Jan 8 08:36:21 EST 2017


Hello,
Am 08.01.2017 um 07:22 schrieb Saad Khattak:
> Hello,
>
> When I run "find_package(VULKAN)" in a CMakeLists for a Visual Studio 
> 2015 32-bit project, the ${Vulkan_LIBRARY} and ${Vulkan_LIBRARIES} 
> variables both point to the "Bin" folder for the Vulkan installation 
> instead of the "Bin32" folder.
>
> I looked at the FindVulkan.cmake module and even put MESSAGE(STATUS 
> ...) on the "elseif(CMAKE_SIZEOF_VOID_P EQUAL 4)" to see if I made a 
> mistake setting up. The message does indeed print confirming that my 
> pointer size is 4 and thus the current toolchain selected is 32 bit.
>
> What's perplexing is that when I do a MESSAGE(STATUS 
> ${Vulkan_LIBRARY}) the path is:
>
>
> D:/VulkanSDK/1.0.37.0/Bin/vulkan-1.lib <http://1.0.37.0/Bin/vulkan-1.lib>
>
>
> instead of
>
>
> D:/VulkanSDK/1.0.37.0/Bin32/vulkan-1.lib 
> <http://1.0.37.0/Bin32/vulkan-1.lib>
>
>
> It makes no sense. Line 47 of FindVulkan.cmake has Bin32. Why is CMake 
> ignoring 32?
>
You should think the other way around: Why should cmake look in a 
special directory, when it finds a library with an appropriate name 
before this one?
This decision should be in the corresponding FindVulkan.cmake, i.e. the 
corresponding find_library call should be constrained to 
${VULKAN_DIR}/Bin32 in the 32bit case.
>
>

Regards,
Andreas


More information about the CMake mailing list