You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+83-73Lines changed: 83 additions & 73 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2020,15 +2020,90 @@ If you are interested in understanding how the library works, you can read the d
2020
2020
2021
2021
## Integration
2022
2022
2023
-
### CMake (manual download)
2023
+
### Dependencies
2024
+
2025
+
The build script will try to find all these dependencies for you:
2026
+
2027
+
* C++17
2028
+
* CMake 3.14+
2029
+
* Required at runtime
2030
+
* Gnuplot 5.2.6+
2031
+
2032
+
It will also look for these *optional* dependencies for manipulating images:
2033
+
2034
+
* JPEG
2035
+
* TIFF
2036
+
* ZLIB
2037
+
* PNG
2038
+
* LAPACK
2039
+
* BLAS
2040
+
* FFTW
2041
+
* OpenCV
2042
+
2043
+
There are two dependencies in [`source/3rd_party`](source/3rd_party). These dependencies are bundled, so you don't have to worry about them:
2044
+
2045
+
* olvb/nodesoup
2046
+
* dtschump/CImg
2047
+
2048
+
You can define `WITH_SYSTEM_NODESOUP=ON` or `WITH_SYSTEM_CIMG=ON` in the cmake command line to use a system-provided version of these dependencies.
2049
+
2050
+
There's an extra target `matplot_opengl` with the experimental OpenGL backend. You need to define `BUILD_EXPERIMENTAL_OPENGL_BACKEND=ON` in the CMake command line to build that target. In that case, the build script will also look for these extra dependencies:
2051
+
2052
+
* OpenGL
2053
+
* GLAD
2054
+
* GLFW3
2055
+
2056
+
You can see all dependencies in [`source/3rd_party/CMakeLists.txt`](source/3rd_party/CMakeLists.txt).
2057
+
2058
+
### Build the examples
2059
+
2060
+
```bash
2061
+
mkdir build
2062
+
cmake -version
2063
+
cmake .. -DCMAKE_BUILD_TYPE=Release
2064
+
cmake --build . -j 2 --config Release
2065
+
```
2066
+
2067
+
### Installing
2068
+
2069
+
```bash
2070
+
mkdir build
2071
+
cmake -version
2072
+
cmake .. -DCMAKE_BUILD_TYPE=Release
2073
+
cmake --build . -j 2 --config Release
2074
+
cmake --install
2075
+
```
2076
+
2077
+
### As a CMake package
2078
+
2079
+
If you have library installed, you can call
2080
+
2081
+
```cmake
2082
+
find_package(Matplot++)
2083
+
```
2084
+
2085
+
from your CMake build script. When creating your executable, link the library to the targets you want:
2086
+
2087
+
```
2088
+
add_executable(my_target main.cpp)
2089
+
target_link_libraries(my_target PUBLIC matplot)
2090
+
```
2091
+
2092
+
Add this header to your source files:
2093
+
2094
+
```cpp
2095
+
#include<matplot/matplot.h>
2096
+
```
2097
+
2098
+
### As a CMake subdirectory
2024
2099
2025
2100
Check if you have [Cmake](http://cmake.org) 3.14+ installed:
2026
2101
2027
2102
```bash
2028
2103
cmake -version
2029
2104
```
2030
2105
2031
-
Download the whole project and add the subdirectory to your Cmake project:
2106
+
Download the whole project and add the subdirectory to your CMake project:
2032
2107
2033
2108
```cmake
2034
2109
add_subdirectory(matplotplusplus)
@@ -2047,7 +2122,7 @@ Add this header to your source files:
2047
2122
#include<matplot/matplot.h>
2048
2123
```
2049
2124
2050
-
### CMake (automatic download)
2125
+
### CMake with Automatic Download
2051
2126
2052
2127
Check if you have [Cmake](http://cmake.org) 3.14+ installed:
2053
2128
@@ -2073,43 +2148,18 @@ Then add this header to your source files:
2073
2148
#include<matplot/matplot.h>
2074
2149
```
2075
2150
2076
-
### Other build systems
2151
+
### Other build systems
2077
2152
2078
-
Right now, it really doesn't have support for anything other than CMake. If you really want to use it in another build system you pretty much have to rewrite the entire build script.
2153
+
If you want to use it in another build system you can either install the library (Section [*Installing*](#installing)) or you have to rewrite the build script.
2079
2154
2080
-
If you're not using Cmake, your project needs to include the headers and compile all source files in the [`source`](source) directory. You also need to link with the dependencies described in [`source/3rd_party/CMakeLists.txt`](source/3rd_party/CMakeLists.txt).
2155
+
Your project needs to 1) include the headers and compile all source files in the [`source`](source) directory, and 2) link with the dependencies described in [`source/3rd_party/CMakeLists.txt`](source/3rd_party/CMakeLists.txt).
2081
2156
2082
2157
Then add this header to your source files:
2083
2158
2084
2159
```cpp
2085
2160
#include<matplot/matplot.h>
2086
2161
```
2087
2162
2088
-
### Dependencies
2089
-
2090
-
This project requires C++17. You can see other dependencies in [`source/3rd_party/CMakeLists.txt`](source/3rd_party/CMakeLists.txt). CMake will try to solve everything for you.
2091
-
2092
-
* Required
2093
-
* olvb/nodesoup (bundled; but you can define `WITH_SYSTEM_NODESOUP=ON` in the cmake command line to use a system-provided version of nodesoup)
2094
-
* dtschump/CImg (bundled; but you can define `WITH_SYSTEM_CIMG=ON` in the cmake command line to use a system-provided version of CImg)
2095
-
* Required (at Runtime)
2096
-
* Gnuplot 5.2.6+
2097
-
* Optional (for images)
2098
-
* JPEG
2099
-
* TIFF
2100
-
* ZLIB
2101
-
* PNG
2102
-
* LAPACK
2103
-
* BLAS
2104
-
* FFTW
2105
-
* OpenCV
2106
-
* Optional (for OpenGL backend)
2107
-
* OpenGL
2108
-
* GLAD
2109
-
* GLFW3
2110
-
2111
-
There's an extra target `matplot_opengl` that exemplifies how an OpenGL backend **could** be implemented. It's not a complete backend. If you want to test it, only then there are some extra dependencies.
2112
-
2113
2163
### Backends
2114
2164
2115
2165
Coming up with new backends is a continuous process. See the complete [article](documentation/README.md) for a description of the [backend interface](source/matplot/backend/backend_interface.h), a description of the current default backend ([Gnuplot pipe](source/matplot/backend/gnuplot.h)), and what's involved in possible [new backends](documentation/README.md#backends). See the directory [`source/matplot/backend`](source/matplot/backend) for some examples. Also, have a look at this example [`test/backends/main.cpp`](test/backends/ogl_main.cpp).
@@ -2130,7 +2180,7 @@ If you're in a hurry, here is a summary of the backends we have and the backends
2130
2180
* Pros: Great for vector graphics
2131
2181
* Cons: Unmaintained, 2D only, and non-interactive by itself <sup>see [1](https://github.com/ghaerr/agg-2.6#roadmap), [2](https://github.com/mapnik/mapnik/wiki/MapnikRenderers), [3](http://www.antigrain.com/) </sup>
2132
2182
2133
-
###Contributing
2183
+
## Contributing
2134
2184
2135
2185
There are many ways in which you can contribute to this library:
2136
2186
@@ -2163,7 +2213,7 @@ There are many ways in which you can contribute to this library:
@@ -2293,43 +2343,3 @@ There are many ways in which you can contribute to this library:
2293
2343
* Zaitsev S (2020). Webview. URL: [https://github.com/zserge/webview](https://github.com/zserge/webview).
2294
2344
2295
2345
* Zakai A (2011). "Emscripten: an LLVM-to-JavaScript compiler." In Proceedings of the ACM international conference companion on Object oriented programming systems languages and applications companion, pp. 301-312.
0 commit comments