
Note: VSCode setup and useful plugins to install are explained in the Lecture as and when required!
WSL Installation Live Demo: Experience the seamless integration of Windows Subsystem for Linux (WSL) with a live installation demo. Learn how to run the same code written on macOS effortlessly on Linux (WSL), demonstrating the true cross-platform capabilities of CMake."
Download the attached PDF for quick VS Code setup instructions.
Download the attached PDF for quick Git setup instructions.
Explore a high-level multi-module cmake plan to generate executables, static and dynamic libraries, and interface libraries across Windows, macOS, and Linux, with demos and on-demand tool installations.
How to download/clone our source code
CMake Guide-Follow previous lecture: `CMake Installation-uninstallation`
VSCode & VS2022 Installation in Windows.
Download source code from Git. Use tags in Git.
Build the project in Windows with CMake Ver 3.25. Understand why CMAKE_MINIMUM_VERSION_REQUIRED()
Installation of g++, CMake using `apt get`.
Installation on the fly and demo the executable generation on Linux(WSL-Ubuntu 24.04)
Getting the CMake version 3.28. We will update the version to 3.30 later in this course. I'll demo how to.
What is planned for next with the timeline!
Uninstall CMake 3.25 and Install 3.30 in Windows
Demonostrate the same code using CMake 3.30.
Uninstall previously installed CMake V3.28 & Install 3.30
Run the CMake & test our existing code
Understand why we use cmake_minimum_required(VERSION)
Building multiple sources to a single executable. Use regular expressions kind of trick to detect all source and header files to build.
Master library generation and use CMake by organizing headers in include and sources in source directory, applying header guards or pragma once, and configuring include paths to avoid missing files.
Theory: How to generate a Dynamic Library or Shared Object.
- Why the flag is in uppercase?
- Dynamic Lib Demo on MAC
- DLL linking issue in win
- Need of Import Library
- Generation of Import Library using cmd line.
- Successful build and link of DLL in Windows OS.
Remove .lib=>No effect on executable
Remove .dll=>Afects executable
Introducing set() command
Use set() to set the CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS to generate the import library.
Learn how interface library in CMake defines usage requirements for dependents without compiling or producing artifacts, guiding include directories, compile definitions, and link libraries for module five.
What is planned for the next release with timeline
PUBLIC, PRIVATE, INTERFACE-Concepts
You answer this exercise, then watch the video.
Moving the header to a different location
Don't modify the `#include`, make changes in CMake.
Creation of library libB
Source Code to experiment.
Understand the components' relationship and decide the CMakeList accordingly
Implementation of libC.
Decision on the target scope to use.
Implement Usecase-2
Revisit Root CMake and make it more readable
Understand how CMake helps in managing dependencies.
Understand What happens when we use target_link_libraries() and target_include_derectories()
Build succeeded, but the executable won’t work. To make it work, copy the DLL to the location of the exe.
Automate the creation of DLL and exe in the same directory.
Demo-Fix TestDynamicLib.exe Runtime Error in Windows.
Demo the project#1 code on a cross-platform.
Use Case of Writing User-Defined Functions.
Unlock the power of CMake with this comprehensive course designed for working professionals and engineering students. Begin with installing required tools on macOS, Windows, and Linux. Learn to build executables and libraries and grasp intermediate techniques in CMake. As you progress, expect regular updates introducing advanced topics like generator expressions, linking external libraries, writing Functions and macros, optimising CMake files, using CTest, CPack, VCPkg manager, Ninja generator, custom commands, and auto-generating config.cmake, writing own FindModule, dynamic library linking issues in Windows, automating build process for different pipelines and more. Gain practical knowledge through hands-on projects, including porting your existing Visual Studio legacy projects to modern CMake builds. Elevate your CMake expertise with us. Your journey to mastering CMake starts here! With each phase, you'll gain deeper insights and more control over your build environment, ensuring you can confidently handle any project. Join us and transform your CMake skills from foundational to advanced. Whether you're looking to enhance your career or excel in your studies, this course will provide you with the skills and knowledge you need to succeed. Get ready to take your CMake proficiency to the next level with step-by-step guidance, real-world applications, and expert instruction designed to make you a CMake master."