3 ms·
[ Full disclosure: CMake developer. ] Eh. CMake is a build system. It supports multiple build tools, but it's not like one can just tell CMake "here's some lit
by mathstuf 5y ago
[ Full disclosure: CMake developer. ]
Eh. CMake is a build system. It supports multiple build tools, but it's not like one can just tell CMake "here's some literal Make code, please put it into the generated files". The generated builds are still restricted to the semantics that CMake itself provides via its interface (e.g., no dyndep support in `add_custom_command` because only the Ninja generator supports that reasonably well; it's possible with Make, but I don't know how easy it would be to make it work for arbitrary custom commands).
- iamcreasy 5y ago[Not a C/C++ dev] I am under the assumption CMake do not perform build itself, it produces the build file for Make, Ninja etc. and have those tools run the build file to produce the final binary. If that's correct, wouldn't it make CMake a meta build system?
- mathstuf 5y agoRight, I'm being more semantic here. CMake is a build system with the concepts of targets, linking, compiling, languages, toolchains, etc. The fact that it gets "rendered" into a `build.ninja`, `.vcxproj`, `.xcodebuild`, or `Makefile` is (largely) ambivalent (I call these "build tools" or "build executors"). Other instances would be `gn` or Meson. They're the build system; ninja is "just" the build tool they use to actually implement their semantics. Still others like build2, Boost.build, or the Bazel family are both: the build system and the build tool. One cannot use CMake to write arbitrary Makefiles using all the fancy features available through macro expansion, rule templates, etc. All you have are CMake's semantics that can then be executed by a tool that implements POSIX makefile execution behaviors. A (probably poor) analogy is a network resource. It can be provided over HTTP, Gopher, or whatever. The semantics of the resource are the same, but the transport mechanism is just how it interacts with the rest of the world.