[geeks] UNIX development and makefile discussion

Jochen Kunz jkunz at unixag-kl.fh-kl.de
Thu Aug 15 02:56:05 CDT 2013


On Wed, 14 Aug 2013 16:15:25 +0000
microcode at zoho.com wrote:

> > cmake does more. E.g. it scans dependencies, inside your project and to
> > external dependencies. It builds install targets. It cares about the
> > details of linking and building (shared) libraries. It assists you in
> > setting up compile time options, ...
> That's interesting. How can it determine dependencies? Does it scan source?
Sort of. It can autodiscover simple dependencies like .h included
by .c. If your project consists of a lib and an executable and the
executable uses the lib, you have to explicitely say: "exe depends on
lib". So the resulting makefiles are "make -j" save. 

> What if the source isn't C?
cmake supports many different languages and you can specify generator
rules manualy.

> How does it determine external dependencies?
You have to specify them explicitely. I.e. you have to say to cmake:
"I need libfoo > version X and libbar > version Y for this." cmake
scans the system and adds apropriate CFLAGS and LDFLAGS. (simplified)

> This all sounds very powerful...
Indeed, it is. It is no magic silver bullet. It is a tool and you have
to know how to use it. (Learning curve, again.) But it helps to
automate low level stuff like "make -j" saveness.
-- 


\end{Jochen}

\ref{http://www.unixag-kl.fh-kl.de/~jkunz/}


More information about the geeks mailing list