-
-
Notifications
You must be signed in to change notification settings - Fork 814
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
More flexible package fetching from cmake #2576
Comments
这个不是原本就支持么 xmake/xmake/modules/package/manager/cmake/find_package.lua Lines 42 to 55 in 30ceace
|
这个怎么搞?要么传自定义 targetlinks 进去, |
还有这, 要么你直接来个 pr 吧。https://github.com/xmake-io/xmake/blob/master/xmake/modules/package/manager/cmake/find_package.lua |
targetlinks这个名字不是很贴切,改成link_libraries比较好,因为cmake里面的 |
好了 add_requires("cmake::xxx", {configs = {link_libraries = {"abc::lib1", "abc::lib2"}}})
add_requires("cmake::xxx", {configs = {search_mode = "config"}}) -- module, both |
不好意思我没讲清楚,both就是啥也不加,默认就两个都找,不需要额外声明,需要声明的只有config和module |
那就不设置就行了 add_requires("cmake::xxx", {configs = {search_mode = "config"}})
add_requires("cmake::xxx", {configs = {search_mode = "module"}})
add_requires("cmake::xxx") -- both
|
你在什么场景下需要该功能?
https://cmake.org/cmake/help/latest/guide/using-dependencies/index.html#guide:Using%20Dependencies%20Guide
希望xmake支持:
find_package(ABC CONFIG REQUIRED)
(仅从ABCConfig.cmake查找)find_package(Boost 1.79 COMPONENTS date_time)
target_link_libraries(test PRIVATE ABC::lib1 ABC::lib3)
这里第3点很重要,因为package提供的cflags、cxxflags、defines、syslinks都是通过这种方式链接才有,只链接
ABC_LIBRARIES
不仅无法控制链接的库和顺序(可能导致冲突),还会丢失信息(可能导致编译不过)。描述可能的解决方案
改进cmake/find_package模块
描述你认为的候选方案
No response
其他信息
No response
The text was updated successfully, but these errors were encountered: