Commit 8c192fe5 authored by Tobias WEBER's avatar Tobias WEBER

mingw compatibility

parent cc686435
......@@ -3,6 +3,9 @@
# @date dec-2019
# @license GPLv3, see 'LICENSE' file
#
# cmake -DCMAKE_BUILD_TYPE=Release ..
# mingw64-cmake -DCMAKE_BUILD_TYPE=Release ..
#
cmake_minimum_required(VERSION 3.0)
project(moldyn)
......
......@@ -390,12 +390,12 @@ void MolDynDlg::CalculateDistanceBetweenAtoms()
{
auto [objTypeIdx, objSubTypeIdx] = objs[objIdx];
const auto objCoords = m_mol.GetAtomCoords(objTypeIdx, objSubTypeIdx);
for(std::size_t frameidx=0; frameidx<m_mol.GetFrameCount(); ++frameidx)
{
t_real dist = m::get_dist_uc(m_crystA, firstObjCoords[frameidx], objCoords[frameidx]);
ofstr
ofstr
<< std::left << std::setw(g_prec*1.5) << frameidx << " "
<< std::left << std::setw(g_prec*1.5) << dist << "\n";
}
......@@ -484,7 +484,7 @@ void MolDynDlg::CalculatePositionsOfAtoms()
{
auto [objTypeIdx, objSubTypeIdx] = objs[objIdx];
const t_vec& coords = m_mol.GetAtomCoords(objTypeIdx, objSubTypeIdx, frameidx);
ofstr
<< std::left << std::setw(g_prec*1.5) << coords[0] << " "
<< std::left << std::setw(g_prec*1.5) << coords[1] << " "
......@@ -631,7 +631,7 @@ void MolDynDlg::Load()
auto files = filedlg->selectedFiles();
if(!files.size())
return;
QString filename = files[0];
if(filename == "" || !QFile::exists(filename))
return;
......@@ -726,7 +726,7 @@ void MolDynDlg::Load()
QMessageBox::critical(this, PROG_NAME, ex.what());
}
UpdateAtomsStatusMsg();
m_plot->update();
}
......@@ -1185,7 +1185,12 @@ int main(int argc, char** argv)
set_gl_format(1, _GL_MAJ_VER, _GL_MIN_VER, 8);
tl2::set_locales();
QApplication::addLibraryPath(QApplication::applicationDirPath());
QApplication::addLibraryPath(QApplication::applicationDirPath() + QDir::separator() + "qtplugins");
QApplication::addLibraryPath(QString(".") + QDir::separator() + "qtplugins");
auto app = std::make_unique<QApplication>(argc, argv);
auto dlg = std::make_unique<MolDynDlg>(nullptr);
dlg->show();
......
#!/bin/bash
#
# @author Tobias Weber <tweber@ill.fr>
# @date 18-dec-19
# @license GPLv3
#
PROGDIR=~/.wine/drive_c/moldyn
MINGWDIR=/usr/x86_64-w64-mingw32/sys-root/mingw/bin
MINGWQTDIR=/usr/x86_64-w64-mingw32/sys-root/mingw/lib/qt5
mkdir ${PROGDIR}
mkdir -p ${PROGDIR}/qtplugins/platforms
cp -v build/moldyn.exe ${PROGDIR}/
cp -v ${MINGWDIR}/Qt5Core.dll ${PROGDIR}/
cp -v ${MINGWDIR}/Qt5Gui.dll ${PROGDIR}/
cp -v ${MINGWDIR}/Qt5Widgets.dll ${PROGDIR}/
cp -v ${MINGWQTDIR}/plugins/platforms/*.dll ${PROGDIR}/qtplugins/platforms/
cp -v ${MINGWDIR}/libgcc*.dll ${PROGDIR}/
cp -v ${MINGWDIR}/libstdc++-*.dll ${PROGDIR}/
cp -v ${MINGWDIR}/libglib*.dll ${PROGDIR}/
cp -v ${MINGWDIR}/libwinpthread*.dll ${PROGDIR}/
cp -v ${MINGWDIR}/zlib*.dll ${PROGDIR}/
cp -v ${MINGWDIR}/libbz2*.dll ${PROGDIR}/
cp -v ${MINGWDIR}/libfreetype*.dll ${PROGDIR}/
cp -v ${MINGWDIR}/libpng*.dll ${PROGDIR}/
cp -v ${MINGWDIR}/iconv.dll ${PROGDIR}/
cp -v ${MINGWDIR}/libpcre*.dll ${PROGDIR}/
cp -v ${MINGWDIR}/libharfbuzz*.dll ${PROGDIR}/
cp -v ${MINGWDIR}/libintl*.dll ${PROGDIR}/
#echo -e "[paths]\nplugins=qtplugins\n" > ${PROGDIR}/qt.conf
find ${PROGDIR} -name "*.exe" -or -name "*.dll" -exec strip {} \; -print
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment