Huge thanks to our Platinum Members Endace and LiveAction,
and our Silver Member Veeam, for supporting the Wireshark Foundation and project.

Wireshark-dev: Re: [Wireshark-dev] [Wireshark-commits] rev 38345: /trunk/ /trunk/: CMakeLists.t

From: Gerald Combs <gerald@xxxxxxxxxxxxx>
Date: Fri, 05 Aug 2011 10:07:10 -0700
On 8/5/11 5:01 AM, Joerg Mayer wrote:
> On Fri, Aug 05, 2011 at 02:45:09AM +0200, Joerg Mayer wrote:
>>> Directory: /trunk/wsutil/
>>>   Changes    Path              Action
>>>   +1 -1      CMakeLists.txt    Modified
>>
>> GLIB2_LIBRARIES -> GLIB2_LDFLAGS
>>
>> Is this really the correct place or should this be fixed in FindGLIB2 instead?
> 
> From /usr/share/cmake/Modules/readme.txt:
> 
> XXX_LIBRARIES           The libraries to link against to use XXX. These should include full paths.  This should not be a cache entry.
> 
> So we'll need to fix the FindGLIB2.cmake as the proper fix.

I'm trying to use CMake with MacPorts, with GLib, GTK+, et al residing
in /opt/local. After running "cmake ." I end up with the following in
CMakeCache.txt:

GLIB2_LDFLAGS:INTERNAL=-L/opt/local/lib;-lglib-2.0;-lintl;-liconv
GLIB2_LIBRARIES:INTERNAL=glib-2.0;intl;iconv

Compilation fails with

set(wsutil_LIBS
  ${GLIB2_LIBRARIES}
)

It looks like this is because wsutil/CMakeFiles/wsutil.dir/link.txt is
missing "-L/opt/local/lib". When I change GLIB2_LIBRARIES to
GLIB2_LDFLAGS link.txt gets created with the proper flags and
compilation works.

BTW, I added "cmake ." + "make" steps to the Buildbot.