Skip to content

Commit

Permalink
Make sure Windows gets the right force field data files
Browse files Browse the repository at this point in the history
Signed-off-by: Geoff Hutchison <[email protected]>
  • Loading branch information
ghutchis committed Feb 9, 2024
1 parent 7d445ef commit 87e45e9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions avogadro/qtplugins/forcefield/obenergy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include <openbabel/obconversion.h>
#include <openbabel/obiter.h>

#include <QCoreApplication>
#include <QDebug>
#include <QDir>

Expand All @@ -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();

Expand Down

0 comments on commit 87e45e9

Please sign in to comment.