On my Debian testing system, here are the results of wx-config --libs

-pthread   -lwx_gtk2u_xrc-2.6 -lwx_gtk2u_qa-2.6 -lwx_gtk2u_html-2.6
-lwx_gtk2u_adv-2.6 -lwx_gtk2u_core-2.6 -lwx_baseu_xml-2.6 -lwx_baseu_net-2.6
-lwx_baseu-2.6

Consistent with this result, FindwxWidgets.cmake yields

wxWidgets_LIBRARIES = 
-pthread;;;-lwx_gtk2u_xrc-2.6;-lwx_gtk2u_qa-2.6;-lwx_gtk2u_html-2.6;-lwx_gtk2u_adv-2.6;-lwx_gtk2u_core-2.6;-lwx_baseu_xml-2.6;-lwx_baseu_net-2.6;-lwx_baseu-2.6

I process that result with a macro to convert those -l flags to full pathname
form (which I prefer since it makes it trivial to use non-standard install
locations):

wxwidgets_LINK_FLAGS =
-pthread;/usr/lib/libwx_gtk2u_xrc-2.6.so;/usr/lib/libwx_gtk2u_qa-2.6.so;/usr/lib/libwx_gtk2u_html-2.6.so;/usr/lib/libwx_gtk2u_adv-2.6.so;/usr/lib/libwx_gtk2u_core-2.6.so;/usr/lib/libwx_baseu_xml-2.6.so;/usr/lib/libwx_baseu_net-2.6.so;/usr/lib/libwx_baseu-2.6.so

Ultimately I use the logic

  target_link_libraries(
  plplotwxwidgets${LIB_TAG}
  plplotcxx${LIB_TAG}
  ${wxwidgets_LINK_FLAGS}
  )

which gives the following CMake warning:

This warning appears
  because target "plplotwxwidgetsd" links to some libraries for which the
    linker must search:

        -pthread

          and other libraries with known full path:


/home/software/plplot_cvs/HEAD/build_dir/bindings/c++/libplplotcxxd.so.9.3.0
/home/software/plplot_cvs/HEAD/build_dir/src/libplplotd.so.9.5.0
/home/software/plplot_cvs/HEAD/build_dir/lib/csa/libcsirocsa.so.0.0.1
/home/software/plplot_cvs/HEAD/build_dir/lib/nn/libcsironn.so.0.0.1

CMake is adding directories in the second list to the linker search path in
case they are needed to find libraries from the first list (for backwards
compatibility with CMake 2.4).

To anticipate Bill's immediate question why I don't set policy CMP0003 to
NEW to avoid this warning message (and also not have the added directories
for the linker search path), I plan to set policy CMP0003 to NEW eventually,
but I am trying to use these warnings to find where I need to transform -l
flags to full pathname form, and the problem is if I don't get rid of the
above warning, then no others are triggered.  (I just discovered that this
morning when I got rid of the -L warning for the X libraries only to have
this new completely independent warning show up.)

For now, I plan to work around that issue by artificially filtering out the
linker option -pthread and continuing with cmake runs to find any remaining
"-l" options, and eventually I will set CMP0003 to NEW so I will not see any
of these warnings.

But the above results show there are three minor issues with RC8 that I
summarize here:

(1) In FindwxWidgets.cmake, wxWidgets_LIBRARIES is documented as
"Path to the wxWidgets libraries".  From the above result (before my macro
transformed it) this documentation should be changed to something like
"List of linker options to use when linking to the wxWidgets libraries".

(2) In CMP0003 OLD mode, the -pthread linker option triggers the warning.
That is obviously incorrect, and only a list of actual libraries (specified
only by -l options?) should trigger the warning.

(3) There is a "sequential" problem with these warnings so only the first
one encountered is mentioned.  Please go back to the old (CVS) method where
(IIRC) a complete list of CMP0003 warnings was generated.  It's a completely
self-explanatory warning message so users should not complain if they
encounter more than one of these messages.

Alan
__________________________
Alan W. Irwin

Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).

Programming affiliations with the FreeEOS equation-of-state implementation
for stellar interiors (freeeos.sf.net); PLplot scientific plotting software
package (plplot.org); the libLASi project (unifont.org/lasi); the Loads of
Linux Links project (loll.sf.net); and the Linux Brochure Project
(lbproject.sf.net).
__________________________

Linux-powered Science
__________________________
_______________________________________________
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to