2.0 Help

Use as a Submodule

When using git and CMake for a project, Plasma Engine can be integrated as a submodule into the git repository and referenced from CMake.

First PlasmaEngine needs to be added as a submodule to git:

git submodule add https://github.com/PlasmaEngine/PlasmaEngine.git

Additionally, if you want to use the precompiled tools and the sample content from Plasma, you also need to pull in its submodules as well:

cd PlasmaEngine git submodule init git submodule update

Next, add the Plasma Engine folder in your root CMakeLists.txt:

# Set the build filter, if you only want to integrate parts of Plasma into your build. # set(PL_BUILD_FILTER "FoundationOnly") add_subdirectory(PlasmaEngine)

The Plasma Engine language detection can be reused by including the Plasma Engine submodule utility file:

# include the Plasma submodule utility CMake functions include("PlasmaEngine/Code/BuildSystem/CMake/plUtilsSubmodule.cmake") pl_detect_languages() project("MyProject" LANGUAGES ${PL_LANGUAGES})

Strip Unnecessary Code

When integrating Plasma this way, you may only want a subset of the available functionality. For instance, you may only need the plFoundation base library (and 3rd party dependencies). You can achieve this by configuring the build filter

SDK Root Folder

When integrating Plasma as a submodule, it is common for the binaries to be located outside of the Plasma Engine sub-folder, which means the engine won't be able to find the SDK root folder anymore. See this article for ways to fix this.

See Also

Last modified: 03 July 2024