Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMake Find Packages #114

Closed
PatchByte opened this issue Feb 15, 2024 · 2 comments
Closed

CMake Find Packages #114

PatchByte opened this issue Feb 15, 2024 · 2 comments

Comments

@PatchByte
Copy link

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
Copy link
Owner

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
Copy link
Author

PatchByte commented Feb 17, 2024

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants