The build system has been modernized to use standard CMake commands with automatic vcpkg detection.
# Old scripts with hardcoded paths
cpp-build.cmd
config_debug_build.cmd# Standard CMake commands
cmake --preset debug
cmake --build --preset debug
# Or convenience scripts
build-debug.cmd
build-release.cmd- Automatic vcpkg Detection: No need to hardcode vcpkg paths in CMakePresets.json
- Standard CMake: Works with any IDE or build tool that supports CMake
- Cross-Platform: Same commands work on Windows, Linux, and macOS
- Flexible: Easy to customize build options
Windows:
setx VCPKG_ROOT "E:\vcpkg"Then restart your terminal.
Linux/macOS:
Add to ~/.bashrc or ~/.zshrc:
export VCPKG_ROOT=/path/to/vcpkg# Windows
clean.cmd
# Or manually
rmdir /S /Q build-debug
rmdir /S /Q build-release
rmdir /S /Q bin# Using presets (recommended)
cmake --preset debug
cmake --build --preset debug
# Or using convenience script
build-debug.cmdThe old build scripts still exist but are deprecated:
cpp-build.cmd- Usebuild-debug.cmdinsteadconfig_debug_build.cmd- Usecmake --preset debuginsteadconfig_release_build.cmd- Usecmake --preset releaseinstead
All existing CMake options are still supported:
BUILD_QT_EXAMPLES(default: ON)BUILD_VTK_EXAMPLES(default: OFF)BUILD_EIGEN_EXAMPLES(default: ON)BUILD_MIXED_LANG_EXAMPLES(default: OFF)
Executables still go to bin/ directory as before.
Solution 1: Set VCPKG_ROOT environment variable (recommended)
setx VCPKG_ROOT "E:\vcpkg"Solution 2: Manually specify toolchain file
cmake -B build-debug -DCMAKE_TOOLCHAIN_FILE=E:/vcpkg/scripts/buildsystems/vcpkg.cmakeUpgrade to CMake 3.20 or higher:
- Download from: https://cmake.org/download/
- Or use:
winget install Kitware.CMake
The presets use Ninja by default for faster builds. Install it:
winget install Ninja-build.NinjaOr use Visual Studio generator instead:
cmake --preset vs2022- Install CMake Tools extension
- Select a preset from the status bar
- Click Build
- Open folder in Visual Studio
- Select preset from Configuration dropdown
- Build as normal
- CLion auto-detects CMake presets
- Select preset from configuration dropdown
- Build as normal
- ✅ Works with standard CMake commands
- ✅ Better IDE integration
- ✅ No hardcoded paths
- ✅ Cross-platform consistency
- ✅ Easier for new users
- ✅ Industry-standard approach