diff options
-rw-r--r-- | Modules/FindQt3.cmake | 24 | ||||
-rw-r--r-- | Tests/Wrapping/CMakeLists.txt | 2 |
2 files changed, 21 insertions, 5 deletions
diff --git a/Modules/FindQt3.cmake b/Modules/FindQt3.cmake index ba0a7c0..7d5b8d0 100644 --- a/Modules/FindQt3.cmake +++ b/Modules/FindQt3.cmake @@ -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 diff --git a/Tests/Wrapping/CMakeLists.txt b/Tests/Wrapping/CMakeLists.txt index 3b7684a..9197fc0 100644 --- a/Tests/Wrapping/CMakeLists.txt +++ b/Tests/Wrapping/CMakeLists.txt @@ -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} ) |