gpt4 book ai didi

Cmake : post-package step

转载 作者:行者123 更新时间:2023-12-02 10:06:49 25 4
gpt4 key购买 nike

我正在寻找一种在打包完成后执行代码的方法。

我尝试添加一个取决于生成的 PACKAGE 目标的自定义目标。看起来它不起作用,这是 cmake 错误:

CMake Error: The inter-target dependency graph contains the following strongly connected        component (cycle):
"ALL_BUILD" of type UTILITY
depends on "UPLOAD" (strong)
"PACKAGE" of type GLOBAL_TARGET
depends on "ALL_BUILD" (strong)
"UPLOAD" of type UTILITY
depends on "PACKAGE" (strong)
At least one of these targets is not a STATIC_LIBRARY. Cyclic dependencies are allowed only among static libraries.

为此,我使用以下代码:

add_custom_target(UPLOAD ALL 
COMMAND cmake -E echo "Should be post packging!"
)
add_dependencies(UPLOAD PACKAGE)

有什么方法可以让目标上传打包文件吗?

最佳答案

创建您自己的包目标。

add_custom_target(mypackage
COMMAND ${CMAKE_CPACK_COMMAND}
COMMAND ${CMAKE_COMMAND} -E echo "after packaging"
)

关于Cmake : post-package step,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21865761/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com