Replies: 1 comment 2 replies
-
为啥不直接用 |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
我目前正在构建 matio, 此项目依赖 hdf5, 由于我的最终目标是在 xmake 中引用 matio, 因此我自然地打算用 xrepo 安装 hdf5 后把相关路径传递给构建 matio 的 cmake.
但是我发现 xrepo 安装出的 hdf5 不能被 cmake 里的
find_package
找到, 而我从 hdf5 官方下载的预编译版可以. 这是个跨平台项目, 我不太想在 CI 里分别处理各平台的 hdf5, 因此看起来明面上的良好方案是使用 xrepo 安装 hdf5.此处问题是因为 xrepo 安装 hdf5 时缺失了一些东西呢, 还是 xrepo 的先天构造其安装的包无法被 cmake
find_package
找到? 我能解决吗?另外, matio 要求指定 hdf5_dir 在环境变量里, 那么我该怎么在 xmake.lua 代码里找到 hdf5 安装位置并设置环境变量里传递给 cmake 呢? 我目前的想法是使用类似此处的方案管理 cmake 包, 我想我应该用 xmake 的
find_package
来找到这个包后设置环境变量, 但是这个函数在文档里说不再推荐使用, 那我应该用什么呢?由于 xmake
find_package
的文档很少, 我花了一些时间来观察相关函数的行为, 以及修改某些参数后 cmake 的行为. 但是每次调试都要xmake build
来看, 我已经看到了文档里的xmake lua
, 但是import("lib.detect").find_package("hdf5")
的结果只是<
, 使用xrepo fetch hdf5
则能正常看到结果. 这里的正确用法是什么?谢谢!
Beta Was this translation helpful? Give feedback.
All reactions