[CMake] FindQt3.cmake bug - does not recognize uic

Anka Kochanowska anka at bic.mni.mcgill.ca
Tue Nov 27 10:21:38 EST 2007


Hi!
I am using Qt3 (3.3.3)
In my CMakeList.txt I have conditionals:

IF(QT_WRAP_UI)
  QT_WRAP_UI( Basic IGNS_BASIC_HDR IGNS_BASIC_SRC ${IGNS_BASIC_GUI_SRC} )
ENDIF(QT_WRAP_UI)

This used to work still in CMake 2.4 patch 3. Since themn, the 
FindQt3.cmake  has been changed and it does not
recognize uic.


There is a problem with the following code:

EXEC_PROGRAM(${QT_UIC_EXECUTABLE} ARGS "-version" OUTPUT_VARIABLE 
QTVERSION_UI)

in my case  QTVERSION_UI  is:    User Interface Compiler for Qt version 
3.3.3

The following test:
SET(_QT_UIC_VERSION_3 FALSE)
IF("${QTVERSION_UIC}" MATCHES ".* 3..*")
  SET(_QT_UIC_VERSION_3 TRUE)
ENDIF("${QTVERSION_UIC}" MATCHES ".* 3..*")

sets QT_UIC_VERSION_3 to FALSE

which causes the
SET(QT_WRAP_UI FALSE)
IF (QT_UIC_EXECUTABLE)  
  IF(_QT_UIC_VERSION_3)
    SET ( QT_WRAP_UI TRUE)
  ENDIF(_QT_UIC_VERSION_3)
ENDIF (QT_UIC_EXECUTABLE)  

returning QT_WRAP_UI as FALSE

I do not know how to set the regex in order to find 3 in  the version 
return by uic. I tried differnt things and miserably failed.

Could anyone help, please?

I have seen quite few postings about QT_WRAP_UI failure and the 
suggestions were either to drop the condition or to manually run uic!!!!

Thanks!
Anka



More information about the CMake mailing list