deargui-vpl/docs/cmake-options.md

2.5 KiB

CMake Configuration Options

Console Variant Options

BUILD_CONSOLE_VARIANTS

Default: ON

Controls whether console variants of applications are built on Windows.

# Build both GUI and console variants (default)
cmake -S examples -B build

# Build only GUI variants
cmake -S examples -B build -DBUILD_CONSOLE_VARIANTS=OFF

Effect:

  • ON: Creates both blueprints-example and blueprints-example-console targets
  • OFF: Creates only blueprints-example (GUI variant)

USE_CONSOLE_AS_STARTUP

Default: ON

Sets which variant is the default Visual Studio startup project (only applies when BUILD_CONSOLE_VARIANTS=ON).

# Console variant as startup (default)
cmake -S examples -B build -DUSE_CONSOLE_AS_STARTUP=ON

# GUI variant as startup
cmake -S examples -B build -DUSE_CONSOLE_AS_STARTUP=OFF

Effect:

  • ON: Press F5 in Visual Studio → debugs console variant
  • OFF: Press F5 in Visual Studio → debugs GUI variant

Quick Examples

For Development (Console Debugging)

# Default configuration - optimal for development
cmake -S examples -B build -G "Visual Studio 17 2022" -A x64

# Both variants built, console is default startup
# Open build\imgui-node-editor.sln and press F5 to debug

For Production Build

# Build only GUI variants
cmake -S examples -B build -G "Visual Studio 17 2022" -A x64 \
  -DBUILD_CONSOLE_VARIANTS=OFF

# Only blueprints-example target is created

Build Console Variant Only

# Configure with both variants
cmake -S examples -B build -G "Visual Studio 17 2022" -A x64

# Build only console variant
cmake --build build --config Debug --target blueprints-example-console

# Or use script
./scripts/build.sh Debug console

Prefer GUI for Debugging

# Build both, but GUI is startup project
cmake -S examples -B build -G "Visual Studio 17 2022" -A x64 \
  -DUSE_CONSOLE_AS_STARTUP=OFF

# Open build\imgui-node-editor.sln
# Press F5 → debugs GUI variant

All Options Summary

Option Default Description Platform
BUILD_CONSOLE_VARIANTS ON Build console variants in addition to GUI Windows only
USE_CONSOLE_AS_STARTUP ON Set console variant as VS startup project Windows only

See Also