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

Journey 6|Understanding CMakeLists in the VP Toolchain Example

Journey 6|Understanding CMakeLists in the VP Toolchain Example

01 Introduction In the article Journey 6|Introduction to VP and Practical Use of Single Operators we introduced what VP is and demonstrated how to use the VP API with the single operator rotate as an example. In Journey 6|Understanding Log Printing in the VP Toolchain Example we discussed how to write the header files for … 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

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

Common Syntax of CMake (Loops)

Common Syntax of CMake (Loops)

Previous exciting content:CMake Hello, WorldCMake VariablesCMake Official Tutorial (Basic Project Setup)CMake Official Tutorial (Library Creation)CMake Official Tutorial (Usage Requirements)CMake Official Tutorial (Installation and Testing)CMake Common Syntax (if Statement)CMake Common Syntax (Cache Variables)CMake Common Syntax (Environment Variables)CMake Common Syntax (Mathematical Calculations)CMake Common Syntax (Strings)CMake Common Syntax (Lists) CMake primarily has two types of loops: foreach and … Read more

CMake Insights: A Case Study with FAST-LIO

CMake Insights: A Case Study with FAST-LIO

Review: Why do we use Make and CMake tools? The main reasons are to automate the build process, manage dependencies, and simplify cross-platform development for complex project compilation requirements: Large C++ projects often consist of multiple source files, header files, and library dependencies, making manual compilation commands (like <span>g++</span>) error-prone and inefficient. Dependency Management: Build … Read more

CMake Mastery (5): Comprehensive Guide to add_library – Static and Dynamic Libraries

CMake Mastery (5): Comprehensive Guide to add_library - Static and Dynamic Libraries

Master the Core Logic of Library Building from Compilation Principles to Industrial Practices 1. Essential Differences Between Static and Dynamic Libraries Core Feature Comparison Feature Static Library (<span>.a</span>/<span>.lib</span>) Dynamic Library (<span>.so</span>/<span>.dll</span>) Linking Method Compiled into the executable file at build time Loaded dynamically at runtime Memory Usage Multiple loads of the same library will consume … 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

CMake Function Syntax

CMake Function Syntax

In CMake, functions are used to encapsulate a reusable block of code. Below is a detailed explanation of defining and calling functions in CMake. Defining Functions Function definitions start with function(), followed by the function name and any parameter list, as shown below: function(<function_name> [arg1 [arg2 […]]]) # Function code… endfunction() The function name should … 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