CMake Command Quick Reference: Comprehensive Overview of Common Commands

CMake Command Quick Reference: Comprehensive Overview of Common Commands

Click the blue text to follow the author 1. Introduction CMake is a cross-platform open-source build system generator. It does not directly build software but generates a build system for a specific platform based on the descriptions in the <span>CMakeLists.txt</span> file. The role of CMake is to decouple the build process from the compiler, operating … Read more

How to Install CMake on OpenWRT

How to Install CMake on OpenWRT

• OpenWRT’s opkg supports most software packages, but some specific domain packages still require source installation, such as the SRS server (streaming media server). Source programming typically requires CMake. This article attempts to compile and install CMake from source in OpenWRT system based on Host mode, summarizing the problems encountered and their solutions as follows. … Read more

CMake Documentation Reading Notes – Simple ‘Hello World’ Project

CMake Documentation Reading Notes - Simple 'Hello World' Project

First, install gcc-g++ and cmake. Taking CentOS as an example: yum install gcc-c++ yum install cmake First, create a main.cpp file that includes a main function, and create a CMakeLists.txt file. The purpose of the CMakeLists.txt file is to guide CMake in compiling the C++ program on the current operating system. main.cpp #include <iostream> int … Read more

Introduction to Make in Linux C

Introduction to Make in Linux C

From WeChat Official Account: One Linux Introduction to Make: Make is an engineering manager, which, as the name suggests, is used to manage a large number of files. The Make engineering manager is essentially an “automatic compilation manager“. The term “automatic” refers to its ability to automatically discover updated files based on file timestamps, thereby … Read more

BitBake – A Powerful Engine for Embedded Linux Build Systems

BitBake - A Powerful Engine for Embedded Linux Build Systems

BitBake is a powerful build tool primarily used for building embedded Linux systems, playing a core role in the Yocto Project. It is not just a simple build tool but a complete task execution engine capable of handling complex dependencies and build processes. Basic Concepts BitBake uses specific configuration files (.bb files) to describe how … Read more

Using CMake: A C++ Project Build Tool

Using CMake: A C++ Project Build Tool

Using CMake: A C++ Project Build Tool CMake is a popular cross-platform build system that generates standardized build files, allowing C++ projects to be easily compiled and managed across different operating systems and development environments. In this article, we will introduce the basic usage of CMake and how to use it to create a simple … Read more

CMake from Beginner to Pro (1): A Minimal Introduction to CMake – Environment Setup and First Project

CMake from Beginner to Pro (1): A Minimal Introduction to CMake - Environment Setup and First Project

1. Why Use CMake? In C++ projects, manually managing the build chain (especially for large projects with multiple platforms and modules) can introduce significant complexity. CMake addresses the following issues with its declarative syntax: Cross-platform builds: Generates build files for the corresponding platform (Makefile/MSVC project/Xcode project) Dependency management: Automatically finds third-party libraries (such as OpenCV, … Read more

Exploring CMakeLists: ROS and Catkin

Exploring CMakeLists: ROS and Catkin

Introduction to CMakeLists<span>CMakeLists.txt</span> file is the input file for the CMake build system used to build software packages. Any package that conforms to the CMake specification contains one or more <span>CMakeLists.txt</span> files that describe how to build the code and where to install it. The <span>CMakeLists.txt</span> file used for catkin projects is a standard CMakeLists.txt … Read more

Comprehensive Guide to CMakeLists (Part 1)

Comprehensive Guide to CMakeLists (Part 1)

Word count: 7897, approximately 40 minutes of reading time Comprehensive Guide to CMakeLists (Part 1) 0. CMake Application Examples Previously, we organized content on using CMake to introduce third-party libraries (header file directories, library directories, library files). However, the content organized here is not complete. Therefore, we need to further organize the usage of CMake … Read more

CMake Basics: Configuration and Best Practices

CMake Basics: Configuration and Best Practices

1. File Structure mkdir buildcmake .. -G "Unix Makefiles"make 2. Code Explanation # CMake recommends using "out-of-source builds" to avoid polluting the source code directory. # Create a build directory (name can be arbitrary, e.g., build/) mkdir build # Enter that directory cd build # Specify the parent directory of CMakeLists.txt (i.e., the source code … Read more