简体   繁体   English

CMake:如何使用CPack更改默认软件包名称-Linux

[英]CMake : How to change default package name using CPack - linux

In my project, I have created two package. 在我的项目中,我创建了两个包。

  1. Default package with all the components except 'XYZ' module. 默认包装,带有除“ XYZ”模块以外的所有组件。
  2. Specific package with XYZ component by using COMPONENT <XYZ> in INSTALL command. 通过在INSTALL命令中使用COMPONENT <XYZ> ,可以对带有XYZ组件的特定程序包进行打包。

Now, problem is that, I have specify CPACK_SOURCE_PACKAGE_FILE_NAME and when I run make package command its generated two package with name as specify bellow. 现在的问题是,我已经指定了CPACK_SOURCE_PACKAGE_FILE_NAME ,当我运行make package命令时,它会生成两个名称如下的软件包。

set(CPACK_SOURCE_PACKAGE_FILE_NAME "AB-1.0.2") in CMakeList.txt 在CMakeList.txt中set(CPACK_SOURCE_PACKAGE_FILE_NAME "AB-1.0.2")

make package

then otput are: 那么otput是:

CPack: Create package
CPack: - package: /home/build/AB/AB-1.0.2-Unspecified.tar.bz2 generated.
CPack: - package: /home/build/AB/AB-1.0.2-XYZ.tar.bz2 generated.

I want to change that default package name as well as second package name. 我想更改该默认软件包名称以及第二个软件包名称。

I have googled but unable to find any direct way to specify default package name or rename this package. 我已经用谷歌搜索,但是找不到任何直接方法来指定默认软件包名称或重命名此软件包。

Many thaks in advance. 提前很多thak。

You can change the file name with the CPACK_PACKAGE_FILE_NAME variable CPACK_SOURCE_PACKAGE_FILE_NAME gets only involved when you run 您可以使用CPACK_PACKAGE_FILE_NAME变量来更改文件名CPACK_SOURCE_PACKAGE_FILE_NAME仅在运行时涉及

make package_source

EDIT 编辑

You have also the option to change the default Component name with setting the CMAKE variable CMAKE_INSTALL_DEFAULT_COMPONENT_NAME 您还可以通过设置CMAKE变量CMAKE_INSTALL_DEFAULT_COMPONENT_NAME来更改默认的组件名称。

Have a look at this http://www.cmake.org/cmake/help/v3.0/command/install.html 看看这个http://www.cmake.org/cmake/help/v3.0/command/install.html

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

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