tartarus's bolg tartarus's bolg
  • Linux and Unix Guide
  • CMake
  • gcc
  • gdb
  • bash
  • GNU Make
  • DDCA-ETH
  • CS106L
  • CS144
  • NJU PA
  • NJU OS(jyy)
  • C
  • C++
  • Python
  • reveal-md
  • LaTex
  • Paper Reading
  • TBD
  • Linux and Unix Guide
  • CMake
  • gcc
  • gdb
  • bash
  • GNU Make
  • DDCA-ETH
  • CS106L
  • CS144
  • NJU PA
  • NJU OS(jyy)
  • C
  • C++
  • Python
  • reveal-md
  • LaTex
  • Paper Reading
  • TBD
  • pdb

  • make

  • cmake

    • Introduction
    • Basic Intro
    • Basic 01-hello-cmake
    • Basic 02-hello-headers
    • Basic 03-static-library
    • Basic 04-shared-library
    • Basic 05-installing
    • Basic 06-build-type
    • Basic 07-complie-flags
    • Basic 08-third-party-library
    • Basic 09-compiling-with-clang
    • Basic 10-building-with-ninjia
    • Basic 11-cpp-standard
    • Intermediate sub-projects
    • Intermediate static-analysis
    • packge-management 04-conan
    • packge-management 05-vcpkg
    • Offical Tutorial(未完成)
  • Linux and Unix

  • Basic_Software
  • cmake
tartarus
2023-04-13

Introduction

为什么需要 CMake 和 vcpkg (不一定,之后也可能使用其他包管理工具,比如 conan (opens new window))?
CMake 是一个跨平台的构建工具,可以生成针对不同平台的构建脚本,如 Makefile、Visual Studio 项目文件等。它可以自动生成依赖关系,使得构建过程更加高效和可靠。CMake 支持各种插件和模块,可以根据具体需求定制构建流程,也可以方便地集成第三方库。

vcpkg 则是一个 C++ 的包管理器,可以方便地下载、安装和管理各种第三方库。它支持多平台,包括 Windows、Linux 和 macOS 等,提供了方便的命令行界面和交互式选择器,使得用户可以快速地安装和升级各种库。vcpkg 还支持自定义构建选项,方便地管理依赖关系,并且与 CMake 集成时可以更方便地使用第三方库。

我的学习方式是通过官方手册来学习,官方手册提供了 CMake 的详细教程,并且教程是以实际的代码 (step by step) 为例子的,非常舒服!
官方教程链接: https://cmake.org/cmake/help/latest/guide/tutorial/index.html
教程对应的代码资源: https://github.com/Kitware/CMake

Updata:2023-4-15
我改变了我的学习方式,最近看上了一个更好的 cmake tutorial (opens new window),而且官方的教程看下来的感觉是不容易理解(我太菜了)。
我把之前在官方教程下记录的笔记归档为一个文档,并且命名为 Offical Tutorial

另外,建议大家直接去看英文原版 cmake tutorial (opens new window),这里写的东西其实也是我读英文原版过程中,借助 chatgpt 翻译为了中文版本。当然我对它的翻译进行了修正并润色并➕上了自己的理解与感悟,使得逻辑也更加连贯。

上次更新: 12/27/2023, 8:55:47 AM
8.0 make的运行
Basic Intro

← 8.0 make的运行 Basic Intro→

Theme by Vdoing | Copyright © 2023-2023 tartarus | CC BY-NC-SA 4.0
  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式