diff options
Diffstat (limited to 'modules/FindQt4.cmake')
-rw-r--r-- | modules/FindQt4.cmake | 46 |
1 files changed, 36 insertions, 10 deletions
diff --git a/modules/FindQt4.cmake b/modules/FindQt4.cmake index 55c44dfd..513b0cfe 100644 --- a/modules/FindQt4.cmake +++ b/modules/FindQt4.cmake @@ -85,6 +85,10 @@ # the list of sources. # To disable generating a namespace header, set the source file property # NO_NAMESPACE to TRUE on the interface file. +# To include a header in the interface header, set the source file property +# INCLUDE to the name of the header. +# To specify a class name to use, set the source file property CLASSNAME +# to the name of the class. # # macro QT4_ADD_DBUS_INTERFACES(outfiles inputfile ... ) # create the interface header and implementation files @@ -92,6 +96,10 @@ # the name will be automatically determined from the name of the xml file # To disable generating namespace headers, set the source file property # NO_NAMESPACE to TRUE for these inputfiles. +# To include a header in the interface header, set the source file property +# INCLUDE to the name of the header. +# To specify a class name to use, set the source file property CLASSNAME +# to the name of the class. # # macro QT4_ADD_DBUS_ADAPTOR(outfiles xmlfile parentheader parentclassname [basename] [classname]) # create a dbus adaptor (header and implementation file) from the xml file @@ -259,10 +267,24 @@ # Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. # See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. -if (QT4_QMAKE_FOUND) - # Check already done in this cmake run, nothing more to do -else (QT4_QMAKE_FOUND) +# If Qt3 has already been found, fail. +IF(QT_QT_LIBRARY) + IF(Qt4_FIND_REQUIRED) + MESSAGE( FATAL_ERROR "Qt3 and Qt4 cannot be used together in one project.") + ELSE(Qt4_FIND_REQUIRED) + IF(NOT Qt4_FIND_QUIETLY) + MESSAGE( STATUS "Qt3 and Qt4 cannot be used together in one project.") + ENDIF(NOT Qt4_FIND_QUIETLY) + RETURN() + ENDIF(Qt4_FIND_REQUIRED) +ENDIF(QT_QT_LIBRARY) + + +IF (QT4_QMAKE_FOUND) + # Check already done in this cmake run, nothing more to do + RETURN() +ENDIF (QT4_QMAKE_FOUND) # check that QT_NO_DEBUG is defined for release configurations MACRO(QT_CHECK_FLAG_EXISTS FLAG VAR DOC) @@ -501,9 +523,9 @@ IF (QT4_QMAKE_FOUND) ENDIF( QT_QTCORE_INCLUDE_DIR AND NOT QT_INCLUDE_DIR) IF( NOT QT_INCLUDE_DIR) - IF( NOT Qt4_FIND_QUIETLY AND Qt4_FIND_REQUIRED) + IF(Qt4_FIND_REQUIRED) MESSAGE( FATAL_ERROR "Could NOT find QtGlobal header") - ENDIF( NOT Qt4_FIND_QUIETLY AND Qt4_FIND_REQUIRED) + ENDIF(Qt4_FIND_REQUIRED) ENDIF( NOT QT_INCLUDE_DIR) ############################################# @@ -925,9 +947,9 @@ IF (QT4_QMAKE_FOUND) ENDIF (QT_USE_FRAMEWORKS) IF( NOT QT_QTCORE_LIBRARY ) - IF( NOT Qt4_FIND_QUIETLY AND Qt4_FIND_REQUIRED) + IF(Qt4_FIND_REQUIRED) MESSAGE( FATAL_ERROR "Could NOT find QtCore. Check ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log for more details.") - ENDIF( NOT Qt4_FIND_QUIETLY AND Qt4_FIND_REQUIRED) + ENDIF(Qt4_FIND_REQUIRED) ENDIF( NOT QT_QTCORE_LIBRARY ) # Set QT_QTASSISTANT_LIBRARY @@ -1254,6 +1276,11 @@ IF (QT4_QMAKE_FOUND) SET(_params -m) ENDIF ( _nonamespace ) + GET_SOURCE_FILE_PROPERTY(_classname ${_interface} CLASSNAME) + IF ( _classname ) + SET(_params ${_params} -c ${_classname}) + ENDIF ( _classname ) + GET_SOURCE_FILE_PROPERTY(_include ${_interface} INCLUDE) IF ( _include ) SET(_params ${_params} -i ${_include}) @@ -1449,7 +1476,7 @@ IF (QT4_QMAKE_FOUND) SET( QT_QT_LIBRARY "") ELSE(QT4_QMAKE_FOUND) - + SET(QT_QMAKE_EXECUTABLE "${QT_QMAKE_EXECUTABLE}-NOTFOUND" CACHE FILEPATH "Invalid qmake found" FORCE) IF(Qt4_FIND_REQUIRED) IF(QT4_INSTALLED_VERSION_TOO_OLD) @@ -1462,7 +1489,6 @@ ELSE(QT4_QMAKE_FOUND) MESSAGE(STATUS "The installed Qt version ${QTVERSION} is too old, at least version ${QT_MIN_VERSION} is required") ENDIF(QT4_INSTALLED_VERSION_TOO_OLD AND NOT Qt4_FIND_QUIETLY) ENDIF(Qt4_FIND_REQUIRED) - -ENDIF (QT4_QMAKE_FOUND) + ENDIF (QT4_QMAKE_FOUND) |