A Plugin Template for CommonLibSSE-NG to build for Skyrim versions SE, AE, VR, and GOG. Included libraries:
Plugin | README |
---|---|
CommonLibSSE-NG | https://github.com/CharmedBaryon/CommonLibSSE-NG/ |
SimpleINI | Read/Write ini configurations. |
spdlog | Used for logging to log file. |
RapidCSV | Used by CommonLibSSE for unit tests |
Catch2 | A unit testing framework for C++ |
I set out to create this template for two reasons:
- Offer another updated solution for would-be SKSE plugin developers to utilize and learn plugin development.
- Offer a more packaged template with some common tools such as catch2, simpleini, and spdlog.
This work absolutely could not be done without these authors and their original works and derivatives:
- Monitor144hz - For their various NG repositories.
- Skyrim Scripting - For their Youtube series, and templates.
- Colorglass Studio - For their sample plugin and vcpkg repository.
- Parapets - For inspiring me to use git submodules instead of vcpkg.
- CharmedByron - For the NG fork of CommonLibSSE, and documentation.
- Everyone who uploads open-source SKSE projects on Github
I plan on maintaining this repository as I continue plugin development, adding and removing features as I deem necessary. Feel free to join the Modding Guild community where you can find and message me directly.
- Visual Studio Code + Visual Studio Build Tools or Visual Studio Community 2022
- Git or Github Desktop
- Ninja (if using Visual Studio Build Tools)
- Vcpkg
Want a full guide? Checkout my Full Installation Guide here.
- Setup
VCPKG_ROOT
system envrionment variable to point towards"C:/path/to/vcpkg"
- (optional) Setup
SKYRIM_MODS_FOLDER
system environment variable to point twards"C:/path/to/Mod Organizer 2/mods/folder
"Not doing this will result in the DLL exporting to
"${CMAKE_SOURCE_DIR}/build"
instead. - (optional) If using Visual Studio Code, Add
"C:/path/to/ninja/ninja.exe"
to your envrionment PATH. - Using Visual Studio Code open the project folder with VSCode.
- If prompted, install both C/C++ & CMake tools provided by Visual Studio Code.
- Select a configure preset
- Debug (MSVC) - Standard CXX debug compile parameters without Catch2 unit tests.
- Debug with Catch2 (MSVC) - Same as above, but with additional Catch2 unit test libraries.
- Release (MSVC) - Release version for distribution.
- Click
Build
and allow it time to compile.
By default, the build settings will output the .dll into "/build/SKSE/Plugins/"
unless you setup your SKYRIM_MODS_FOLDER
as detailed above.
While you're inside the CMakeLists.txt
file, you can change your plugin name at the top of the file.
project(
TemplatePlugin <- Specifiy your PluginName
VERSION 0.0.1 <- Specify your .dll version
LANGUAGES CXX <- Do not touch
)
Just below that, you can configure optional Build settings.
set(BUILD_TESTS OFF) <- OFF/ON enables CommonLibSSE-NG specific Catch2 unit tests (default OFF).
set(BUILD_TESTS_PROJECT OFF) <- OFF/ON enables Project specific Catch2 unit tests (default OFF).
Further down, you can modify your .dll output directory.
set(OUTPUT_FOLDER "${CMAKE_SOURCE_DIR}/build") <- Used if `SKYRIM_MODS_FOLDER` is not set.
if(DEFINED ENV{SKYRIM_MODS_FOLDER} AND IS_DIRECTORY "$ENV{SKYRIM_MODS_FOLDER}")
set(OUTPUT_FOLDER "$ENV{SKYRIM_MODS_FOLDER}/${PROJECT_NAME} ${CMAKE_BUILD_TYPE}")
endif()
#set(OUTPUT_FOLDER "C:/Path/To/Custom/Output") <- Uncomment and use for custom path.
Be sure to checkout the Wiki for this Plugin!
A work-in-progress website dedicated to documenting modding, and authors.
Very useful for SKSE plugin development. Might as well be a required resource at this point.