CMake User Guide (Part 1): Common Techniques and Compilation Summary

CMake User Guide (Part 1): Common Techniques and Compilation Summary

In C/C++ projects, CMake has become the industry standard for build systems, and cross-compilation is a hurdle that every embedded developer will encounter. Simply put, it involves setting up a code compilation environment for Arm boards to run code on Arm devices. The commonly used compilation tools are Makefile and CMake, and this article records … Read more

C++ Project Build Part Eight: CMake Code Directory

C++ Project Build Part Eight: CMake Code Directory

Last time, in C++ Project Build Part Seven: Creating a Library with CMake, all the source code of the modules (libraries and executables) in the example demo7 was in one directory, which made the structure very unclear (if there are hundreds of source files, it would be a nightmare). Below, we will look at an … Read more

CMake User Guide (Part II): Operations and Basic Usage with Multiple Source Files

CMake User Guide (Part II): Operations and Basic Usage with Multiple Source Files

When managing multiple source files in C/C++ projects, CMake has become the industry standard for build systems. This article will analyze the core methods for handling multiple source file operations and common basic usages of CMake statements, documenting how to eliminate the tedious task of manually maintaining compilation lists. 1. Project Structure When there are … Read more

Comprehensive Guide to Integrating Qt Projects with CMake: The Correct Approach to Automatic MOC / UIC / RCC

Comprehensive Guide to Integrating Qt Projects with CMake: The Correct Approach to Automatic MOC / UIC / RCC

When writing C++ projects with Qt, many people’s first reaction is to directly use Qt Creator to create a <span>.pro</span> project, compile, and run, which goes smoothly. However, once the project needs to interface with an existing CMake build system or needs to be built in a cross-platform CI environment, the <span>.pro</span> file becomes inflexible, … Read more

Struggling with CMake Dependencies? Use This Tool for Easy Visualization!

Struggling with CMake Dependencies? Use This Tool for Easy Visualization!

Introduction: Have you encountered these “dependency hell” issues? Have you ever found yourself debugging a complex CMake project, staring at a screen full of <span>add_subdirectory</span> and <span>target_link_libraries</span>, feeling like you’re solving a maze? Have you wanted to showcase the dependency structure in project documentation, but could only rely on drawing tools to sketch it out … Read more

Qt6 CMake: Goodbye qmake, Introduction to CMake

Qt6 CMake: Goodbye qmake, Introduction to CMake

Hi~ This is Weekly Qt, dedicated to sharing valuable Qt knowledge.This will be a series of articles aimed at smoothly introducing everyone to building Qt projects using CMake.qmake is a very important tool in Qt, with a long history and a good reputation. Compared to Makefile, it is very easy to get started, allowing developers … Read more

Building C++ Projects: Creating Libraries with CMake

Building C++ Projects: Creating Libraries with CMake

This time, let’s take a look at how to create dynamic and static libraries using CMake. The technical details differ significantly between creating and using dynamic and static libraries, but for CMake, you only need to specify whether you need a static or dynamic library. This article contains a fair amount of code, mostly framework … Read more

Using Google Test Library for Unit Testing with CMake

Using Google Test Library for Unit Testing with CMake

Introduction: In this article, we will learn how to implement unit testing using the CMake build system with the Google Test framework. Compared to the previous configuration with Catch2, the Google Test framework is not just a header file; it is a library that includes two files that need to be built and linked. We … Read more

How Qt CMake Can Help Me Continue Using You

How Qt CMake Can Help Me Continue Using You

Recently, while developing ARM applications, I used Qt version 6.2 to cross-compile the source code. The compilation went smoothly and quickly. However, when I was about to compile the program I had written using the Qt library, I found that it could not be compiled with QMake due to a missing connection in Qml. After … Read more

Redefining AutoCAD Plugin Development with CMake and Unit Testing

Redefining AutoCAD Plugin Development with CMake and Unit Testing

The traditional development of AutoCAD plugins (.arx) often gets mired in the “project configuration hell” of Visual Studio: from complex SDK integration to version dependencies and manual debugging, a small change can lead to the collapse of the entire project. In the face of today’s strong demand for automation, testability, and portability, this model is … Read more