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

Building a Cross-Platform Application Framework with CMake: C Language Version

Building a Cross-Platform Application Framework with CMake: C Language Version

1. Introduction 2. Example Code Explanation 3. Steps for Linux System 4. Steps for Windows System 5. Conclusion 1. Introduction During the process of writing applications, we often face a development scenario: writing cross-platform applications. This requirement is relatively easy to handle for Linux-based platforms; in most cases, you only need to switch to a … Read more

CMake Learning Guide

CMake Learning Guide

CMake Tutorial Guide Author: Qiang Ge 2020-05-06 22:17:25 Table of Contents Manual Documentation Offline Compilation Online Installation Online Tutorials Community Wiki G4 (ROOT) Related Videos Books Presentation Slides Code Exercises or Demos Summary Using CMake as a cross-platform project management tool for resource configuration management in G4, which is based on C++, is a very … Read more