MantisBT - CMake
View Issue Details
0011791CMakeModulespublic2011-02-03 05:042011-06-06 18:25
Rolf Eike Beer 
Clinton Stimpson 
normalblockalways
closedfixed 
 
 
0011791: Regression in next: FIND_PACKAGE(Qt4 COMPONENTS QtMain) gives errors
The component QtMain is needed to get working Qt applications on Windows. In current snapshots this doesn't work anymore.
CMakeLists.txt

PROJECT(qtmain)
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
FIND_PACKAGE(Qt4 4.5.3 COMPONENTS QtCore QtGui QtMain)
INCLUDE(${QT_USE_FILE})
ADD_EXECUTABLE(qtmain WIN32 qtmain.cpp)
TARGET_LINK_LIBRARIES(qtmain ${QT_LIBRARIES})

qmain.cpp

#include <QApplication>
#include <QMainWindow>

int main(int argc, char* argv[])
{
    QApplication app(argc, argv);
    QMainWindow mainWin;
    mainWin.show();
    return app.exec();
}
Test runs of the example:

Win32 / CMake 2.8.3:
-- Found Qt-Version 4.6.2 (using
c:/data/software/qt/qt-4.6.2-vs2008-x64/bin/qmake.exe)

Win32 / CMake 2.8.3.20110202-g4d4d5:
-- Could NOT find Qt4 (missing: QT_QTMAIN_INCLUDE_DIR) (found suitable
version "4.6.2", required is "4.5.3")

Linux / CMake 2.8.3:
-- Found Qt-Version 4.5.4 (using /usr/bin/qmake)

Linux / CMake 2.8.3.20110202-g4d4d5:
-- Could NOT find Qt4 (missing: QT_QTMAIN_INCLUDE_DIR
QT_QTMAIN_LIBRARY) (found suitable version "4.5.4", required is "4.5.3")
No tags attached.
Issue History
2011-02-03 05:04Rolf Eike BeerNew Issue
2011-02-03 08:10Brad KingAssigned To => Clinton Stimpson
2011-02-03 08:10Brad KingStatusnew => assigned
2011-02-03 08:10Brad KingTarget Version => CMake 2.8.4
2011-02-03 08:13Brad KingNote Added: 0025231
2011-02-03 11:12Rolf Eike BeerNote Added: 0025235
2011-02-03 13:46Brad KingProduct VersionCMake-2-8 =>
2011-02-03 13:46Brad KingTarget VersionCMake 2.8.4 =>
2011-02-03 13:46Brad KingSummaryRegression in 2.8.4-rc: FIND_PACKAGE(Qt4 COMPONENTS QtMain) gives errors => Regression in next: FIND_PACKAGE(Qt4 COMPONENTS QtMain) gives errors
2011-02-03 13:46Brad KingNote Added: 0025246
2011-02-03 18:38Clinton StimpsonNote Added: 0025262
2011-02-03 18:38Clinton StimpsonStatusassigned => resolved
2011-02-03 18:38Clinton StimpsonResolutionopen => fixed
2011-06-06 18:25David ColeStatusresolved => closed
2011-06-06 18:25David ColeNote Added: 0026693

Notes
(0025231)
Brad King   
2011-02-03 08:13   
Version 2.8.3.20110202-g4d4d5 is a nightly build from the 'next' branch at commit 4d4d51e1. It contains changes to FindQt4 that are *not* in the 2.8.4-rc series.

Does this happen with the actual 2.8.4 release candidate from http://www.cmake.org/files/v2.8/ [^] ?
(0025235)
Rolf Eike Beer   
2011-02-03 11:12   
Yes, you are right. 2.8.4-rc2 is fine.

Sorry for the noise. I promise I'll check which version exactly the coworkers are using next time before filing a bug report. ;)

Any chance I can edit the bug headline?
(0025246)
Brad King   
2011-02-03 13:46   
0011791:0025235: Thanks for testing 2.8.4-rc2. I updated the bug headline.
(0025262)
Clinton Stimpson   
2011-02-03 18:38   
Fix in git now:
Merge topic 'qt4-fphsa' into next
72e9d3c When checking find_package() components, special case qtmain.

Thanks for testing.
(0026693)
David Cole   
2011-06-06 18:25   
Closing resolved issues that have not been updated in more than 3 months.