Modern C++ Toolset Workshop
This repository contains hands-on exercises for learning modern C++ development tools including CMake and Conan.
This workshop covers:
- CMake fundamentals and best practices
- Conan dependency management
- Modern C++ project structure
- Testing with Google Test
The preferred way to run this workshop is to use GitHub Codespaces by clicking the button below:
When creating a codespace, select:
- Branch:
task_1 - Machine type: 2-core (recommended minimum)
-
Via GitHub Web Interface:
- Navigate to the repository → "Code" → "Codespaces" → "Create codespace on master"
-
Via VS Code Extension:
- Install the GitHub Codespaces extension
- Create codespace directly from VS Code
-
Local Development:
- Use the pre-configured devcontainer and Docker image manually in your IDE
- Requires Docker and VS Code with Remote-Containers extension
- Benefits
- Full offline development (after initial setup)
- Better performance on powerful local machines
- Direct file system access for easier integration with local tools
- No usage limits unlike GitHub Codespaces
The workspace comes pre-configured with:
- Modern C++ compilers (GCC, Clang)
- CMake build system
- Code formatting tools (clang-format)
- Initial code for our exercises
- Important: Do not select any 3rd party
CMakeLists.txtfiles. We will create our own during the first exercise of our workshop! - In VS Code, select a CMake Kit for the latest compiler of your choice:
- Open Command Palette (
Ctrl+Shift+P) - Run "CMake: Select a Kit"
- Choose your preferred compiler (e.g., GCC, Clang)
- Open Command Palette (
During the workshop, you'll collaborate with other participants by sharing your IDE workspace.
- Click the "Live Share" button in the VS Code status bar (bottom of the window)
- VS Code will generate an invitation link
- Share this link with your team members
- Participants can join and see your code in real-time
- Real-time collaborative editing
- Shared terminal sessions
- Voice/text chat integration
- Shared debugging sessions
Important: Understanding where to store your files is crucial for data persistence across devcontainer sessions.
Your codespace has two main persistent directories:
-
Repository Directory:
/workspaces/workshop-tools- This is the current repository location
- All files here are automatically saved and versioned with git
- Perfect for code changes and build artifacts
-
Persistent Directory:
/workspaces/persistent- Available via environment variable:
$PERSISTENT_DIR - Use for files that need to persist but aren't part of the repository
- Examples: dependencies, pip packages, conan configuration, temporary files, additional tools
- Available via environment variable:
Important: Remember to stop your codespace when not in use to conserve your free GitHub Codespaces hours.
Method 1 - Command Palette:
- Press
Ctrl+Shift+P(orCmd+Shift+Pon Mac) - Type "Codespaces: Stop Current Codespace"
- Press Enter
Method 2 - Status Bar:
- Click the remote indicator in the bottom-left corner of VS Code
- Select "Stop Current Codespace" from the menu
Method 3 - GitHub Web Interface:
Option A - From Repository:
- Go to your repository page: github.com/train-it-eu/workshop-tools
- Click the "Code" button (green button)
- Switch to the "Codespaces" tab
- Find your active codespace and click the three dots (⋯) menu
- Select "Stop codespace" from the dropdown menu
Option B - From Codespaces Dashboard:
- Navigate to github.com/codespaces
- Find your active codespace in the list
- Click the three dots (⋯) menu next to your codespace
- Select "Stop codespace" from the dropdown menu
- Confirm the action when prompted
- Codespaces automatically suspend after 30 minutes of inactivity (default)
- You can resume a stopped codespace anytime from GitHub
- Your work is automatically saved and persisted
- Free tier includes 120 core hours per month (e.g., 60 hours for 2-core machine)
If you encounter issues:
- Try refreshing the codespace browser tab
- Restart the codespace from the GitHub Codespaces dashboard
- Check that you're using the correct branch (
task_1) - Ensure your codespace has sufficient resources (2-core minimum)