Back To Course Home
Modern CMake for C++
0% completed
Introduction to the Course
Getting Started
First Steps with CMake
IntroductionUnderstanding the BasicsCMake ToolsCMake Command: Generating a Project Build SystemCMake Command: Building a ProjectCMake Command: Other OperationsOther CMake ToolsNavigate the Project Files: Directory Structure and Cache VariableNavigate the Project Files: Configuration Files and PresetsDiscovering Scripts and ModulesChapter Wrap-up
The CMake Language
IntroductionCMake Language SyntaxWorking With VariablesVariable Scope and ListsConditional BlocksComparison Operators and Simple ChecksLoopsCommand Definitions: MacrosCommand Definitions: FunctionsNaming ConventionsUseful CommandsChapter Wrap-up
Setting Up Our First CMake Project
IntroductionBasic Directives and CommandsProject PartitioningScoped SubdirectoriesThinking About the Project StructureScoping the EnvironmentConfiguring the ToolchainInterprocedural OptimizationDisabling in-source buildsChapter Wrap-up
Working with Targets
IntroductionThe Concept of a TargetTarget PropertiesPseudo TargetsWriting Custom CommandsUnderstanding Generator ExpressionsTypes of EvaluationExamples to Try OutChapter Wrap-up
Compiling C++ Sources with CMake
IntroductionThe Basics of CompilationPreprocessor Configuration: DefinitionPreprocessor Configuration: HeaderOptimizer Configuration: General LevelOptimizer Configuration: Function and Loop LevelManaging the Process of CompilationFinding MistakesChapter Wrap-up
Linking with CMake
IntroductionGetting the Basics of Linking RightBuilding Different Library TypesSolving Problems With the One Definition RuleDuplicated Namespaces and Dynamically Linked SymbolsThe Order of Linking and Unresolved SymbolsSeparating main() for TestingChapter Wrap-up

Course Assessment

Modern CMake for C++ Exam 1
Managing Dependencies with CMake
IntroductionHow to Find Installed Packages IHow to Find Installed Packages IIDiscovering Legacy Packages With FindPkgConfigWriting Our Own Find-ModulesWorking With Git Repositories: SubmodulesGit-Cloning Dependencies for Projects That Don't Use GitUsing ExternalProject ModulesUsing FetchContent ModulesChapter Wrap-up
Testing Frameworks
IntroductionWhy Are Automated Tests Worth the Trouble?Using CTest to Standardize Testing in CMakeCreating the Most Basic Unit Test for CTestStructuring Our Projects for TestingUnit-Testing Frameworks: Catch2Unit-Testing Frameworks: GTestUnit-Testing Frameworks: GMockGenerating Test Coverage ReportsChapter Wrap-up
Program Analysis Tools
IntroductionEnforcing the FormattingUsing Static CheckersIntroduction to CheckersDynamic Analysis With Valgrind: MemcheckDynamic Analysis With Valgrind: Memcheck-CoverChapter Wrap-up
Generating Documentation
IntroductionAdding Doxygen to Our ProjectGenerating Documentation With a Modern LookChapter Wrap-up
Installing and Packaging
IntroductionExporting Without InstallationInstalling Projects on the SystemInstalling Logical TargetsLow-Level InstallationWorking With Whole DirectoriesInvoking Scripts During InstallationCreating Reusable PackagesCreating and Managing Config-FilesGenerating Package Version FilesDefining ComponentsPackaging With CPackChapter Wrap-up
Creating Our Professional Project
Introduction
Planning Our Work
Project Layout
Building and Managing Dependencies
Testing and Program Analysis
Installing and Packaging
Providing the Documentation
Challenge: Creating Our Professional Project
Solution: Creating Our Professional Project
Conclusion
Course Wrap-up
Appendix
Installing CMakeMiscellaneous CommandsThe string() CommandThe list() CommandThe file() CommandThe math() Command

Solution: Creating Our Professional Project

Let's see the implementation of your professional project.

We'll cover the following
  • Task 1 Solution: Specify basic project details and add the src and test directories
  • Task 2 Solution: Add code for enabling test utility usage by two target groups
  • Task 3 Solution: Include code that contains all necessary operations to be performed on this target
  • Task 4 Solution: Add the configuration for generating Doxygen HTML documentation
  • Task 5 Solution: Add the Valgrind Memcheck configuration to generate the report
  • Project

Task 1 Solution: Specify basic project details and add the src and test directories

Get hands-on with 1400+ tech skills courses.