QT_IMPORTS_DIR is not defined when no QML plugins are installed

Bug #894805 reported by Olivier Tilloy on 2011-11-25
This bug affects 2 people
Affects Status Importance Assigned to Milestone
cmake (Ubuntu)

Bug Description

When requiring the Qt4 package in a CMakeLists.txt, among the available variables the one called QT_IMPORTS_DIR should point to where QML plugins are to be installed (its value would typically be "/usr/lib/qt4/imports").

However with cmake 2.8.5-1ubuntu1 in Oneiric, its value is "QT_IMPORTS_DIR-NOTFOUND" as evidenced when running cmake on the following minimal CMakeLists.txt:

    cmake_minimum_required(VERSION 2.8)
    find_package(Qt4 REQUIRED)
    message("QT_IMPORTS_DIR = " ${QT_IMPORTS_DIR})

A quick look at /usr/share/cmake-2.8/Modules/FindQt4.cmake shows that the logic used to define the value of QT_IMPORTS_DIR queries qmake’s QT_INSTALL_IMPORTS variable.
On the same machine, the query returns the expected value:

    $ qmake -query QT_INSTALL_IMPORTS

So the logic to define QT_IMPORTS_DIR in /usr/share/cmake-2.8/Modules/FindQt4.cmake is somehow faulty.
I have tested the above both on x86 and amd64, with the same results.

ProblemType: Bug
DistroRelease: Ubuntu 11.10
Package: cmake 2.8.5-1ubuntu1
ProcVersionSignature: Ubuntu 3.0.0-13.22-generic 3.0.6
Uname: Linux 3.0.0-13-generic x86_64
NonfreeKernelModules: nvidia wl
ApportVersion: 1.23-0ubuntu4
Architecture: amd64
CheckboxSubmission: 2c7995ffdf051a6d0adf7ab2c7be5ba9
CheckboxSystem: 7e42599bda39ea7ff8b528272b6ef52b
Date: Fri Nov 25 16:31:59 2011
EcryptfsInUse: Yes
InstallationMedia: Ubuntu 11.10 "Oneiric Ocelot" - Release amd64 (20111012)
SourcePackage: cmake
UpgradeStatus: No upgrade log present (probably fresh install)

Olivier Tilloy (osomon) wrote :
Olivier Tilloy (osomon) wrote :

I have just tested in a precise (12.04) chroot, where the version of cmake currently is 2.8.6-0ubuntu1, and the same issue exists.

Olivier Tilloy (osomon) wrote :

It appears that FindQt4.cmake checks if the 'Qt' directory exists in '/usr/lib/qt4/imports/' path.
On Ubuntu this folder exists only if one of the following QML plugins is installed:
 - libqt4-declarative-folderlistmodel
 - libqt4-declarative-gestures
 - libqt4-declarative-particles
 - libqt4-declarative-shaders

(thanks to György Balló who pointed this out to me).

It seems incorrect to me to assume that at least one QML plugin should be installed for the destination path to be defined.

Olivier Tilloy (osomon) wrote :

A possible workaround is to query qmake directly:

    _qt4_query_qmake(QT_INSTALL_IMPORTS qt_imports_dir)

Olivier Tilloy (osomon) on 2011-11-29
summary: - QT_IMPORTS_DIR is not defined
+ QT_IMPORTS_DIR is not defined when no QML plugins are installed

Could you please take a look or reassign to desktop team as appropriate

Changed in cmake (Ubuntu):
assignee: nobody → Canonical Foundations Team (canonical-foundations)
Colin Watson (cjwatson) wrote :

<cjwatson> Riddell: can the Kubuntu team deal with bug 894805? It's more of a KDE thing than Foundations really; while I'm sure I could remove the requirement for 'Qt' to exist in /usr/lib/qt4/imports/, I don't know the system well enough to know whether that's the right thing to do
<Riddell> cjwatson: I addedd bug 894805 to my todo list, but I'm ill at the moment so don't know when I'll get to look at it

Changed in cmake (Ubuntu):
assignee: Canonical Foundations Team (canonical-foundations) → Jonathan Riddell (jr)
Changed in cmake (Ubuntu):
importance: Undecided → Medium
Changed in cmake (Ubuntu Oneiric):
importance: Undecided → Medium
assignee: nobody → Jonathan Riddell (jr)
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in cmake (Ubuntu Oneiric):
status: New → Confirmed
Changed in cmake (Ubuntu):
status: New → Confirmed
Nowaker (nowaker) wrote :

% qmake -query QT_INSTALL_IMPORTS

% ls /usr/lib/qt4/imports/
bamf dee gconf QConf Unity2d

% cmake .. -DCMAKE_INSTALL_PREFIX=/home/nowaker/opt/qtmpc/0.6.1/
CMake Error at CMakeLists.txt:193 (install):
  install FILES given no DESTINATION!

-- Configuring incomplete, errors occurred!

Jonathan Thomas (echidnaman) wrote :
Changed in cmake (Ubuntu Precise):
status: New → Fix Released
Changed in cmake (Ubuntu):
status: Confirmed → Fix Released
Jonathan Riddell (jr) on 2012-06-01
Changed in cmake (Ubuntu Oneiric):
assignee: Jonathan Riddell (jr) → nobody
Changed in cmake (Ubuntu):
assignee: Jonathan Riddell (jr) → nobody
Rolf Leggewie (r0lf) wrote :

oneiric has seen the end of its life and is no longer receiving any updates. Marking the oneiric task for this ticket as "Won't Fix".

Changed in cmake (Ubuntu Oneiric):
status: Confirmed → Won't Fix
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers