2019-01-20 23:15:10 +08:00
# JKQTPlotter: Build as a SHARED library
2018-12-29 00:46:47 +08:00
2019-01-20 23:15:10 +08:00
This directory contains Projects that can be used to build a shared library of JKQTPlotter (i.e. the contents of the directory [`../lib` ](../lib )
2018-12-29 00:46:47 +08:00
2019-01-13 01:53:16 +08:00
## QMake
2018-12-29 00:46:47 +08:00
2019-01-13 01:53:16 +08:00
### Build shared libraries
2018-12-29 00:46:47 +08:00
There are several `.PRO` -files, that can be used to build the full library, or a limited subsets. They will produce a dynamic link library that you can include into your projects, e.g. with the following QMake-snippet:
2019-01-19 16:40:52 +08:00
```.qmake
2019-01-20 23:15:10 +08:00
# include JKQTPlotter library
2018-12-29 01:34:12 +08:00
DEPENDPATH += < PATHTOJKQTPLOTTERDIR > /lib
2018-12-29 00:46:47 +08:00
INCLUDEPATH += < PATHTOJKQTPLOTTERDIR > /lib
CONFIG (debug, debug|release) {
2019-02-04 04:00:15 +08:00
# ensure that DLLs are copied to the output directory
install_jkqtplotter_dll.files = < PATHTOJKQTPLOTTERDIR > /sharedlib/debu/jkqtplotterlib_debug.*
install_jkqtplotter_dll.path = $$OUT_PWD
INSTALLS += install_jkqtplotter_dll
# link agains DLLs
2018-12-29 01:34:12 +08:00
LIBS += -L< PATHTOJKQTPLOTTERDIR > /sharedlib/debug -ljkqtplotterlib_debug
2018-12-29 00:46:47 +08:00
} else {
2019-02-04 04:00:15 +08:00
# ensure that DLLs are copied to the output directory
install_jkqtplotter_dll.files = < PATHTOJKQTPLOTTERDIR > /sharedlib/release/jkqtplotterlib.*
install_jkqtplotter_dll.path = $$OUT_PWD
INSTALLS += install_jkqtplotter_dll
# link agains DLLs
2018-12-29 01:34:12 +08:00
LIBS += -L< PATHTOJKQTPLOTTERDIR > /sharedlib/release -ljkqtplotterlib
2018-12-29 00:46:47 +08:00
}
```
2019-01-12 20:43:12 +08:00
This snippet assumes that you built the libraries with the provided `.PRO` -files.
2019-02-04 04:00:15 +08:00
*Note* that you will have to run a deployment step `make install` before running your executable, so the shared libararies are actually copied to the output directory (see `INSTALLS + ...` above).
2019-01-13 01:53:16 +08:00
2019-01-12 20:43:12 +08:00