Cmake 如何使用CPACK构建.spec文件中定义的子包

Cmake 如何使用CPACK构建.spec文件中定义的子包,cmake,rpm,packaging,rpmbuild,cpack,Cmake,Rpm,Packaging,Rpmbuild,Cpack,根据上的本教程,我能够通过一个构建创建两个RPM,并执行以下操作: 我的等级库文件类似于: Name: @CPACK_PACKAGE_NAME@ License: the license Summary: the summary Group: Applications Version: @CPACK_PACKAGE_RELEASE_VERSION@.@CPACK_PACKAGE_MINOR_VERSION@.@CPACK_PACKAGE_SERVICE_PACK@ Re

根据上的本教程,我能够通过一个构建创建两个RPM,并执行以下操作:

我的等级库文件类似于:

Name:      @CPACK_PACKAGE_NAME@
License:   the license
Summary:   the summary
Group:     Applications
Version: @CPACK_PACKAGE_RELEASE_VERSION@.@CPACK_PACKAGE_MINOR_VERSION@.@CPACK_PACKAGE_SERVICE_PACK@
Release:   @CPACK_PACKAGE_BUILD@
%description
the description...

%package utils
Summary: the utils
Group: Applications
%description utils
description for the utils

%files
...

%files utils
different files
键入
rpmbuild-ba filename.spec
将创建两个RPM(一个用于主包,一个用于子包utils)。如何使用
include(CPACK)
,然后键入
makepackage
,实现同样的效果?

查看CMake。看起来您所需要做的就是通过变量指定等级库文件。您仍然需要设置适当的