Added CMake support for library#55
Conversation
|
Hi, I'm sorry for not commenting on this for so long. Long story short, I'm still hesitant to merge CMake support, first of all because I don't want to support the CMakeLists.txt and second because However, I'll leave it open so people who actually want the CMake support can easily find it, or if you prefer you could put it into the |
|
I'm in favor of merging this. It makes matplotlibcpp a CMake INTERFACE (read: header only) library and thus changes absolutely nothing for people who just use the header directly but makes it easier for people who use CMake, as all we then have to do is clone the repo to our thirdparty directory (or add submodule or whatever) and then |
|
@lava Are you still willing to consider merging this feature? As more and more projects use this header only library (which is amazing btw!), it makes using it in a CMake project easier and prevents code duplication. I would also like to package this for ArchLinux and having a CMake install targets makes it so much easier. |
|
As said in #249, the formerly simple Makefile has become more and more complicated, so I think we're at the point where switching to cmake makes sense. (I still think it's not a good idea to use this as library in other projects, but clearly that's not stopping people from doing it anyways) I've opted for merging the other PR instead since it seemed a bit more modern and feature-complete, but thanks again for providing the original cmake support and enabling interested users to make use of it with your PR! |
The purpose of this PR is to integrate CMake support directly to project and preserve the current Makefile-correctness at the same time.
The reason for adding CMakeLists.txt is to be able to integrate this library in other projects using add_subdirectory() feature in CMake.
Also, CMakeLists.txt for this library is desired as it provides include & link settings for library which would one have to add manually in his project.
This PR has been tested on both Linux (Fedora, gcc/clang) and Windows (VS).