How do I compile+link my code without using cmake? #200
-
It would appear that the only documentation regarding compiling and linking my code with matplot++ assumes the use of cmake. Can anyone tell me how to this for a project that does not use cmake? It would be nice if there was a matplot++.pc file installed since enabling pkg-config would simplify things for non-cmake usage. ETA: I'm using linux - debian 11 with matplot++ installed to /usr/local |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
If you want to compile it with another build system, then you'd have to replicate everything starting from https://github.com/alandefreitas/matplotplusplus/blob/master/CMakeLists.txt If you just want to link a version you have installed, then you'd have to replicate the contents of the final matplot++-config.cmake file (generated from this) that's going to be in your installation directory. This matplot++-config.cmake is the cmake equivalent of a package config matplot++.pc. I don't think there's a way an simple way to generate a matplot++.pc from the current build scripts. Maybe there could be a small template with the flags you need. But there are still lots of dependencies to link and matplot++.pc would probably get behind matplot++-config.cmake all the time. |
Beta Was this translation helpful? Give feedback.
-
Answering myself with a solution that works when using the
which failed but I stupidly didn't read the error message fully.
There is one more possible module |
Beta Was this translation helpful? Give feedback.
Answering myself with a solution that works when using the
meson
build system.meson
can usecmake
'sfind_package()
function to find dependencies. I had tried using the dependency in mymeson.build
file:which failed but I stupidly didn't read the error message fully.
Matplot++
produces several modules which must be given as an argument todependency()
. The following snippet in mymeson.build
file will build the examplematplotplusplus/examples/line_plot/plot/plot_3.cpp