Wireshark-dev: Re: [Wireshark-dev] WIRESHARK_RUN_FROM_BUILD_DIRECTORY for in-source CMake build
From: Jeff Morriss <jeff.morriss.ws@xxxxxxxxx>
Date: Thu, 21 Jun 2012 09:25:04 -0400
Tony Trinh wrote:
When I query the list of RADIUS fields from tshark, I see a different number of results as shown below.

*in-source CMake build (tshark run from top-level source directory):*

    $ ./tshark -G fields | grep 'radius\.' | wc -l
      89

    $ WIRESHARK_RUN_FROM_BUILD_DIRECTORY=1 ./tshark -G fields | grep
    'radius\.' | wc -l
      8613

*out-of-source CMake build (tshark run from build directory):*

    $ ./tshark -G fields | grep 'radius\.' | wc -l
      8613


*autotools build (tshark run from top-level source directory):*

    $ ./tshark -G fields | grep 'radius\.' | wc -l
      8613

Why is the environment variable WIRESHARK_RUN_FROM_BUILD_DIRECTORY necessary for the in-source CMake build but not in any other case?

There's code in epan/filesystem.c that is able to detect (based on the presence of the .libs directory) that we're being run from an autotools-based build directory (thus making the environment variable not necessary). No such code (yet) exists for cmake. Or Windows, for that matter...