使用 CPack 打包时需要 CMake 安装步骤吗?

do I need the CMake install step when packaging with CPack?

阅读 cmake/cpack 文档,指出 CPack 将生成一个安装程序,其中 包含通过 CMake 的 INSTALL 命令安装的所有内容

但是,我下面的打包命令行序列中是否需要cmake --build . --target install

 - cmake ..
 - cmake --build .
 - cmake --build . --target install
 - cmake --build . --target package 

打包是安装的替代方法。

如果你想创建一个包,你不需要执行install目标。

(但安装可能由 'package' 目标隐式执行)。