cmake 教程

CMake 是个开源的跨平台自动化建构系统,它用组态档控制建构过程(build process)的方式和 Unix 的 Make 相似,只是 CMake 的组态档取名为 CmakeLists.txt。Cmake 并不直接建构出最终的软体,而是产生标准的建构档(如 Unix 的 Makefile 或 Windows Visual C++ 的 projects/workspaces),然后再依一般的建构方式使用。这使得熟悉某个整合开发环境(IDE)的开发者可以用标准的方式建构他的软体,这种可以使用各平台的原生建构系统的能力是 CMake 和 SCons 等其他类似系统的区别之处。CMake 可以编译原始码、制做程式库、产生适配器(wrapper)、还可以用任意的顺序建构执行档。CMake 支援 in-place 建构(二进档和原始码在同一个目录树中)和 out-of-place 建构(二进档在别的目录里),因此可以很容易从同一个原始码目录树中建构出多个二进档。CMake 也支援静态与动态程式库的建构。

CMake is an extensible, open-source system that manages the build process in an operating system and compiler-independent manner. Unlike many cross-platform systems, CMake is designed to be used in conjunction with the native build environment. Simple configuration files placed in each source directory (called CMakeLists.txt files) are used to generate standard build files (e.g., makefiles on Unix and projects/workspaces in Windows MSVC) which are used in the usual way.[1]

 

参考

[1] https://learnxinyminutes.com/docs/cmake/

教程参考 https://juejin.im/post/5a6f32e86fb9a01ca6031230

 

posted @ 2018-10-12 10:39  sdumaoziqi  阅读(122)  评论(0)    收藏  举报