forked from xiaoweiChen/CMake-Cookbook
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d40e483
commit e9a0d3d
Showing
1 changed file
with
18 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# 第11章 打包项目 | ||
|
||
本章的主要内容有: | ||
|
||
* 生成源代码和二进制包 | ||
* 使用CMake/pybind11构建的C++/Python项目,通过PyPI发布 | ||
* 使用CMake/CFFI构建C/Fortran/Python项目,通过PyPI发布 | ||
* 以Conda包的形式发布一个简单的项目 | ||
* 将作为Conda包依赖项发布给项目 | ||
|
||
目前为止,已经“从源代码”编译并安装了(示例)软件包——这意味着可以通过Git获取项目,并手动执行配置、构建、测试和安装步骤。然而,在实践中,软件包通常是使用管理器来安装的,比如Apt、DNF、Pacman、pip和Conda。我们需要能够以各种格式发布我们的代码项目——作为源文件或二进制安装程序。 | ||
|
||
这就是我们现在方案中所提到的打包时,它显示了使用CMake的项目的各个阶段: | ||
|
||
![](../../images/preface/2.png) | ||
|
||
在本章中,我们将探讨不同的打包策略。首先讨论使用CMake中的工具CPack进行打包,还提供打包和上传CMake项目到Python包索引(PyPI, https://pypi.org)和Anaconda Cloud (https://anaconda.org)的方法——这些都是通过包管理器pip和Conda (https://conda.io/docs/ )分发包的平台。对于PyPI,我们将演示如何打包和分发混合C++/Python或C/Fortran/Python项目。对于Conda,我们将展示如何对依赖于其他库的C++项目进行打包。 | ||
|