MantisBT - CMake
View Issue Details
0012147CMakeModulespublic2011-05-03 04:572011-10-03 09:54
Bernhard Rosenkraenzer 
Clinton Stimpson 
normalminoralways
closedfixed 
anyany
CMake 2.8.4 
 
0012147: Absence of uic makes Qt4 detection fail
FindQt4.cmake, line 1091+, does


  IF( QT_LIBRARY_DIR AND QT_INCLUDE_DIR AND QT_MOC_EXECUTABLE AND
      QT_UIC_EXECUTABLE AND QT_RCC_EXECUTABLE AND QT_QTCORE_LIBRARY)
    SET( QT4_FOUND "YES" )
    INCLUDE(FindPackageMessage)
    FIND_PACKAGE_MESSAGE(Qt4 "Found Qt-Version ${QTVERSION} (using ${QT_QMAKE_EXECUTABLE})"
      "[${QT_LIBRARY_DIR}][${QT_INCLUDE_DIR}][${QT_MOC_EXECUTABLE}][${QT_UIC_EXECUTABLE}][${QT_RCC_EXECUTABLE}]")
  ELSE( QT_LIBRARY_DIR AND QT_INCLUDE_DIR AND QT_MOC_EXECUTABLE AND
        QT_UIC_EXECUTABLE AND QT_RCC_EXECUTABLE AND QT_QTCORE_LIBRARY)
    SET( QT4_FOUND "NO")
    SET(QT_QMAKE_EXECUTABLE "${QT_QMAKE_EXECUTABLE}-NOTFOUND" CACHE FILEPATH "Invalid qmake found" FORCE)
    IF( Qt4_FIND_REQUIRED)
      MESSAGE( FATAL_ERROR "Qt libraries, includes, moc, uic or/and rcc NOT found!")
    ENDIF( Qt4_FIND_REQUIRED)
  ENDIF( QT_LIBRARY_DIR AND QT_INCLUDE_DIR AND QT_MOC_EXECUTABLE AND




I think QT_UIC_EXECUTABLE should be removed because UIC is hardly essential (you need it only if you use Qt Designer), and it isn't built if Qt is built with the "-no-gui" configure switch (useful e.g. for headless servers where you still want to use tools that use QtCore, QtXml, QtNetwork and/or QtSql).



I'd argue that a missing uic shouldn't make Qt detection fail at all because there's also plenty of Qt GUI code that doesn't use uic - but it definitely shouldn't fail if QT_DONT_USE_QTGUI is set.
1. Install Qt with -no-gui
2. Try to compile anything that uses FindQt4.cmake to locate QtCore/QtXml/QtNetwork/QtSql
No tags attached.
Issue History
2011-05-03 04:57Bernhard RosenkraenzerNew Issue
2011-05-03 10:34Clinton StimpsonNote Added: 0026424
2011-05-03 10:34Clinton StimpsonStatusnew => resolved
2011-05-03 10:34Clinton StimpsonResolutionopen => fixed
2011-05-03 10:34Clinton StimpsonAssigned To => Clinton Stimpson
2011-10-03 09:54David ColeNote Added: 0027503
2011-10-03 09:54David ColeStatusresolved => closed

Notes
(0026424)
Clinton Stimpson   
2011-05-03 10:34   
This was already fixed not long ago.
And that part of the script doesn't look like that anymore.
(0027503)
David Cole   
2011-10-03 09:54   
Closing resolved issues that have not been updated in more than 4 months.