There are a few housekeeping tasks to do before you get started developing your plugin.
A python script, project_setup.py
, is provided which automates the steps in the section below (requires Python 3.12+)*. To run the script:
- Run
cd .\CLibSFPluginTemplate\
- Run
py .\project_setup.py
- Enter your project name (in CamelCase)
*NOTE: If you're using Python 3.11 or below, change onexc=onexc
to onerror=onexc
in lines 31 and 33 in project_setup.py
- Clone the repository
- Set the
"name"
and"version-semver"
fields invcpkg.json
- Update the
"baseline"
entries to the latest commits in both registries invcpkg.json
- Follow the links in the
"repository"
fields and copy-paste the hash of the latest commit in each repository
- Follow the links in the
- Set the name and version of your plugin in
CMakeLists.txt
- Change
"AuthorName"
inCMakeLists.txt
to your name - Set the name of
contrib/Config/PluginName.ini
to the name of your plugin - Edit the
ini.LoadFile()
call insrc/Settings.cpp
to load the renamed ini from step 6
- Visual Studio should prompt you to generate a CMake cache. Click on
Generate
and wait - One the CMake cache is generated, build your project
- The
.dll
and.pdb
files will be placed incontrib\PluginRelease
orcontrib\PluginDebug
depending 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
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
).
- CMake v3.27+
- vcpkg v2023.08.09+
- Create a new Windows environment variable called
VCPKG_ROOT
which points to your vcpkg install directory
- Create a new Windows environment variable called
- Visual Studio 2022 with C++ workload
- LLVM v17.0.0+ (not really a dependency but nice to have)