Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ jobs:
path: build/data/data/txt
key: data-${{ hashFiles('build/data/data/txt/**/*') }}
restore-keys: data-${{ hashFiles('build/data/data/txt/**/*') }}
- name: deps cache
uses: actions/cache@v2
with:
path: build/deps/dload
key: deps-${{ hashFiles('build/deps/dload/*') }}
restore-keys: deps-${{ hashFiles('build/deps/dload/*') }}
# - name: deps cache
# uses: actions/cache@v2
# with:
# path: build/deps/dload
# key: deps-${{ hashFiles('build/deps/dload/*') }}
# restore-keys: deps-${{ hashFiles('build/deps/dload/*') }}
- name: prepare environment
run: util/prep-env.sh
- name: set apt conf
Expand Down
18 changes: 18 additions & 0 deletions externals/QCustomPlot/1.3.2/qcustomplot-sharedlib/readme.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Compiling QCustomPlot as shared library:
- Make sure the amalgamated QCustomPlot source files (qcustomplot.h/.cpp) are in the directory above sharedlib (two directories above the .pro files).
- Run qmake; make; in the sharedlib-compilation directory. This will create two library versions: "qcustomplot" for release mode and "qcustomplotd" for debug mode.
For example, on Unix this will create libqcustomplot.so and libqcustomplotd.so and some softlink files to those shared library files.
On MS Windows it will create corresponding .dll files.

Compiling an application that uses the shared library:
- Copy all created library/softlink files from the previous step to the sharedlib-usage directory
- run qmake; make; in the sharedlib-usage directory. This will build the application.

Running the application:
- Make sure the application executable can find the shared library files:
On MS Windows it is sufficient to have the library .dll files in the same directory as the executable.
On Unix you have at least two options: You can specify the current directory in the LD_LIBRARY_PATH variable (call in
terminal: "export LD_LIBRARY_PATH=." before launching the application from the same terminal session). This is useful
for testing if it works. The other option is to install the library files to one of the default locations for shared
objects: /usr/local/lib or /usr/lib for example.
- Launch the application.
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#
# Project to compile QCustomPlot as shared library (.so/.dll) from the amalgamated sources
#

QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets printsupport

DEFINES += QCUSTOMPLOT_COMPILE_LIBRARY
TEMPLATE = lib
CONFIG += shared debug_and_release build_all
VERSION = 1.3.2

TARGET = qcustomplot
CONFIG(debug, debug|release) {
TARGET = $$join(TARGET,,,d) # if compiling in debug mode, append a "d" to the library name
QMAKE_TARGET_PRODUCT = "QCustomPlot (debug mode)"
QMAKE_TARGET_DESCRIPTION = "Plotting library for Qt (debug mode)"
} else {
QMAKE_TARGET_PRODUCT = "QCustomPlot"
QMAKE_TARGET_DESCRIPTION = "Plotting library for Qt"
}
QMAKE_TARGET_COMPANY = "www.qcustomplot.com"
QMAKE_TARGET_COPYRIGHT = "Copyright (C) by Emanuel Eichhammer"

SOURCES += ../../qcustomplot.cpp
HEADERS += ../../qcustomplot.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#include <QApplication>
#include <QMainWindow>
#include "../../qcustomplot.h"

int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QMainWindow window;

// setup customPlot as central widget of window:
QCustomPlot customPlot;
window.setCentralWidget(&customPlot);

// create plot (from quadratic plot example):
QVector<double> x(101), y(101);
for (int i=0; i<101; ++i)
{
x[i] = i/50.0 - 1;
y[i] = x[i]*x[i];
}
customPlot.addGraph();
customPlot.graph(0)->setData(x, y);
customPlot.xAxis->setLabel("x");
customPlot.yAxis->setLabel("y");
customPlot.rescaleAxes();

window.setGeometry(100, 100, 500, 400);
window.show();
return a.exec();
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#
# Example project that uses QCustomPlot as a shared library
#
# The compiled shared library file(s) must be in the project directory.
# On Unix, set LD_LIBRARY_PATH to "." before launching the compiled application
# unless the library files are installed in one of the library locations (e.g. /usr/lib)
#
# Note that the qcustomplot.h header should not be added to the project file in the
# HEADERS variable, but only included in your source files with #include.
#

QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets printsupport

TARGET = sharedlib-usage
TEMPLATE = app

# Tell the qcustomplot header that it will be used as library:
DEFINES += QCUSTOMPLOT_USE_LIBRARY

# Link with debug version of qcustomplot if compiling in debug mode, else with release library:
CONFIG(debug, release|debug) {
win32:QCPLIB = qcustomplotd1
else: QCPLIB = qcustomplotd
} else {
win32:QCPLIB = qcustomplot1
else: QCPLIB = qcustomplot
}
LIBS += -L./ -l$$QCPLIB

SOURCES += main.cpp
Loading