-better support for Qt4 as frameworks

before this patch -F<framework> dir had to be added manually in some way
when using Qt4 installed as framework and when using FindQt4.cmake directly,
i.e. without UseQt4.cmake. With this patch the framework dir is
automatically added to QT_INCLUDE_DIR when Qt is installed as a framework.

Ok by Clinton, tested already in KDE by Mike Arthur.

Alex
This commit is contained in:
Alexander Neundorf 2009-12-16 17:16:59 -05:00
parent 9add940eb6
commit eb83c19789
2 changed files with 10 additions and 4 deletions

View File

@ -907,6 +907,15 @@ IF (QT4_QMAKE_FOUND)
_QT4_ADJUST_LIB_VARS(QAXCONTAINER)
ENDIF(WIN32)
# If Qt is installed as a framework, we need to add QT_QTCORE_LIBRARY here (which
# is the framework directory in that case), since this will make the cmake include_directories()
# command recognize that we need the framework flag with the respective directory (-F)
IF(QT_USE_FRAMEWORKS)
SET(QT_INCLUDES ${QT_INCLUDES} ${QT_QTCORE_LIBRARY} )
SET(QT_INCLUDE_DIR ${QT_INCLUDE_DIR} ${QT_QTCORE_LIBRARY} )
ENDIF(QT_USE_FRAMEWORKS)
#######################################
#

View File

@ -23,9 +23,6 @@ SET_PROPERTY(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_RELWITHDEBINFO QT_NO_
SET_PROPERTY(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_MINSIZEREL QT_NO_DEBUG)
INCLUDE_DIRECTORIES(${QT_INCLUDE_DIR})
IF(Q_WS_MAC AND QT_USE_FRAMEWORKS)
INCLUDE_DIRECTORIES(${QT_QTCORE_LIBRARY})
ENDIF(Q_WS_MAC AND QT_USE_FRAMEWORKS)
SET(QT_LIBRARIES "")