Mastering CMake from Beginner to Advanced (3): Functions and Parameter Passing

Mastering CMake from Beginner to Advanced (3): Functions and Parameter Passing

In-depth analysis<span>function()</span> and <span>macro()</span> differences, mastering variable arguments and cross-platform compilation practical applications. 1. <span><span>function()</span></span> and <span><span>macro()</span></span> essential differences 1.1 Scope and Variable Passing <span>function()</span>: Local Scope: Variables (including parameters) defined inside the function are only valid within the function and are not visible externally. Parameter Passing: Passed by value, modifications to parameters within the … Read more

Practical Preparation for Gin – A Step-by-Step Guide to Mastering Makefile

Practical Preparation for Gin - A Step-by-Step Guide to Mastering Makefile

In Go language development, Makefile is known as the Swiss Army knife of automated builds. It not only simplifies cumbersome compilation commands but also standardizes team collaboration norms. This article unlocks the five core application scenarios of Makefile in Go development through practical code examples. 1. Basic Build Essentials # Define basic project information BINARY_NAME … Read more

Efficient C++ Practices: A Library Everyone Should Pay Attention To

Efficient C++ Practices: A Library Everyone Should Pay Attention To

Hello everyone, I am Hai Di! In C++ development, string formatting is a frequent and easily overlooked requirement. Traditional methods such as <span>sprintf</span> pose risks of buffer overflow, while <span>iostream</span> has poor performance and cumbersome syntax. The fmt library, with its three main features of type safety, zero-cost abstraction, and minimal syntax, has become the … Read more

Introduction to CMake: Essential for Building Modern C++ Projects

Introduction to CMake: Essential for Building Modern C++ Projects

Introduction to CMake: Essential for Building Modern C++ Projects Hello everyone! As a C++ programmer, I understand the importance of build tools. Today, I want to share with you CMake – a powerful cross-platform build tool. Don’t be intimidated by the term “build tool”; follow me step by step, and you’ll find that CMake is … Read more

CMake vs qmake: Which One Should You Choose?

CMake vs qmake: Which One Should You Choose?

CMake vs qmake: Which One Should You Choose? 🔥 Today, let’s discuss CMake and qmake, two tools used for managing project builds, but they have significant differences! 💡 Design Philosophy • CMake: It is a cross-platform build system generator that supports various compilers and build tools, such as Make, Ninja, Visual Studio, etc. It handles … Read more

CMake Tutorial

CMake Tutorial

1. Introduction to CMake CMake is a cross-platform build tool, which can generate: Makefile for Linux/Unix Project files for <span>Visual Studio</span> on Windows Project files for <span>Xcode</span> on macOS without manually writing build scripts for different platforms. 2. Installing CMake Windows: Download the installer from cmake.org/download Linux: <span>sudo apt install cmake</span> (Debian/Ubuntu) macOS: <span>brew install … Read more

Why Python is Recommended as the First Programming Language on Linux Instead of Bash?

Why Python is Recommended as the First Programming Language on Linux Instead of Bash?

In China, there is a saying – “Since you are here, you might as well enjoy it!”Seeing beautiful scenery on TV, with green mountains and clear waters, and cascading waterfalls, one might impulsively drive to the destination. Upon arrival, they realize that it was the camera that was beautiful, not the scenery. But since they … Read more

Quick Start Guide to CMake

Quick Start Guide to CMake

Link: https://www.hahack.com/codes/cmake/ Recommended: Hello Series | CMake Brief Basics What is CMake You may have heard of several Make tools, such as GNU Make, QT’s qmake, Microsoft’s MS nmake, BSD Make (pmake), Makepp, etc. These Make tools follow different specifications and standards, and the Makefile formats they execute vary widely. This brings a serious problem: … Read more

Essential Guide to Managing C++ Projects with CMake

Essential Guide to Managing C++ Projects with CMake

1. Background CMake is a product derived from the development of several toolkits (VTK) by Kitware and some open-source developers, ultimately forming a system and becoming an independent open-source project. Its official website is cmake.org, where you can find more information about CMake. It is a cross-platform build tool that can describe the build process … Read more

Design Concepts and Usage of Modern CMake Tools

Design Concepts and Usage of Modern CMake Tools

Link: https://ukabuer.me/blog/more-modern-cmake/ For C/C++ developers, managing projects often becomes quite tricky when it comes to complex third-party dependencies, especially when cross-platform development is required. CMake, as a cross-platform build process management tool, provides mature solutions for finding and introducing third-party dependencies, creating build systems, testing programs, and installation. By writing a CMakeLists.txt file once and … Read more