ENH: make sure findqt3 finds qt3 and not qt4

This commit is contained in:
Bill Hoffman 2006-11-22 13:30:59 -05:00
parent 445ff04528
commit 651fecee5b
2 changed files with 21 additions and 5 deletions

View File

@ -280,17 +280,33 @@ IF(QT_FOUND)
ENDIF(QT_QT_LIBRARY MATCHES "qt-mt")
ENDIF(QT_FOUND)
EXEC_PROGRAM(${QT_MOC_EXECUTABLE} ARGS "-v" OUTPUT_VARIABLE QTVERSION_MOC)
EXEC_PROGRAM(${QT_UIC_EXECUTABLE} ARGS "-version" OUTPUT_VARIABLE QTVERSION_UI)
SET(_QT_UIC_VERSION_3 FALSE)
IF("${QTVERSION_UIC}" MATCHES ".* 3..*")
SET(_QT_UIC_VERSION_3 TRUE)
ENDIF("${QTVERSION_UIC}" MATCHES ".* 3..*")
SET(_QT_MOC_VERSION_3 FALSE)
IF("${QTVERSION_MOC}" MATCHES ".* 3..*")
SET(_QT_MOC_VERSION_3 TRUE)
ENDIF("${QTVERSION_MOC}" MATCHES ".* 3..*")
SET(QT_WRAP_CPP FALSE)
IF (QT_MOC_EXECUTABLE)
SET ( QT_WRAP_CPP "YES")
IF(_QT_MOC_VERSION_3)
SET ( QT_WRAP_CPP TRUE)
ENDIF(_QT_MOC_VERSION_3)
ENDIF (QT_MOC_EXECUTABLE)
SET(QT_WRAP_UI FALSE)
IF (QT_UIC_EXECUTABLE)
SET ( QT_WRAP_UI "YES")
IF(_QT_UIC_VERSION_3)
SET ( QT_WRAP_UI TRUE)
ENDIF(_QT_UIC_VERSION_3)
ENDIF (QT_UIC_EXECUTABLE)
MARK_AS_ADVANCED(
QT_INCLUDE_DIR
QT_QT_LIBRARY

View File

@ -105,7 +105,7 @@ SET (QT_MOC_EXE "echo")
INCLUDE( FindQt3 )
IF (QT_FOUND AND QT_UIC_EXECUTABLE)
message("found qt 3 test it...")
INCLUDE_DIRECTORIES( ${QT_INCLUDE_DIR} )
INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_BINARY_DIR} )