Topic 1.4 从 C++ 到 C¶
Abstract
- 学会使用 CMake 打包程序库
- 完成实验 0,能够使用 SFTP 进行远程编辑
- 阅读 from_cxx_to_c 中的程序,体会 C++ 和 C 的异同
CMake¶
CMake is a family of tools designed to build, test and package software. CMake is used to control the software compilation process using simple platform and compiler independent configuration files, and generate makefiles and workspaces that can be used in the compiler environment of your choice.
阅读材料
- BUILD WITH CMAKE <https://vnav.mit.edu/labs/lab1/cmake.html>
CMakeLists.txt
With CMake, we write
CMakeLists.txt
files to inform it where to find source code and header files.
We then call CMake to generate makefiles, which are then used to compile and generate libraries and executables.
目录结构
starter-proj
相关文件
-
starter-proj/CMakeLists.txt
-
starter-proj/SimpleCSLib/CMakeLists.txt