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

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