我正在寻找包装完成后执行代码的方法。
我尝试添加一个取决于生成的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.
Run Code Online (Sandbox Code Playgroud)
为此,我习惯于以下代码:
add_custom_target(UPLOAD ALL
COMMAND cmake -E echo "Should be post packging!"
)
add_dependencies(UPLOAD PACKAGE)
Run Code Online (Sandbox Code Playgroud)
有什么办法可以让目标上传已打包的文件?
cmake ×1