From 87e45e976cbb10dfd98eb3da4e8b084cca50d376 Mon Sep 17 00:00:00 2001 From: Geoff Hutchison Date: Fri, 9 Feb 2024 13:47:19 -0500 Subject: [PATCH] Make sure Windows gets the right force field data files Signed-off-by: Geoff Hutchison --- avogadro/qtplugins/forcefield/obenergy.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/avogadro/qtplugins/forcefield/obenergy.cpp b/avogadro/qtplugins/forcefield/obenergy.cpp index 33be5ea87d..08e5edc300 100644 --- a/avogadro/qtplugins/forcefield/obenergy.cpp +++ b/avogadro/qtplugins/forcefield/obenergy.cpp @@ -18,6 +18,7 @@ #include #include +#include #include #include @@ -43,6 +44,11 @@ OBEnergy::OBEnergy(const std::string& method) : m_identifier(method), m_name(method), m_molecule(nullptr) { d = new Private; + + // make sure we set the Open Babel variables for data files +#if defined(_WIN32) + qputenv("BABEL_DATADIR", QCoreApplication::applicationDirPath() + "/data"); +#else // Ensure the plugins are loaded OBPlugin::LoadAllPlugins();