[cpack卡在predstall中]
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
上面的链接中下载附件:
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:
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:
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!
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:
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论