Subject: Re: [PATCH 0/8] CMake build system for git

From: Danh Doan <[email-masked]>
Date: Tue, 28 Apr 2020 20:52:37 +0700

On 2020-04-27 16:12:28-0400, Jeff King <[email-masked]> wrote:
> On Mon, Apr 27, 2020 at 04:08:52PM -0400, Jeff King wrote:
> 
> > Skimming the patches, I do wish I didn't see so much repetition with the
> > existing Makefile. I know that some of the logic will just have to be
> > ported manually, but surely we could be pulling things like the list of
> > libgit_SOURCES from the Makefile as the single source of truth?
> 
> Thinking I surely couldn't be the only one to think of this, I dug
> further into some of the sub-threads. And indeed, it seems like you are
> on the same page here.
> 
> IMHO it is worth making the cmake file depend as much as possible on
> what's in the Makefile.

Please correct me if I were wrong (I recall this from my memory
without checking anything).

The worst thing about CMake is we can't override (Make's) variable
in Makefile generated by CMake.

I've made some comment in Sibi's patch about some make's variable,
because Sibi naively translates them from current Makefile.
Namely, the location of some system configuration files, $(libexecdir)
and build conditional macro.

With current Makefile, we can just:

	make VAR=VALUE target

or:
	echo "VAR=VALUE" >> config.mak
	make target

With cmake, we need to define all of them as CMake options (this will
brings along a big burden), whenever we need to change any options,
we need to (assume that cmake generates Makefile):

	cmake -DVAR=VALUE path/to/src/dir
	make target

How many make variables that we need to define in CMakeList.txt,
I don't know.

-- 
Danh