[CMake] FindX11.cmake needs some work for 2.6.0
Alan W. Irwin
irwin at beluga.phys.uvic.ca
Mon Apr 14 18:56:33 EDT 2008
On some platforms, X11_LIBRARIES derived by FindX11.cmake is going to be a
mixture of full pathnames for libraries and a series of -l flags which is
not a recommended form for CMake 2.6.x. To see this, look at the
FindX11.cmake logic for CMake-2.6.0-RC-8.
The preliminary version of X11_LIBRARIES is fullpath only since that is
derived using FIND_LIBRARY, but then more libraries are added to this list
as follows:
SET(X11_LIBRARIES ${X11_X_PRE_LIBS} ${X11_LIBRARIES} ${X11_X_EXTRA_LIBS})
X11_X_PRE_LIBS is also fullpath since it is the result of FIND_LIBRARY, but
X11_X_EXTRA_LIBS (empty on my Debian testing system) potentially has lots of
-l flags such as -lnsl_s -linet -ldnet, etc. if you follow the
X11_X_EXTRA_LIBS logic in FindX11.cmake.
Could somebody please change FindX11.cmake so that X11_X_EXTRA_LIBS is
always determined with FIND_LIBRARY? This would make it and X11_LIBRARIES
consistently fullpath on all platforms.
I think these -l forms of libraries just slipped through as some ancient
(autoconf?) boilerplate for X11_X_EXTRA_LIBS that has propagated to all
FindX11.cmake versions in contradiction to the recommendation that libraries
are supposed to be in fullpath form for 2.6.x.
Furthermore, making X11_LIBRARIES fullpath would benefit the PLplot build
(and presumably other builds as well). When first setting up the CMake-based
build system for PLplot, I either copied from our previous autotools-based
build system or I may have noticed the potential for -l flags in
X11_LIBRARIES. But in any case, I prepended X11_LIBRARIES with
"-L${X11_LIBRARY_DIR}" so that our users could have a non-standard install
location for X (especially important for this era of frantic X development
activity where some X testers may have multiple versions of X installed on
their platform). However, this -L flag leads to CMP0003 warnings for the
2.6.0 release candidate since fullpath libraries are preferred for 2.6.x.
(Also, X11_LIBRARY_DIR is an undocumented variable for FindX11.cmake which
I would prefer not to depend upon in the long term.)
Of course, there are workaround for CMP0003 warnings, but the clean solution
would be if a CMake developer would simply change FindX11.cmake in cmake cvs
and also for 2.6.0 so that X11_X_EXTRA_LIBS and therefore X11_LIBRARIES are
always consistently fullpath. That would allow me to stop prepending
"-L${X11_LIBRARY_DIR}" to X11_LIBRARIES which would eliminate the CMP0003
warnings without compromising the need of some who require a non-standard
install location for X.
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
__________________________
More information about the CMake
mailing list