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
+70-23Lines changed: 70 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2023,7 +2023,25 @@ If you are interested in understanding how the library works, you can read the d
2023
2023
2024
2024
## Integration
2025
2025
2026
-
### Dependencies
2026
+
### Binary Packages
2027
+
2028
+
Get the binary package from the [release section](https://github.com/alandefreitas/matplotplusplus/releases). These binaries refer to the last release version of Matplot++.
2029
+
2030
+
If you need a more recent version of Matplot++, you can download the [binary packages from the CI artifacts](https://github.com/alandefreitas/matplotplusplus/actions?query=workflow%3AMatplotplusplus+event%3Apush) or build the library [from the source files](#build-from-source).
2031
+
2032
+
Once the package is installed, you can link your C++ program to the library and include the directories where you installed Matplot++. Unless you changed the default options, the library is likely to be in `/usr/local/` (Linux / Mac OS) or `C:/Program Files/` (Windows).
2033
+
2034
+
If you are using CMake, you can then find Matplot++ with the usual `find_package` command:
2035
+
2036
+
```cmake
2037
+
find_package(Matplot++ REQUIRED)
2038
+
# ...
2039
+
target_link_libraries(my_target PUBLIC matplot)
2040
+
```
2041
+
2042
+
### Build from Source
2043
+
2044
+
#### Dependencies
2027
2045
2028
2046
This section lists the dependencies you need before installing Matplot++ from source. The build script will try to find all these dependencies for you:
2029
2047
@@ -2032,7 +2050,7 @@ This section lists the dependencies you need before installing Matplot++ from so
Make sure you mark the option "Add application directory to your PATH environment variable".
2127
+
or download the latest version from [www.gnuplot.info](www.gnuplot.info). If you're using an installer, make sure you mark the option "Add application directory to your PATH environment variable".
2105
2128
2106
2129
</details>
2107
2130
2108
2131
<details>
2109
-
<summary>Mac Os/Clang</summary>
2132
+
<summary>Instructions: Mac Os/Clang</summary>
2110
2133
2111
2134
Check your Clang version:
2112
2135
@@ -2135,20 +2158,32 @@ sudo brew upgrade cmake
2135
2158
```
2136
2159
2137
2160
or download the most recent version from [cmake.org](https://cmake.org/).
2138
-
If building the Python bindings, check your Python version:
2139
-
Install Gnuplot: www.gnuplot.info
2140
2161
2141
-
Make sure you mark the option "Add application directory to your PATH environment variable".
2162
+
If the last command fails because you don't have [Homebrew](https://brew.sh) on your computer, you can install it with
or you can follow the instructions in [https://brew.sh](https://brew.sh).
2169
+
2170
+
Install Gnuplot 5.2.6+
2171
+
2172
+
```bash
2173
+
sudo brew install gnuplot
2174
+
```
2175
+
2176
+
or download the latest version from [www.gnuplot.info](www.gnuplot.info). If you're using an installer, make sure you mark the option "Add application directory to your PATH environment variable".
2142
2177
2143
2178
</details>
2144
2179
2145
2180
<details>
2146
2181
<summary>Instructions: Windows/MSVC</summary>
2147
2182
2148
-
* Make sure you have a recent version of Visual Studio.
2149
-
* Download and install Git.
2150
-
*Install CMake from https://cmake.org/download/
2151
-
*Install Gnuplot: www.gnuplot.info
2183
+
* Make sure you have a recent version of [Visual Studio](https://visualstudio.microsoft.com)
2184
+
* Download Git from [https://git-scm.com/download/win](https://git-scm.com/download/win)and install it
2185
+
*Download CMake from [https://cmake.org/download/](https://cmake.org/download/) and install it
2186
+
*Download Gnuplot from [www.gnuplot.info](www.gnuplot.info) and install it
2152
2187
2153
2188
</details>
2154
2189
@@ -2178,7 +2213,7 @@ There's an extra target `matplot_opengl` with the experimental OpenGL backend. Y
2178
2213
2179
2214
You can see all dependencies in [`source/3rd_party/CMakeLists.txt`](source/3rd_party/CMakeLists.txt).
This will create packages you can use to install Matplot++ on your system:
2207
2242
@@ -2216,7 +2251,9 @@ cpack .
2216
2251
2217
2252
You might need `sudo` for this last command.
2218
2253
2219
-
### Find it as a CMake Package
2254
+
### CMake targets
2255
+
2256
+
#### Find it as a CMake Package
2220
2257
2221
2258
If you have the library installed, you can call
2222
2259
@@ -2239,7 +2276,7 @@ Add this header to your source files:
2239
2276
#include<matplot/matplot.h>
2240
2277
```
2241
2278
2242
-
### Use it as a CMake subdirectory
2279
+
####Use it as a CMake subdirectory
2243
2280
2244
2281
You can use Matplot++ directly in CMake projects without installing it. Check if you have [Cmake](http://cmake.org) 3.14+ installed:
2245
2282
@@ -2272,7 +2309,9 @@ Add this header to your source files:
2272
2309
#include<matplot/matplot.h>
2273
2310
```
2274
2311
2275
-
### CMake with Automatic Download
2312
+
However, it's always recommended to look for Matplot++ with `find_package` before including it as a subdirectory. Otherwise, we can get [ODR errors](https://en.wikipedia.org/wiki/One_Definition_Rule) in larger projects.
2313
+
2314
+
#### CMake with Automatic Download
2276
2315
2277
2316
Check if you have [Cmake](http://cmake.org) 3.14+ installed:
2278
2317
@@ -2298,11 +2337,19 @@ Then add this header to your source files:
2298
2337
#include<matplot/matplot.h>
2299
2338
```
2300
2339
2340
+
However, it's always recommended to look for Matplot++ with `find_package` before including it as a subdirectory. You can use:
2341
+
2342
+
```
2343
+
option(CPM_USE_LOCAL_PACKAGES "Try `find_package` before downloading dependencies" ON)
2344
+
```
2345
+
2346
+
to let CPM.cmake do that for you. Otherwise, we can get [ODR errors](https://en.wikipedia.org/wiki/One_Definition_Rule) in larger projects.
2347
+
2301
2348
### Other build systems
2302
2349
2303
-
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.
2350
+
If you want to use it in another build system you can either install the library (Section [*Installing*](#installing)) or you have to somehow rewrite the build script.
2304
2351
2305
-
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).
2352
+
If you want to rewrite the build script, 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).
0 commit comments