简体   繁体   English

如何在Linux上由cmake / cpack生成的包中包含所有3rdparty运行时依赖项?

[英]How to include all 3rdparty runtime dependencies into cmake/cpack-generated package on linux?

I have a c++ project with a couple of executables set up with cmake. 我有一个c ++项目,其中包含使用cmake设置的几个可执行文件。 The usual workflow is to install all 3rdparty dependencies via package manager, build and install a package via cpack on that same machine. 通常的工作流程是通过程序包管理器安装所有3rdparty依赖项,并通过cpack在同一台计算机上生成并安装程序包。 Now, I would like to include all runtime dependencies in that package to be able to install it on another machine without needing to install 3rdparty dependencies there like on the build machine. 现在,我想在该软件包中包含所有运行时依赖项,以便能够将其安装在另一台计算机上,而无需像在构建计算机上那样在该计算机上安装3rdparty依赖项。

I did lot's of research on the web - without much success. 我在网络上做了很多研究-没有太大的成功。 I found something called BundleUtilities for cmake but couldn't find any entry-friendly documentation about it. 我为cmake找到了一个称为BundleUtilities的东西,但是找不到关于它的任何入门友好的文档。 I don't even know if it does what I need. 我什至不知道它是否满足我的需求。

I would like to use cmake's benefits and generate such a "bundled" package without any manual intervention or anything. 我想利用cmake的好处并生成这样的“捆绑”包,而无需任何人工干预或任何其他方式。 I do not want to assemble and copy 3rdparty dependencies manually. 我不想手动组装和复制3rdparty依赖项。 Ideal would be a clean cmake/cpack solution for the problem. 理想的解决方案是使用干净的cmake / cpack解决方案。

Edit: 编辑:

To clarify: The target machine in question has no internet connection. 需要说明的是:有问题的目标计算机没有Internet连接。

Are you really sure you want to do this? 您确定要这样做吗? It probably won't turn out to be a great idea... packaging third party tools is effectively assuming responsibility for third party software, and as the upstream version inevitably gets out ahead of what people are finding in your tarballs that can become a real headache. 可能不会变成一个好主意...打包第三方工具实际上是在承担第三方软件的责任,并且随着上游版本不可避免地领先于人们在您的压缩包中发现的东西,而后者可能会变成现实。头痛。 Consider whether you're really ok with seeing version conflicts because your dependencies are installed. 考虑一下是否真的可以接受版本冲突,因为已经安装了依赖项。

Why not just have cmake call out to the system's package manager at config time? 为什么不在配置时将cmake调出到系统的软件包管理器? The exec_process() command will run console commands for you. exec_process()命令将为您运行控制台命令。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM