View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0001524CMakepublic2005-01-23 09:312005-07-15 12:23
ReporterSimon Warfield 
Assigned ToBrad King 
PriorityurgentSeverityfeatureReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0001524: FindQT doesn't know about Qt 4
DescriptionA significant change between Qt 3 and Qt 4 is that Qt 4 consists of a collection of libraries.

The CMAKE script to discover Qt does not know to look for the collection of libraries that constitute Qt 4. These include:

libQt3Compat.so libQtGui.so libQtOpenGL_debug.so
libQt3Compat_debug.so libQtGui_debug.so libQtSql.so
libQtCore.so libQtNetwork.so libQtSql_debug.so
libQtCore_debug.so libQtNetwork_debug.so libQtXml.so
libQtDesigner_debug.so libQtOpenGL.so libQtXml_debug.so
TagsNo tags attached.
Attached Filesgz file icon NewFindQt.tar.gz [^] (7,675 bytes) 1969-12-31 19:00
gz file icon qtinfo.tar.gz [^] (1,514 bytes) 1969-12-31 19:00
gz file icon FindQt.tar.gz [^] (5,998 bytes) 1969-12-31 19:00
gz file icon FindQtX.cmake.tar.gz [^] (9,369 bytes) 1969-12-31 19:00

 Relationships

  Notes
(0002290)
Bill Hoffman (manager)
2005-04-05 14:59

I do not have QT 4 here, could if you send me diffs for the FindQT.cmake I will put them in cmake.
(0002444)
Clinton Stimpson (developer)
2005-05-24 16:13

I've attached a new FindQt.cmake, FindQt4.cmake, FindQt3.cmake taken from others and modified slightly and tested a bit.
(0002445)
Clinton Stimpson (developer)
2005-05-24 16:18

Oh, I wanted to add a couple things...

The new FindQt4.cmake provides macros for 'uic', 'moc' and the new Qt4 resource compiler 'rcc'.

One potential problem is that now all ui file conversions only generate header files in Qt4. Since CMake seems to not recognize generated header files as dependencies for some source files, it is going to be harder to make the project build, unless the developer explicitly adds all those dependencies in the CMakeLists.txt file. In Qt3, uic generated source files and those source files were added with the ADD_EXECUTABLE command, so dependencies weren't a problem. Or am I missing something about CMake?
(0002574)
Brad King (manager)
2005-06-30 11:17

I'm assigning this bug to myself.

I just tried out the new modules and there are a few changes that need to be made before they can be integrated into CMake.

1.) The line

FILE(READ ${QT_QGLOBAL_H_FILE} QT_QGLOBAL_H)

should be

IF(QT_QGLOBAL_H_FILE)
        FILE(READ "${QT_QGLOBAL_H_FILE}" QT_QGLOBAL_H)
ENDIF(QT_QGLOBAL_H_FILE)

so that it works when Qt is not found.

2.) When Qt is not found the module should not exit with a FATAL_ERROR. It can report failure with a normal message but it should return with QT_FOUND set to 0.

3.) Anyone that pre-loads the Qt settings into the cache (with -C or -D) should not have anything more to do with the new version (at least if using Qt3). An example of implementing this is that if QT_INCLUDE_DIR is set then FindQt.cmake should use it when looking for qglobal.h.

I may have more comments later but lets start with these. Thanks.
(0002617)
Jens Goebbert (reporter)
2005-07-12 08:57

Qt4 does not need $QTDIR anymore (they changed it in the final 4.0.0)
Now the attached FindQt.cmake in NewFindQt.tar.gz will not find Qt4 because of:

# Qt4-like search paths
FIND_FILE( QT4_QGLOBAL_H_FILE qglobal.h
    $ENV{QTDIR}/include/Qt
    /usr/local/qt/include/Qt
    /usr/local/include/Qt
    /usr/lib/qt/include/Qt
    /usr/include/Qt
    /usr/share/qt4/include/Qt
    C:/Progra~1/qt/include/Qt )

The Qt-version could be found with "moc -v", but then we still do not know the include- and lib-paths
(0002620)
Jens Goebbert (reporter)
2005-07-12 13:12

I attached qtinfo.tar.gz
Its a small terminal program which shows all path and version information about the installed Qt4 (and greater).

cmake would have to try to compile it using "qmake" (the makefile-generator of Qt) if a project searches for Qt.

(0002626)
Jens Goebbert (reporter)
2005-07-13 05:06

qmake (of Qt4) returns path information using the -query option:

"qmake -query QT_INSTALL_LIBS" returns the path to the libraries

(more infos with QT_INSTALL_PREFIX, QT_INSTALL_DATA, QT_INSTALL_DOCS, QT_INSTALL_HEADERS, QT_INSTALL_LIBS, QT_INSTALL_BINS, QT_INSTALL_PLUGINS, QT_INSTALL_TRANSLATIONS, QT_INSTALL_CONFIGURATION, QT_INSTALL_EXAMPLES, QT_INSTALL_DEMOS, QMAKE_MKSPECS, QMAKE_VERSION)

FindQt.cmake can use this to search for qglobal.h:

EXEC_PROGRAM( qmake
        ARGS "-query QT_INSTALL_HEADERS"
        OUTPUT_VARIABLE qt_headers )
# Qt4-like search paths
FIND_FILE( QT4_QGLOBAL_H_FILE qglobal.h
    ${qt_headers}/Qt
    $ENV{QTDIR}/include/Qt
    /usr/local/qt/include/Qt
    /usr/local/include/Qt
    /usr/lib/qt/include/Qt
    /usr/include/Qt
    /usr/share/qt4/include/Qt
    C:/Progra~1/qt/include/Qt )

FindQt4.cmake should use it,too.
(0002627)
Jens Goebbert (reporter)
2005-07-13 05:42

attached a new FindQt-package (FindQt.tar.gz)

modification in FindQt4.cmake
a) makes use of "qmake -query" to find paths of Qt4
b) adds QT_RCC_EXECUTABLE

modification in FindQt.cmake
c) sends a SEND_ERROR message instead of an FATAL_ERROR if qglobal.h was not found
d) makes sure qglobal.h got found before reading it
(0002654)
Brad King (manager)
2005-07-14 10:21

I just took another look at this. There are still several changes that need to be made before we can accept it:

1.) Some projects may look for Qt just to see if it is there. It is up to the individual projects to report an error if they require Qt and cannot find it. To support these projects, the FindQt script should only report errors if Qt_FIND_REQUIRED is set. The FIND_PACKAGE command sets this variable when called like this:

FIND_PACKAGE(Qt REQUIRED)

Also if it is called like this

FIND_PACKAGE(Qt QUIET)

then Qt_FIND_QUIETLY is set and the script should not report anything, even status messages.

2.) When Qt has been found there should be no overhead. The find script should test the variables it is trying to set. If they are already set nothing should be done. For example, there is no need to run EXEC_PROGRAM for qmake if Qt is already found.

Both of these fixes can be done by arranging the script to do most of the work inside IF blocks that are only executed if the part of Qt they find has not been found and all the earlier parts they need have been found.
(0002676)
Jens Goebbert (reporter)
2005-07-15 07:23

I updated FindQt.cmake and FindQt4.cmake. Now it hopefully has the requirement to get added to CVS. It works fine for me. Download FindQtX.cmake.tar.gz and read the README for more information.
It should have all features which were talked about on this website.
(0002680)
Bill Hoffman (manager)
2005-07-15 12:23

I just checked in the files to cvs.

 Issue History
Date Modified Username Field Change


Copyright © 2000 - 2018 MantisBT Team