[CMake] --find-package option fails with some of the Qt5 components

Alan W. Irwin irwin at beluga.phys.uvic.ca
Wed Apr 23 13:42:03 EDT 2014


On 2014-04-23 14:30+0200 Stephen Kelly wrote:

> Alan W. Irwin wrote:
>
>> Hi Steve:
>>
>> PLplot not only CMake exports its libraries but also provides library
>> information in pkg-config form for our users that prefer that form.
>> Therefore, for this component of our install I need to collect
>> explicit compile and link flags for Qt5, and it appears to me the best
>> way to do that is to run cmake with the --find-package option.
>
> The cmake --find-package feature is Alex Neundorf's department. I don't
> really know anything about it.

I have just discovered a simple fix for the problem

___________
--- Qt5GuiConfigExtras.cmake_orig       2014-04-23 10:03:52.240610724 -0700
+++ Qt5GuiConfigExtras.cmake    2014-04-23 10:08:11.187945950 -0700
@@ -47,7 +47,7 @@



-_qt5gui_find_extra_libs(OPENGL "GL" "" "")
+_qt5gui_find_extra_libs(OPENGL "Qt5OpenGL" "" "")



___________

After that change to the installed version of Qt5-5.2.1 then I get the
following good find-package result with either CMake-2.8.12.2 or
CMake-3.0.0-rc3:

wine at raven> ~software/cmake/install-3.0.0-rc3/bin/cmake --find-package \
-DNAME:STRING='Qt5Svg' -DCOMPILER_ID:STRING=GNU -DLANGUAGE:STRING=CXX \
-DMODE:STRING=COMPILE
-I/home/wine/newstart/build_script/install-linux/include/
-I/home/wine/newstart/build_script/install-linux/include/QtSvg
-I/home/wine/newstart/build_script/install-linux/include/QtWidgets
-I/home/wine/newstart/build_script/install-linux/include/QtGui
-I/home/wine/newstart/build_script/install-linux/include/QtCore
-I/home/wine/newstart/build_script/install-linux//mkspecs/linux-g++

and similarly for Qt5Gui and Qt5PrintSupport and also for the LINK and
EXIST modes.

Steve, I get the impression you have participated in the development
of at least the CMake aspects of Qt5.  The above Qt5 patch responds to
the fundamental issue that CMake cannot find a library named libGL by
substituting a search for libQt5OpenGL instead which exists in my present
Qt5 installation.  However, I am not sure that is the correct fix so I
would appreciate your review of the above patch and making sure the
correct fix gets into Qt5.

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); the Time
Ephemerides project (timeephem.sf.net); PLplot scientific plotting
software package (plplot.sf.net); 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