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

Alan W. Irwin irwin at beluga.phys.uvic.ca
Wed Apr 23 02:40:47 EDT 2014


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.
However, some Qt5 components work and others do not.  For example:

wine at raven> cmake --find-package -DNAME:STRING=Qt5Core \
-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/QtCore
-I/home/wine/newstart/build_script/install-linux//mkspecs/linux-g++

but

wine at raven> cmake --find-package -DNAME:STRING=Qt5Svg \
-DCOMPILER_ID:STRING=GNU -DLANGUAGE:STRING=CXX -DMODE:STRING=COMPILE
CMake Error at /home/wine/newstart/build_script/install-linux/lib/cmake/Qt5Gui/Qt5GuiConfigExtras.cmake:16 (message):
   Failed to find "GL" in "" with CMAKE_CXX_LIBRARY_ARCHITECTURE "".
Call Stack (most recent call first):
   /home/wine/newstart/build_script/install-linux/lib/cmake/Qt5Gui/Qt5GuiConfigExtras.cmake:50 (_qt5gui_find_extra_libs)
   /home/wine/newstart/build_script/install-linux/lib/cmake/Qt5Gui/Qt5GuiConfig.cmake:141 (include)
   /home/wine/newstart/build_script/install-linux/lib/cmake/Qt5Widgets/Qt5WidgetsConfig.cmake:86 (find_package)
   /home/wine/newstart/build_script/install-linux/lib/cmake/Qt5Svg/Qt5SvgConfig.cmake:86 (find_package)
   /home/wine/newstart/build_script/install-linux_buildtools/share/cmake-2.8/Modules/CMakeFindPackageMode.cmake:169 (find_package)


Qt5Svg not found.
CMake Error: Problem processing arguments. Aborting.

This GL-related issue is for a version of Qt5-5.2.1 that I configured,
built, and installed myself. Everything PLplot related (including use
of the Qt5Svg component) works fine with this version other than the
above test.  Is there something special I have to do with the
configuration of that build to include GL?  If so, here is the relevant
configuration information for that Qt5 build:

Build options:
   Configuration .......... accessibility alsa audio-backend avx avx2 c++11 clock-gettime clock-monotonic compile_examples concurrent evdev e
ventfd fontconfig full-config getaddrinfo getifaddrs inotify ipv6ifname large-config largefile linuxfb medium-config minimal-config mremap n
o-gif no-harfbuzz opengl pcre png posix_fallocate precompile_header qpa qpa reduce_exports reduce_relocations release rpath shared small-con
fig sse2 sse3 sse4_1 sse4_2 ssse3 system-freetype xcb xcb-qt xcb-sm xkbcommon-qt xlib xrender zlib
   Build parts ............ libs
   Mode ................... release
   Using C++11 ............ yes
   Using PCH .............. yes
   Target compiler supports:
     SSE2/SSE3/SSSE3 ...... yes/yes/yes
     SSE4.1/SSE4.2 ........ yes/yes
     AVX/AVX2 ............. yes/yes

Qt modules and options:
   Qt D-Bus ............... no
   Qt Concurrent .......... yes
   Qt GUI ................. yes
   Qt Widgets ............. yes
   JavaScriptCore JIT ..... no
   QML debugging .......... no
   Use system proxies ..... no

Support enabled for:
   Accessibility .......... yes
   ALSA ................... yes
   CUPS ................... no
   FontConfig ............. yes
   FreeType ............... system
   Iconv .................. no
   ICU .................... no
   Image formats:
     GIF .................. no
     JPEG ................. yes (plugin, using bundled copy)
     PNG .................. yes (in QtGui, using bundled copy)
   Glib ................... no
   GTK theme .............. no
   Large File ............. yes
   mtdev .................. no
   Networking:
     getaddrinfo .......... yes
     getifaddrs ........... yes
     IPv6 ifname .......... yes
     OpenSSL .............. no
   NIS .................... no
   OpenGL ................. desktop
   OpenVG ................. no
   PCRE ................... yes (bundled copy)
   pkg-config ............. yes
   PulseAudio ............. no
   QPA backends:
     DirectFB ............. no
     EGLFS ................ no
     KMS .................. no
     LinuxFB .............. yes
     XCB .................. yes (bundled copy)
       MIT-SHM ............ yes
       Xcb-Xlib ........... no
       Xcursor ............ yes (loaded at runtime)
       Xfixes ............. yes (loaded at runtime)
       Xi ................. yes (loaded at runtime)
       Xi2 ................ no
       Xinerama ........... yes (loaded at runtime)
       Xrandr ............. yes (loaded at runtime)
       Xrender ............ yes
       XKB ................ yes
       XShape ............. yes
       XSync .............. yes
       XVideo ............. yes
   Session management ..... yes
   SQL drivers:
     DB2 .................. no
     InterBase ............ no
     MySQL ................ no
     OCI .................. no
     ODBC ................. no
     PostgreSQL ........... no
     SQLite 2 ............. no
     SQLite ............... no
     TDS .................. no
   udev ................... no
   xkbcommon .............. yes (bundled copy)
   zlib ................... yes (bundled copy)

Note that OpenGL seems to be enabled (via the desktop, whatever that
means).  If you see nothing problematic here with respect to GL
another alternative is this GL-related issue with the cmake
--find-package option might be due to a bug in some of the Qt5 package
config files (in which case you should be able to confirm the above
error message with your own Qt5 installation).

As always, any help you could give me to help sort out this issue I
have discovered with CMake and Qt5 would be much appreciated.

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