Common Syntax in CMake (Functions)

Common Syntax in CMake (Functions)

Previous exciting content:CMake Hello, WorldCMake VariablesCMake Official Tutorial (Basic Project Setup)CMake Official Tutorial (Creating Libraries)CMake Official Tutorial (Usage Requirements)CMake Official Tutorial (Installation and Testing)CMake Common Syntax (if Statements)CMake Common Syntax (Cache Variables)CMake Common Syntax (Environment Variables)CMake Common Syntax (Mathematical Calculations)CMake Common Syntax (Strings)CMake Common Syntax (Lists)CMake Common Syntax (Loops)CMake Common Syntax (Macros) Functions in CMake … Read more

Using CMake to Reference Your Own Developed Third-Party Library

Using CMake to Reference Your Own Developed Third-Party Library

Summary Developing your own library in C++ is quite convenient, but making it usable for others can be a bit challenging. It requires understanding the CMake toolset. This article may seem simple, but I spent three days working on this issue. Perhaps I am a bit slow, and with limited learning ability, I will strengthen … Read more

Introduction to CMake Basics

Introduction to CMake Basics

Introduction to CMake 1. Overview of CMake CMake is a project build tool that is cross-platform. Other popular project build tools include Makefile (which builds projects using the Make command). Most IDEs integrate make, such as: nmake for VS, GNU make for Linux, and qmake for Qt. If you write a makefile by hand, you … Read more

AFSim Development Training: Building Projects with CMake

AFSim Development Training: Building Projects with CMake

^_^ AFSim Development Training: This is the last article translated from the core development training documentation in the official source code training directory. A complete list of all documents can be found in: AFSIM Development Training. There may be intermittent updates to a simplified translation of the official AFSim software usage documentation in the future. … Read more

Using CMake for Project Development

Using CMake for Project Development

Installing CMake Tool yum install cmake Installing yaml-cpp Unzipping yaml-cpp [root@vbox ~]# unzip yaml-cpp-master.zip Entering the Source Directory [root@vbox ~]# cd yaml-cpp-master/ Creating Build Directory [root@vbox yaml-cpp-master]# mkdir build && cd build Generating Build Files [root@vbox build]# ls CMakeCache.txt cmake_install.cmake CTestTestfile.cmake Makefile util yaml-cpp-config-version.cmake CMakeFiles cmake_uninstall.cmake DartConfiguration.tcl Testing yaml-cpp-config.cmake yaml-cpp.pc CMake Installation (Generating Shared Library) … Read more

Package Management Module FetchContent in CMake

Package Management Module FetchContent in CMake

Background Introduction In the realm of C++ package management tools, aside from Microsoft’s vcpkg, there doesn’t seem to be a particularly famous package manager. CMake actually provides basic package management functionality. By using the <span>FetchContent</span> module commands, you can download the source code or other files that your project depends on. Basic Usage <span>FetchContent_Declare</span> command … Read more

Setting the Default Startup Project in CMake for Visual Studio: No Longer ALL_BUILD

Setting the Default Startup Project in CMake for Visual Studio: No Longer ALL_BUILD

The default startup project generated by <span>cmake</span> is <span>ALL_BUILD</span>. We want to specify the default startup project so that we don’t have to set it every time we open the <span>.sln</span> file. This was not possible before <span>cmake 3.6</span>. After <span>cmake 3.6</span>, it can be accomplished by setting the <span>VS_STARTUP_PROJECT</span> property. 1. Core Setting Statement … Read more

CMake Command Quick Reference: Comprehensive Overview of Common Commands

CMake Command Quick Reference: Comprehensive Overview of Common Commands

Click the blue text to follow the author 1. Introduction CMake is a cross-platform open-source build system generator. It does not directly build software but generates a build system for a specific platform based on the descriptions in the <span>CMakeLists.txt</span> file. The role of CMake is to decouple the build process from the compiler, operating … Read more

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