Wireshark-dev: Re: [Wireshark-dev] RPM generation

From: Peter Wu <peter@xxxxxxxxxxxxx>
Date: Mon, 16 Apr 2018 10:22:04 +0200
On Mon, Apr 16, 2018 at 09:02:18AM +0200, Dario Lombardo wrote:
> On Mon, Apr 16, 2018 at 5:32 AM, Anders Broman <a.broman58@xxxxxxxxx> wrote:
> 
> >
> > I followed the way I do it on Windows, which I think is the recommended
> > way there :-)
> >
> >
> The cmake instructions I found always suggest to have the build dir under
> the source. For instance the openSUSE %cmake macro is an alias for "cmake
> .. (plus options)"

Which instructions? I looked for "cmake -" in the source tree, and all
documentation in docbook/ suggest a build dir next to the source dir.
The only example that creates a build dir in the source tree is the
Gitlab CI configuration.

The general recommendation is to do an out-of-tree build (where the
build directory is not equal to the source tree). This could either be
in-tree (mkdir build && cd build) or in a different location (mkdir
/tmp/build && cd /tmp/build).

Personally I use both approaches: my main development has a source tree
symlinked at /tmp/wireshark and a build directory at /tmp/wsbuild. When
building from a temporary git worktree, I usually create a build
directory within this tree for convenience:

    # Run from source directory, create a new source directory which
    # shares the same git repository:
    git worktree add /tmp/wireshark-2.4 master-2.4
    cd /tmp/wireshark-2.4
    # update master-2.4 branch
    git pull
    mkdir build && cd build && cmake -GNinja .. (other options here)
    # when done, go back to original source tree and wipe temp dir
    cd /tmp/wireshark
    rm -r /tmp/wireshark-2.4
    git worktree prune -v
-- 
Kind regards,
Peter Wu
https://lekensteyn.nl