On 5/31/21 12:12 PM, Andrey Semashev via Boost wrote:
The CMake ability to build and test is a relatively recent addition. Originally, it really was a tool to generate a project for your favorite build system from a common description and nothing more. It really was *not* a build system, but a *meta build system*, if you like. So, the question you would ask was how to use CMake to generate your IDE project, and the tool selection was mostly deferred to the IDE, where possible.
This is the way I use it. Of course, it didn't work so well in practice because the
generated projects and Makefiles are so very different. Heck, even to just configure build configuration type (debug/release/etc.) one had to write two different branches in CMakeLists.txt - one for Makefile-style build systems and the other for VS-style projects.
I leave things like debug/release unspecified and just switch them in the IDE.
Recently, as CMake takes on more and more functionality of a build system, providing portable ways of interaction with the underlying build system (and therefore removing the need of interacting with it directly), providing more portable ways of configuring the build, and as more and more IDEs integrating with CMake using its API, the generator stuff is getting mostly legacy. I think, it is currently half way there, so the kludges that stem from the underlying build system are still visible to the user, but much of the work can be done through CMake interfaces exclusively.
Actually, from my standpoint, the IDE generation is the only actually useful feature of CMake and the only reason I added it to my projects a few years ago. If they stop supporting this, I'll just drop it. Robert Ramey