- CMake v3.27+
- Visual Studio 2022 with C++ workload
- Python
- LLVM v17.0.0+
This template uses CommonLibSF's GPLv3 with exceptions. Per the license, you must share the source code of your mod if you use CommonLibSF. Violation of the license will result in your mod being taken down from the Nexus.
This template consumes CommonLibSF as a CPM package, a git submodule, or a local fork. When you run the project setup script, you will be prompted to choose between the three (the default is as a CPM package).
A python script, project_setup.py, is provided which automates several housekeeping steps required to get the template development-ready (requires Python). To run the script:
- Run
cd .\CLibSFPluginTemplate\ - Run
py .\project_setup.py - Choose how to consume CommonLibSF
- Press
Enterto use the default of consuming CommonLibSF via CPM - Enter
yto consume CommonLibSF as a git submodule instead
- Press
- To use a local fork of CommonLibSF instead of the vcpkg port or a git submodule:
- Create a Windows environment variable called
CommonLibSFPaththat points to your local fork of CommonLibSF - Enter
ywhen the setup script asks if you'd like to use a local fork
- Create a Windows environment variable called
- Enter your project name (in CamelCase)
- Visual Studio should prompt you to generate a CMake cache. Click on
Generateand wait - One the CMake cache is generated, build your project
- The
.dlland.pdbfiles will be placed incontrib\PluginReleaseorcontrib\PluginDebugdepending on your build configuration
- Two build configs are provided:
Release: Optimized release build, produces small and fast DLLs with associated PDBsDebug: Debug build, produces DLLs and PDBs with full debug info, allowing the use of an interactive debugger
Variants of both of the above configs are provided which use MSVC (cl/link) and Clang (clang-cl/lld-link) respectively.
Many CommonLib plugins expose settings through configuration files so that the user can control plugin behavior. This template includes simpleini which allows you to read settings from the ini file in contrib\config (see Settings.cpp).