Commit ebe1e365 authored by Stefan Pfeifer's avatar Stefan Pfeifer

Linux deployment: Working snapcraft configuration

parent 05bf041d
Alternative A: Snap
===================
run snapcraft. Yeah.
Alternative B: Static build
===========================
1. Install the following libraries (source: wolhsoft.ru/pgewiki/Building_static_Qt_5)
* sudo apt-get install "^libxcb.*" libx11-dev libx11-xcb-dev libxcursor-dev libxrender-dev libxrandr-dev libxext-dev libxi-dev libxss-dev libxt-dev libxv-dev libxxf86vm-dev libxinerama-dev libxkbcommon-dev libfontconfig1-dev libasound2-dev libpulse-dev libdbus-1-dev udev mtdev-tools webp libudev-dev libglm-dev libwayland-dev libegl1-mesa-dev mesa-common-dev libgl1-mesa-dev libglu1-mesa-dev libgles2-mesa libgles2-mesa-dev libmirclient-dev libproxy-dev libgtk2.0-dev
......
[Desktop Entry]
Name=Bow Simulator
Exec=bow-simulator
Type=Application
Name[en_US]=Bow Simulator
name: bow-simulator
version: 0.1.0
summary: Bow and arrow physics simulation
description: Bow Simulator allows you to create virtual bow designs and simulate their performance. It calculates a wide range of static and dynamic bow characteristics such as the draw curve, material stresses, arrow velocity and degree of efficiency. It can be used for evaluating and optimising bow designs before actually building them.
apps:
bow-simulator:
command: desktop-launch bow-simulator
plugs: [x11, home]
parts:
bow-simulator:
plugin: qmake
qt-version: qt5
options: [CONFIG += release]
source: ../../
after: [desktop-qt5]
\ No newline at end of file
INCLUDEPATH += /mnt/Daten/Libraries/Eigen-3.3.1 \ # http://eigen.tuxfamily.org
/mnt/Daten/Libraries/Catch-1.5.9/include \ # https://github.com/philsquared/Catch
/mnt/Daten/Libraries/Jsoncons-0.99.5/src \ # https://github.com/danielaparker/jsoncons
/mnt/Daten/Libraries/Boost-1.62.0 \ # http://www.boost.org
TARGET = bow-simulator
TEMPLATE = app
# install
target.path = /bin
INSTALLS += target
QT += core \
gui \
widgets \
printsupport \
RESOURCES += resources/resources.qrc
HEADERS += \
source/external/qcustomplot/qcustomplot.h \
source/fem/elements/BarElement.hpp \
source/fem/elements/BeamElement.hpp \
source/fem/elements/MassElement.hpp \
source/fem/Element.hpp \
source/fem/Node.hpp \
source/fem/Solver.hpp \
source/fem/System.hpp \
source/fem/View.hpp \
source/gui/input/BowEditor.hpp \
source/gui/input/CommentsDialog.hpp \
source/gui/input/DoubleView.hpp \
source/gui/input/IntegerView.hpp \
source/gui/input/LimbViews.hpp \
source/gui/input/NumberGroup.hpp \
source/gui/input/SeriesView.hpp \
source/gui/input/SettingsDialog.hpp \
source/gui/output/ComboPlot.hpp \
source/gui/output/EnergyPlot.hpp \
source/gui/output/OutputDialog.hpp \
source/gui/output/OutputGrid.hpp \
source/gui/output/ShapePlot.hpp \
source/gui/output/Slider.hpp \
source/gui/output/StressPlot.hpp \
source/gui/MainWindow.hpp \
source/gui/Plot.hpp \
source/gui/ProgressDialog.hpp \
source/model/BowModel.hpp \
source/model/DiscreteLimb.hpp \
source/model/Document.hpp \
source/model/InputData.hpp \
source/model/OutputData.hpp \
source/numerics/ArcCurve.hpp \
source/numerics/CubicSpline.hpp \
source/numerics/Curve.hpp \
source/numerics/Domain.hpp \
source/numerics/Linspace.hpp \
source/numerics/SecantMethod.hpp \
source/numerics/Series.hpp \
source/numerics/TDMatrix.hpp \
source/numerics/Units.hpp \
source/utils/DynamicCastIterator.hpp \
source/utils/Optional.hpp
SOURCES += \
source/external/qcustomplot/qcustomplot.cpp \
source/fem/elements/BarElement.cpp \
source/fem/elements/BeamElement.cpp \
source/fem/elements/MassElement.cpp \
source/fem/Element.cpp \
source/fem/Node.cpp \
source/fem/Solver.cpp \
source/fem/System.cpp \
source/gui/input/BowEditor.cpp \
source/gui/input/CommentsDialog.cpp \
source/gui/input/DoubleView.cpp \
source/gui/input/IntegerView.cpp \
source/gui/input/LimbViews.cpp \
source/gui/input/NumberGroup.cpp \
source/gui/input/SeriesView.cpp \
source/gui/input/SettingsDialog.cpp \
source/gui/output/ComboPlot.cpp \
source/gui/output/EnergyPlot.cpp \
source/gui/output/OutputDialog.cpp \
source/gui/output/OutputGrid.cpp \
source/gui/output/ShapePlot.cpp \
source/gui/output/Slider.cpp \
source/gui/output/StressPlot.cpp \
source/gui/MainWindow.cpp \
source/gui/Plot.cpp \
source/gui/ProgressDialog.cpp \
source/model/BowModel.cpp \
source/model/DiscreteLimb.cpp \
source/model/InputData.cpp \
source/model/OutputData.cpp \
source/numerics/ArcCurve.cpp \
source/numerics/CubicSpline.cpp \
source/numerics/Series.cpp \
source/main.cpp
# Compiler flags
CONFIG += c++14
# Platform specific
win32-g++{
# http://eigen.tuxfamily.org/dox-devel/group__TopicWrongStackAlignment.html
QMAKE_CXXFLAGS += -mincoming-stack-boundary=2
}
include(dependencies.pri)
TARGET = bow-simulator
TEMPLATE = app
QT += core \
gui \
widgets \
printsupport \
RESOURCES += ../resources/resources.qrc
HEADERS += \
../source/external/qcustomplot/qcustomplot.h \
../source/fem/elements/BarElement.hpp \
../source/fem/elements/BeamElement.hpp \
../source/fem/elements/MassElement.hpp \
../source/fem/Element.hpp \
../source/fem/Node.hpp \
../source/fem/Solver.hpp \
../source/fem/System.hpp \
../source/fem/View.hpp \
../source/gui/input/BowEditor.hpp \
../source/gui/input/CommentsDialog.hpp \
../source/gui/input/DoubleView.hpp \
../source/gui/input/IntegerView.hpp \
../source/gui/input/LimbViews.hpp \
../source/gui/input/NumberGroup.hpp \
../source/gui/input/SeriesView.hpp \
../source/gui/input/SettingsDialog.hpp \
../source/gui/output/ComboPlot.hpp \
../source/gui/output/EnergyPlot.hpp \
../source/gui/output/OutputDialog.hpp \
../source/gui/output/OutputGrid.hpp \
../source/gui/output/ShapePlot.hpp \
../source/gui/output/Slider.hpp \
../source/gui/output/StressPlot.hpp \
../source/gui/MainWindow.hpp \
../source/gui/Plot.hpp \
../source/gui/ProgressDialog.hpp \
../source/model/BowModel.hpp \
../source/model/DiscreteLimb.hpp \
../source/model/Document.hpp \
../source/model/InputData.hpp \
../source/model/OutputData.hpp \
../source/numerics/ArcCurve.hpp \
../source/numerics/CubicSpline.hpp \
../source/numerics/Curve.hpp \
../source/numerics/Domain.hpp \
../source/numerics/Linspace.hpp \
../source/numerics/SecantMethod.hpp \
../source/numerics/Series.hpp \
../source/numerics/TDMatrix.hpp \
../source/numerics/Units.hpp \
../source/utils/DynamicCastIterator.hpp \
../source/utils/Optional.hpp
SOURCES += \
../source/external/qcustomplot/qcustomplot.cpp \
../source/fem/elements/BarElement.cpp \
../source/fem/elements/BeamElement.cpp \
../source/fem/elements/MassElement.cpp \
../source/fem/Element.cpp \
../source/fem/Node.cpp \
../source/fem/Solver.cpp \
../source/fem/System.cpp \
../source/gui/input/BowEditor.cpp \
../source/gui/input/CommentsDialog.cpp \
../source/gui/input/DoubleView.cpp \
../source/gui/input/IntegerView.cpp \
../source/gui/input/LimbViews.cpp \
../source/gui/input/NumberGroup.cpp \
../source/gui/input/SeriesView.cpp \
../source/gui/input/SettingsDialog.cpp \
../source/gui/output/ComboPlot.cpp \
../source/gui/output/EnergyPlot.cpp \
../source/gui/output/OutputDialog.cpp \
../source/gui/output/OutputGrid.cpp \
../source/gui/output/ShapePlot.cpp \
../source/gui/output/Slider.cpp \
../source/gui/output/StressPlot.cpp \
../source/gui/MainWindow.cpp \
../source/gui/Plot.cpp \
../source/gui/ProgressDialog.cpp \
../source/model/BowModel.cpp \
../source/model/DiscreteLimb.cpp \
../source/model/InputData.cpp \
../source/model/OutputData.cpp \
../source/numerics/ArcCurve.cpp \
../source/numerics/CubicSpline.cpp \
../source/numerics/Series.cpp \
../source/main.cpp
# Compiler flags
CONFIG += c++14
# Platform specific
win32-g++{
# http://eigen.tuxfamily.org/dox-devel/group__TopicWrongStackAlignment.html
QMAKE_CXXFLAGS += -mincoming-stack-boundary=2
}
INCLUDEPATH += /home/s/Libraries/Eigen-3.3.1 \ # http://eigen.tuxfamily.org
/home/s/Libraries/Catch-1.5.9/include \ # https://github.com/philsquared/Catch
/home/s/Libraries/Jsoncons-0.99.5/src \ # https://github.com/danielaparker/jsoncons
/home/s/Libraries/Boost-1.62.0 \ # http://www.boost.org
include(dependencies.pri)
TEMPLATE = app
CONFIG += console c++11
CONFIG -= app_bundle
CONFIG -= qt
SOURCES += \
../source/tests/bar_trusses.cpp \
../source/tests/tangent_stiffness.cpp \
../source/tests/harmonic_oscillator.cpp \
../source/tests/main.cpp \
../source/tests/large_deformation_beams.cpp \
../source/fem/System.cpp \
../source/fem/Node.cpp \
../source/fem/Element.cpp
HEADERS += \
../source/fem/View.hpp \
../source/fem/System.hpp \
../source/fem/Node.hpp \
../source/fem/elements/BarElement.hpp \
../source/fem/Solver.hpp \
../source/numerics/Linspace.hpp \
../source/fem/elements/MassElement.hpp \
../source/fem/Element.hpp \
../source/fem/elements/BeamElement.hpp
......@@ -128,9 +128,9 @@ Plot::Plot(const QString& lbx, const QString& lby, Align align)
QObject::connect(plot, &QCustomPlot::customContextMenuRequested, [&](QPoint pos)
{
auto menu = new QMenu(this);
menu->addAction("Copy", [this](){ copy(); }); // Todo: Use std::bind?
menu->addAction("Copy", this, SLOT(copy(void))); // Todo: Use &Plot::copy (blocked by snap qt-version compatibility)
menu->addSeparator();
menu->addAction("Export...", [this](){ exportDialog(); }); // Todo: Use std::bind?
menu->addAction("Export...", this, SLOT(exportDialog(void))); // Todo: Use &Plot::exportDialog (blocked by snap qt-version compatibility)
menu->exec(plot->mapToGlobal(pos));
});
......
......@@ -29,6 +29,8 @@ enum class ExpansionMode
class Plot: public QWidget
{
Q_OBJECT // Todo: Only necessary because of old signals/slots mechanism (snap qt-version compatibility)
public:
enum class Align{ BottomLeft, BottomRight, TopLeft, TopRight }; // Todo: Better name than "align"
......@@ -67,6 +69,8 @@ private:
QCPItemStraightLine* indicator_y;
virtual void resizeEvent(QResizeEvent *event) override;
public slots:
void copy();
void exportDialog();
};
......@@ -15,3 +15,4 @@ int main(int argc, char *argv[])
return app.exec();
}
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