Closed tcbrindle closed 7 years ago
Thank you, Tristan! Adding a cmake based build system was issue #2, so I was very grateful to see this!
My experience with cmake is very limited, but I agree that it is the current industry favorite. I decided it was time for me to get more familiar, so I doubled down on what you contributed, added support for testing and installation, and removed the previous 'make' based build system. I spent a fair amount of time researching typical cmake usage and tried to follow typical cmake usage patterns. I hope what I came up with reflects typical usage. Any feedback you might have on it would be much appreciated! See commit d0f03e5c9ca48716fdff9244f4649410966eb1aa for the changes.
I haven't used CLion, so please let me know if the changes I made don't integrate well with it! Please note that I changed the names of some variables to match prior names (e.g., CMCSTL2_INSTALL_PATH vs CMCSTL2_INCLUDE_DIR).
Finally, I added copyright notices to the files you added and added both of us as authors. If you have any concerns, please let me know!
Hi Tom,
This is great! My initial commit was very much a skeleton implementation just to get it working, but it's great to have it done "properly" with a FindCMCSTL2.cmake module.
I'm pleased to report that the new configuration still works perfectly with CLion.
There are a couple of minor comments regarding the commit (I'll use Github's facility to comment inline to do this), but I'm far from a CMake expert myself so feel free to ignore me :-)
Thanks again,
Tristan
CMake is more-or-less the de-facto standard build system for C++ today. This PR adds a very basic CMake configuration which is sufficient to build the tests and examples, and to use CLion to hack on Text_view.
The configure step requires the compiler to be set to GCC 6.2 (via the
CMAKE_CXX_COMPILER
switch), and the path to the STL2 headers to be supplied via theCMCSTL2_INCLUDE_DIR
variable if these are not present in one of the default search paths (i.e./usr/include
or/usr/local/include
). For example, on my system, I use the following build commands:The second commit also adds instructions to README.md.