[TOC] Installing CMakeQuick list (more info on each method below) Official package CMake Default VersionsWindowsMacOSLinuxRHEL/CentOSUbuntuOtherGeneral toolsCIFull list Pip Inst...
[TOC] Running CMakeBuilding a project From the build directory (pick one) From the source directory (pick one)Picking a compilerPicking a generatorSetting optionsVerbose and parti...
[TOC] Do’s and Don’tsCMake AntipatternsCMake Patterns Do’s and Don’ts CMake Antipatterns The next two lists are heavily based on the excellent gist Effective Modern CMake. That...
[TOC] FetchContent (CMake 3.11+) FetchContent (CMake 3.11+) Often, you would like to do your download of data or packages as part of the configure instead of the build. This was...
[TOC] TestingGeneral Testing InformationBuilding as part of a testTesting Frameworks Testing General Testing Information In your main CMakeLists.txt you need to add the followi...
[TOC] GoogleTestSubmodule method (preferred)Download methodFetchContent: CMake 3.11 GoogleTest Submodule method (preferred) To use this method, just checkout GoogleTest as a su...
[TOC] CatchVendoringDirect inclusion Catch Catch and Catch2 (C++11 only version) are powerful, idomatic testing solutions similar in philosophy to PyTest for Python. To use Catc...
[TOC] Exporting and InstallingFind module (the bad way)Add SubprojectExporting Exporting and Installing There are three good ways and one bad way to allow others use your librar...
[TOC] Variables and the CacheLocal VariablesCache VariablesEnvironment variablesThe CacheProperties Variables and the Cache Local Variables We will cover variables first. A loc...
[TOC] Programming in CMakeControl flow«cmake:generator-expressions»Macros and FunctionsArguments Programming in CMake Control flow CMake has an «command:if» statement, though o...