You're correct to be concerned about this. Since CommonLibSSE-NG already includes spdlog as a dependency, you should NOT include it separately in your CMakeLists.txt or vcpkg.json files. Including it again could cause namespace collisions, linking errors, or version conflicts.
Here's how you should update the files:
Updated CMakeLists.txt (remove spdlog)
# Find packages - CommonLibSSE-ng provides spdlog find_package(CommonLibSSE CONFIG REQUIRED) find_package(fmt CONFIG REQUIRED) # find_package(spdlog CONFIG REQUIRED) # REMOVE THIS LINE find_package(directxtex CONFIG REQUIRED) find_package(directxtk CONFIG REQUIRED) # Link libraries target_link_libraries(${PROJECT_NAME} PRIVATE CommonLibSSE::CommonLibSSE fmt::fmt Microsoft::DirectXTex Microsoft::DirectXTK # spdlog::spdlog # REMOVE THIS LINE - comes from CommonLibSSE d3d11 dxgi dxgi1_2 windowscodecs dxguid )
Updated vcpkg.json (remove spdlog)
{ "$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json", "name": "printscreen", "version-string": "2.0.0", "dependencies": [ "fmt", "commonlibsse-ng", "directxtex", "directxtk" ] }
Using spdlog in your code
When using spdlog in your plugin, you'll access it through the CommonLibSSE namespace. Here's how:
// In your logger setup namespace logger = SKSE::log; void InitializeLogging() { auto logsFolder = SKSE::log::log_directory(); if (!logsFolder) SKSE::stl::report_and_fail("SKSE log_directory not provided, logs disabled."); auto pluginName = SKSE::PluginDeclaration::GetSingleton()->GetName(); auto logFilePath = *logsFolder / std::format("{}.log", pluginName); auto fileLoggerPtr = std::make_shared<spdlog::sinks::basic_file_sink_mt>(logFilePath.string(), true); auto loggerPtr = std::make_shared<spdlog::logger>("log", std::move(fileLoggerPtr)); spdlog::set_default_logger(std::move(loggerPtr)); spdlog::set_level(spdlog::level::trace); spdlog::flush_on(spdlog::level::info); }
The key point is that spdlog comes bundled with CommonLibSSE-NG, so you get it "for free" when you link against CommonLibSSE. Adding it separately would be redundant and could cause conflicts.