CMake Find Packages
PatchByte opened this issue · 2 comments
PatchByte commented
How to use packages such as Vulkan.
Like if you would want to do:
find_package(Vulkan REQUIRED)
The problem is cmake would try to search after the linux package. I have not found any way to fix this.
mstorsjo commented
When cross compiling with CMake, you need to set a bunch of cmake flags to tell it where/how to look for things, and what not to look for. One way of configuring those flags, which might work, is something like this:
-DCMAKE_FIND_ROOT_PATH=$CROSS_ROOT
-DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER
-DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY
-DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY
-DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=ONLY
PatchByte commented
Hey I fixed this issue by adding the parameters:
Thanks again for the quick answer!
-DVulkan_INCLUDE_DIR=PathToWineInstance/drive_c/VulkanSDK/1.3.275.0/Include
-DVulkan_LIBRARY=PathToWineInstance/drive_c/VulkanSDK/1.3.275.0/Lib/vulkan-1.lib
-DCMAKE_FIND_ROOT_PATH=$CROSS_ROOT
-DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER
-DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY
-DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY
-DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=ONLY
And setting CROSS_ROOT to the right path!