Introduction to CMake

Introduction to CMake

1. What is CMake CMake is a more advanced build configuration tool than make, supporting different platforms and compilers, generating corresponding Makefiles or vcproj projects (Visual Studio project files). By writing a CMakeLists.txt file, you can control the generated Makefile, thereby controlling the build process. The Makefile generated by CMake not only allows you to … Read more

A Beginner’s Guide to Modern CMake

A Beginner's Guide to Modern CMake

The eBook “A Beginner’s Guide to Modern CMake” http://t.cn/A6r1ls4q “People love to complain about build systems. Just look at the talks from CppCon17, where developers used the current state of build systems as a punchline. This raises a question: why? Of course, there are countless issues during the build process. But I believe we have … Read more

Building C++ Projects: Makefile and CMake

Building C++ Projects: Makefile and CMake

Building C++ Projects: Makefile and CMake In the software development process, build management is a crucial aspect. For C++ projects, the two commonly used build tools are Makefile and CMake. This article will provide a detailed introduction to these two tools, including basic concepts, usage methods, and code examples to help you better understand how … Read more

Stop Using the Default Compiler? CMake Compiler Configuration Enables Code Compilation Anywhere!

Stop Using the Default Compiler? CMake Compiler Configuration Enables Code Compilation Anywhere!

Click the blue textFollow the author 1. Background Introduction CMake compiler configuration not only relates to performance but also directly affects the maintainability and portability of the code. By explicitly specifying the compiler and its options, you can ensure consistent behavior of the code across different platforms and reduce maintenance costs. Limitations of using the … Read more

Is Your CMake Build Slow? A Deep Dive into Build Types!

Is Your CMake Build Slow? A Deep Dive into Build Types!

Click the blue textFollow the blogger 1. Overview of CMake Build Types In CMake, “build type” refers to a set of predefined settings and options used to control the compilation and linking process. It is essentially a variable <span>CMAKE_BUILD_TYPE</span> that can be explicitly set or determined by CMake based on default rules. The build type … 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

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