SET(DESIRED_QT_VERSION0CACHESTRING"Pick a version of QT to use: 3 or 4")
ELSE(QT3_INSTALLEDANDQT4_INSTALLED)
# if only one found then pick that one
IF(QT3_INSTALLED)
SET(DESIRED_QT_VERSION3CACHESTRING"Pick a version of QT to use: 3 or 4")
ENDIF(QT3_INSTALLED)
IF(QT4_INSTALLED)
SET(DESIRED_QT_VERSION4CACHESTRING"Pick a version of QT to use: 3 or 4")
ENDIF(QT4_INSTALLED)
ENDIF(QT3_INSTALLEDANDQT4_INSTALLED)
IF(DESIRED_QT_VERSIONMATCHES3)
SET(Qt3_FIND_REQUIRED${Qt_FIND_REQUIRED})
SET(Qt3_FIND_QUIETLY${Qt_FIND_QUIETLY})
INCLUDE(FindQt3)
ENDIF(DESIRED_QT_VERSIONMATCHES3)
IF(DESIRED_QT_VERSIONMATCHES4)
SET(Qt4_FIND_REQUIRED${Qt_FIND_REQUIRED})
SET(Qt4_FIND_QUIETLY${Qt_FIND_QUIETLY})
INCLUDE(FindQt4)
ENDIF(DESIRED_QT_VERSIONMATCHES4)
IF(NOTQT3_INSTALLEDANDNOTQT4_INSTALLED)
IF(QT_REQUIRED)
MESSAGE(SEND_ERROR"CMake was unable to find any QT versions, put qmake in your path, or set QT_QMAKE_EXECUTABLE.")
ENDIF(QT_REQUIRED)
ELSE(NOTQT3_INSTALLEDANDNOTQT4_INSTALLED)
IF(NOTQT_FOUNDANDNOTDESIRED_QT_VERSION)
IF(QT_REQUIRED)
MESSAGE(SEND_ERROR"Multiple versions of QT found please set DESIRED_QT_VERSION")
ELSE(QT_REQUIRED)
MESSAGE("Multiple versions of QT found please set DESIRED_QT_VERSION")
ENDIF(QT_REQUIRED)
ENDIF(NOTQT_FOUNDANDNOTDESIRED_QT_VERSION)
IF(NOTQT_FOUNDANDDESIRED_QT_VERSION)
IF(QT_REQUIRED)
MESSAGE(FATAL_ERROR"CMake was unable to find QT version: ${DESIRED_QT_VERSION}. Set advanced values QT_QMAKE_EXECUTABLE and QT${DESIRED_QT_VERSION}_QGLOBAL_FILE, if those are set then QT_QT_LIBRARY or QT_LIBRARY_DIR.")
ELSE(QT_REQUIRED)
MESSAGE("CMake was unable to find desired QT version: ${DESIRED_QT_VERSION}. Set advanced values QT_QMAKE_EXECUTABLE and QT${DESIRED_QT_VERSION}_QGLOBAL_FILE.")