[cpack卡在predstall中]

发布于 2025-02-01 15:52:11 字数 1606 浏览 5 评论 0原文

CMAKE- VERSION

CMAKE版本3.16.2

Centos7信息:

Linux WXT 3.10.0-1160.EL7.X86_64#1 SMP MON OCT 19 16:18:59 UTC 2020 X86_64 X86_64 X86_64 X86_64 x86_64 x86_64 GNU/Linux

我想打包RPM包,有一些文件可以安装在两个组件中。当我执行CAMKE之后,当我不将add_custom_target用于cpack命令时。 make命令,我手动执行命令:cpack -g rpm -config ./cpackconfig.cmake,包装所有文件没有问题。 我只想自动打包文件,所以我在下面的cmakelists.txt中添加一个目标:

在这里说明

然后我执行了Camke ..&&提出命令,我希望它可以完成编译并包装我的所有文件。但是实际上发生的是命令:“ cpack -g rpm -config ./cpackconfig.cmake”执行时,它将卡在预设阶段中。只需安装4个文件,并且在安装目录中的文件不断创建和删除。卡住图片如下:

在这里输入映像说明

即使我执行命令“ cpack -g g rpm -config ./cpackconfig.cmake“手动也陷入了预安装阶段。 我发现,如果我更改构建目录中的文件:“ build/cmakefiles/a_pkg.dir/build.make”,只需更改图下图下的行中的其他命令中的行,例如:“ mkdir 123”,然后我执行命令” cpack -g rpm -config ./cpackconfig.cmake“手动起作用!

在这里

我知道,我知道将cpack_cmake_generator更改为其他值,例如“ ninja”旁路阶段的预安装,但我想知道为什么自定义目标会导致预安装固定,以及我如何通过将cpack_cmake_generator设置为“ unix makefiles”来解决它,我的代码在github cmake cmake的问题附件中,您可以在下面的链接中下载它依恋。请告诉我如何在代码中解决包装问题,我的代码非常简单!

Link:

https://gitlab.kitware.com/cmake/cmake/-/ essess/23529

上面的链接中下载附件:

enter Image Descriage

cmake --version

cmake version 3.16.2

centos7 information:

Linux wxt 3.10.0-1160.el7.x86_64 #1 SMP Mon Oct 19 16:18:59 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

I want to pack a RPM package, There are some files to install in 2 compnents. When I don't use add_custom_target for cpack command, after I execute the camke .. && make command, I manually execute the command: cpack -G RPM --config ./CPackConfig.cmake, there is no problem for pack all files.
I just want to pack files automatically, so I add a target in my CMakeLists.txt in below picture:

enter image description here

Then I execute the camke .. && make command, I expect it can finish compiling and package all my files. But what happens actually is when the command: "cpack -G RPM --config ./CPackConfig.cmake" is executed, it will stucked in preinstall stage. there are just 4 files to install, And files in the installation directory are constantly created and deleted. The stuck picture is below:

enter image description here

Even if I execute command "cpack -G RPM --config ./CPackConfig.cmake" manually, it also stuck in preinstall stage.
I found that if I change the file in my build directory: "build/CMakeFiles/A_pkg.dir/build.make", just change the line in below picture for other command such as: "mkdir 123", then I execute command "cpack -G RPM --config ./CPackConfig.cmake" manually, it works!

enter image description here

I know that change CPACK_CMAKE_GENERATOR to other value for example "Ninja", it can bypass phase preinstall, but I want to know why custom target cause preinstall stuck, and how can I solve it by set CPACK_CMAKE_GENERATOR as "Unix Makefiles", My code is in the GitHub cmake's issue attachment in below link, you can download it in the attachment. Please tell me how to solve the packaging problem in my code, My code is extremely simple!

Link:

https://gitlab.kitware.com/cmake/cmake/-/issues/23529

Download attachment In the link above:

enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文