[CMake] Why CMake can't run as make ? (was: Re: makefile to CMakeLists.txt, possible?)

Chris Hillery chillery-cmake at lambda.nu
Fri Sep 3 05:04:55 EDT 2010


On Fri, Sep 3, 2010 at 1:54 AM, Chiheng Xu <chiheng.xu at gmail.com> wrote:

> Why CMake can't run as make ?
>
> CMake parse CMakeLists.txt, generate Makefile.  Then, make parse the
> Makefile,  and execute(serially or parallelly) shells,  shells run
> comands(compiler, etc) to build.
>
> Perhaps, CMake can parse CMakeLists.txt, and directly run
> comands(compiler, etc) to build,  without gererating Makefile,
> invoking make, invoking shells.
>

[I replied to this question where you originally asked it in the other
thread, but apparently your re-post crossed my reply. So, to keep the
discussion in one place, I'm copying my reply to this thread.]


Three answers, just off the top of my head:

1. Why re-invent the wheel? Make already does a lot of things quite well.
CMake builds on that.

2. Remember that CMake doesn't only work with Make. It can generate Visual
Studio projects and drive several other build systems. CMake isn't a build
system itself; it's meant to provide a common mechanism to abstract code
organization away from the underlying build system.

3. There's a lot of things CMakeLists might do that aren't directly
build-related, such as creating test configurations and identifying
platform-specific dependencies. There's no need to go through all those
steps every time you just want to compile your latest change; it makes sense
to have a separate configuration step for those.

There have been several other projects which attempted to be a "better Make"
which is effectively what you're describing. There's nothing wrong with
that, but that isn't what CMake does. If that's what you want in a tool,
then I think you'll be happier finding a tool with that goal - always pick
the right tool for the job at hand!

Ceej
aka Chris Hillery
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20100903/f89b9e6b/attachment.htm>


More information about the CMake mailing list