CMake笔记:Linux下常规使用

1. 命令行下配置

ccmake -B ./build_dir -S ./src_dir

2. 编译

cmake --build ./build_dir

编译时可加上并行编译选项: --parallel

参看:https://cmake.org/cmake/help/v3.21/manual/cmake.1.html

3. 重新编译

重现编译,可以使用 CMake 命令清理(不删除目录,清理编译产物,但保留 CMake 缓存):

cmake --build . --target clean

4. 安装

cmake --install ./build_dir

相关推荐
zh_xuan1 天前
Android JNI 动态注册:获取系统内存页大小
android·cmake·jni·ndk·动态注册·内存页大小
雪靡3 天前
Visual Studio 2026 优雅的给Cmake设置大代理
c++·ide·cmake·visual studio
郝学胜-神的一滴4 天前
CMake 011:跨平台动态库编译
开发语言·c++·嵌入式硬件·qt·程序人生·cmake·liunx
郝学胜-神的一滴11 天前
CMake 010 :一步到位链接静态库
开发语言·c++·qt·程序人生·系统架构·cmake
草莓熊Lotso12 天前
【CMake】 工程实战:可执行文件从编译、链接到安装全流程深度拆解
linux·运维·服务器·网络·c++·cmake
明月_清风16 天前
Makefile 完全指南:从入门到 CMake 工程化实践
后端·cmake
yuanyuan2o217 天前
从最小项目开始的 CMake 教程
c语言·开发语言·arm开发·c++·makefile·make·cmake
瞎折腾啥啊20 天前
VCPKG详细使用教程
linux·c++·cmake·cmakelists
郝学胜-神的一滴23 天前
跨平台动态库与头文件:从原理到命名的深度解析
linux·c++·程序人生·unix·cmake