git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] cmake: ignore generated files

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 19, 2020, 00:50 UTC
Message-ID
<xmqq1riylhcu.fsf@gitster.c.googlers.com>
In-Reply-To
<20200919004030.GB1837@danh.dev>
Đoàn Trần Công Danh  <congdanhqx@gmail.com> writes:
Show 11 quoted lines
>> What can we do to make it easier for people to discover and follow
>> the best current practice?  Are there things in our build
>> instruction document (e.g. the comment at the top of CMakeLists.txt)
>> that needs updating?
>
> I think Sibi had done a lot of good work to write instruction at the
> top of CMakeLists.txt, I guess it's a bit too much instruction.
> The instruction for out of source build was written after the
> instruction to build in-tree.
>
> Should we change the order?  I don't really know.
Oh, absolutely.  
It begins with
    cmake `relative-path-to-CMakeLists.txt` -DCMAKE_BUILD_TYPE=Release
    Eg.
    From the root of git source tree
            `cmake contrib/buildsystems/ `
    This will build the git binaries at the root

which tells exactly what Dscho did and got him writing the patch in question. You'd need to keep reading to be merely _aware_ that it is possible to do an out-of-tree build, without getting even told that it is the norm in CMake land.

We should just remove the above and start the comment seciton with something more like this:

    When using CMake, building in place is highly discouraged.
    Instead, create a new "git-build" directory and perform your
    build there, like this (from the top of the working tree):
            $ mkdir git-build
            $ cd git-build
            $ cmake ../contrib/buildsystems/ -DCMAKE_BUILD_TYPER=Release
    This will build the git binaries in git-build directory

Doing so would reduce the number of choices the user has to make, and reduce the confusion.

Thanks.
Previous: Đoàn Trần Công DanhNext: Johannes Schindelin
Message 8 of 22 in “cmake: ignore generated files”
  1. cmake: ignore generated filesJohannes Schindelin via GitGitGadget, Sep 17, 2020
  2. Junio C HamanoSep 17, 2020
  3. Johannes SchindelinSep 18, 2020
  4. Junio C HamanoSep 18, 2020
  5. Đoàn Trần Công DanhSep 18, 2020
  6. Junio C HamanoSep 18, 2020
  7. Đoàn Trần Công DanhSep 19, 2020
  8. Junio C HamanoSep 19, 2020
  9. Johannes SchindelinSep 20, 2020
  10. Junio C HamanoSep 23, 2020
  11. Johannes SchindelinSep 23, 2020
  12. Junio C HamanoSep 23, 2020
  13. Johannes SchindelinSep 25, 2020
  14. Đoàn Trần Công DanhSep 24, 2020
  15. Johannes SchindelinSep 25, 2020
  16. Johannes SchindelinSep 20, 2020
  17. Junio C HamanoSep 21, 2020
  18. Johannes SchindelinSep 23, 2020
  19. SZEDER GáborSep 24, 2020
  20. Junio C HamanoSep 24, 2020
  21. Junio C HamanoSep 23, 2020
  22. Junio C HamanoSep 23, 2020

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.