Skip to main content
The PrismaEngine SDK exposes two CMake helper functions — prisma_create_app() and prisma_create_editor_extension() — that abstract away the boilerplate required to build a game executable or an editor plugin. Both functions are defined in cmake/PrismaEngineConfig.cmake.in and become available after a successful find_package(PrismaEngine REQUIRED) call.

Setup: finding the package

Before using either function, locate the installed SDK with find_package:
Point CMake at the SDK by passing PrismaEngine_DIR at configure time:
find_package sets the following variables used internally by the helper functions:

prisma_create_app()

Creates a C++20 executable target linked against PrismaEngine::Engine. It handles include directories, C++ standard enforcement, optional extra libraries, output folder configuration, and — on Windows — automatically copies the engine DLL next to the built executable.

Signature

Parameters

string
required
Name of the CMake executable target to create. This becomes the binary name (MyGame, MyGame.exe).
string
Sets RUNTIME_OUTPUT_DIRECTORY on the target. The compiled executable is placed in this directory. If omitted, CMake’s default output directory is used.
string[]
List of source files added to the target via target_sources(... PRIVATE ...). If omitted, you must add sources yourself with a separate target_sources() call.
string[]
Additional libraries linked privately against the target. The engine itself (Engine / PrismaEngine::Engine) is always linked automatically — only list extra dependencies here.

What it does internally

Examples

Minimal game project:
Game with multiple sources and an extra physics library:
Using the SDK to build the BasicTriangle sample:

prisma_create_editor_extension()

Creates a shared library target linked against the Editor target. Editor extensions are loaded by the Prisma editor at startup and can add panels, tools, asset importers, and scene components to the editor UI.

Signature

Parameters

string
required
Name of the CMake shared library target. The output is a .dll (Windows) or .so (Linux) that the editor discovers and loads at runtime.
string[]
Source files compiled into the extension. The extension must export its entry point using the EDITOR_EXTENSION_EXPORTS=1 macro, which the function defines automatically.

What it does internally

Example

Editor extensions require PRISMA_BUILD_EDITOR=ON in the engine build that produced the SDK. The Editor link target will be absent from SDK builds produced without the editor.

Complete working example

The following CMakeLists.txt builds a game executable and an optional editor extension from a single project:
A matching src/main.cpp:
Configure and build:

System requirements

If you see a linker error about missing Engine or Editor targets after find_package, verify that the PrismaEngine_DIR path points to a directory containing PrismaEngineConfig.cmake — not the SDK root itself.