summaryrefslogtreecommitdiffstats
path: root/Modules/FindQt4.cmake
diff options
context:
space:
mode:
authorClinton Stimpson <clinton@elemtech.com>2008-03-13 19:29:28 (GMT)
committerClinton Stimpson <clinton@elemtech.com>2008-03-13 19:29:28 (GMT)
commit7634b36364d94ccce5575e6a67c3c8cd92750b44 (patch)
treeb91b674726becfbef7113017b30a0e9f2f29b2b8 /Modules/FindQt4.cmake
parent3e997c9fc8f0adc861906c7812425ab84b5d2164 (diff)
downloadCMake-7634b36364d94ccce5575e6a67c3c8cd92750b44.zip
CMake-7634b36364d94ccce5575e6a67c3c8cd92750b44.tar.gz
CMake-7634b36364d94ccce5575e6a67c3c8cd92750b44.tar.bz2
ENH: Add support for new modules in Qt 4.4. Fixes #6316.
Simplify and clarify some documentation. BUG: Fix order of include paths (from KDE's FindQt4) Fix find of Designer components debug library on Windows.
Diffstat (limited to 'Modules/FindQt4.cmake')
-rw-r--r--Modules/FindQt4.cmake223
1 files changed, 117 insertions, 106 deletions
diff --git a/Modules/FindQt4.cmake b/Modules/FindQt4.cmake
index 64bf8f8..9772091 100644
--- a/Modules/FindQt4.cmake
+++ b/Modules/FindQt4.cmake
@@ -24,9 +24,14 @@
# QT_USE_QTUITOOLS
# QT_USE_QTDBUS
# QT_USE_QTSCRIPT
+# QT_USE_QTASSISTANTCLIENT
+# QT_USE_QTHELP
+# QT_USE_QTWEBKIT
+# QT_USE_QTXMLPATTERNS
#
# All the libraries required are stored in a variable called QT_LIBRARIES.
-# Add this variable to your TARGET_LINK_LIBRARIES.
+# Add this variable to your TARGET_LINK_LIBRARIES. Inlcudes and definitions
+# needed for compiling Qt code is already set up by including the QT_USE_FILE.
#
# macro QT4_WRAP_CPP(outfiles inputfile ... OPTIONS ...)
# create moc code from a list of files containing Qt class with
@@ -92,25 +97,29 @@
# QT_FOUND If false, don't try to use Qt.
# QT4_FOUND If false, don't try to use Qt 4.
#
-# QT_EDITION Set to the edition of Qt (i.e. DesktopLight)
-# QT_EDITION_DESKTOPLIGHT True if QT_EDITION == DesktopLight
-# QT_QTCORE_FOUND True if QtCore was found.
-# QT_QTGUI_FOUND True if QtGui was found.
-# QT_QT3SUPPORT_FOUND True if Qt3Support was found.
-# QT_QTASSISTANT_FOUND True if QtAssistant was found.
-# QT_QTDBUS_FOUND True if QtDBus was found.
-# QT_QTDESIGNER_FOUND True if QtDesigner was found.
-# QT_QTDESIGNERCOMPONENTS True if QtDesignerComponents was found.
-# QT_QTMOTIF_FOUND True if QtMotif was found.
-# QT_QTNETWORK_FOUND True if QtNetwork was found.
-# QT_QTNSPLUGIN_FOUND True if QtNsPlugin was found.
-# QT_QTOPENGL_FOUND True if QtOpenGL was found.
-# QT_QTSQL_FOUND True if QtSql was found.
-# QT_QTXML_FOUND True if QtXml was found.
-# QT_QTSVG_FOUND True if QtSvg was found.
-# QT_QTSCRIPT_FOUND True if QtScript was found.
-# QT_QTTEST_FOUND True if QtTest was found.
-# QT_QTUITOOLS_FOUND True if QtUiTools was found.
+# QT_EDITION Set to the edition of Qt (i.e. DesktopLight)
+# QT_EDITION_DESKTOPLIGHT True if QT_EDITION == DesktopLight
+# QT_QTCORE_FOUND True if QtCore was found.
+# QT_QTGUI_FOUND True if QtGui was found.
+# QT_QT3SUPPORT_FOUND True if Qt3Support was found.
+# QT_QTASSISTANT_FOUND True if QtAssistant was found.
+# QT_QTDBUS_FOUND True if QtDBus was found.
+# QT_QTDESIGNER_FOUND True if QtDesigner was found.
+# QT_QTDESIGNERCOMPONENTS True if QtDesignerComponents was found.
+# QT_QTMOTIF_FOUND True if QtMotif was found.
+# QT_QTNETWORK_FOUND True if QtNetwork was found.
+# QT_QTNSPLUGIN_FOUND True if QtNsPlugin was found.
+# QT_QTOPENGL_FOUND True if QtOpenGL was found.
+# QT_QTSQL_FOUND True if QtSql was found.
+# QT_QTXML_FOUND True if QtXml was found.
+# QT_QTSVG_FOUND True if QtSvg was found.
+# QT_QTSCRIPT_FOUND True if QtScript was found.
+# QT_QTTEST_FOUND True if QtTest was found.
+# QT_QTUITOOLS_FOUND True if QtUiTools was found.
+# QT_QTASSISTANTCLIENT_FOUND True if QtAssistantClient was found.
+# QT_QTHELP_FOUND True if QtHelp was found.
+# QT_QTWEBKIT_FOUND True if QtWebKit was found.
+# QT_QTXMLPATTERNS_FOUND True if QtXmlPatterns was found.
#
# QT_DEFINITIONS Definitions to use when compiling code that uses Qt.
#
@@ -138,88 +147,41 @@
# QT_QTSVG_INCLUDE_DIR Path to "include/QtSvg"
# QT_QTSCRIPT_INCLUDE_DIR Path to "include/QtScript"
# QT_QTTEST_INCLUDE_DIR Path to "include/QtTest"
+# QT_QTASSISTANTCLIENT_INCLUDE_DIR Path to "include/QtAssistant"
+# QT_QTHELP_INCLUDE_DIR Path to "include/QtHelp"
+# QT_QTWEBKIT_INCLUDE_DIR Path to "include/QtWebKit"
+# QT_QTXMLPATTERNS_INCLUDE_DIR Path to "include/QtXmlPatterns"
#
# QT_LIBRARY_DIR Path to "lib" of Qt4
#
# QT_PLUGINS_DIR Path to "plugins" for Qt4
#
-# For every library of Qt there are three variables:
-# QT_QTFOO_LIBRARY_RELEASE, which contains the full path to the release version, if it exists
-# QT_QTFOO_LIBRARY_DEBUG, which contains the full path to the debug version, if it exists
-# QT_QTFOO_LIBRARY, the full path to the release and/or debug version
#
-# So there are the following variables:
-# The Qt3Support library: QT_QT3SUPPORT_LIBRARY
-# QT_QT3SUPPORT_LIBRARY_RELEASE
-# QT_QT3SUPPORT_DEBUG
+# The Qt toolkit may contain both debug and release libraries.
+# In that case, the following library variables will contain both.
#
-# The QtAssistant library: QT_QTASSISTANT_LIBRARY
-# QT_QTASSISTANT_LIBRARY_RELEASE
-# QT_QTASSISTANT_LIBRARY_DEBUG
-#
-# The QtCore library: QT_QTCORE_LIBRARY
-# QT_QTCORE_LIBRARY_RELEASE
-# QT_QTCORE_LIBRARY_DEBUG
-#
-# The QtDBus library: QT_QTDBUS_LIBRARY
-# QT_QTDBUS_LIBRARY_RELEASE
-# QT_QTDBUS_LIBRARY_DEBUG
-#
-# The QtDesigner library: QT_QTDESIGNER_LIBRARY
-# QT_QTDESIGNER_LIBRARY_RELEASE
-# QT_QTDESIGNER_LIBRARY_DEBUG
-#
-# The QtDesignerComponents library: QT_QTDESIGNERCOMPONENTS_LIBRARY
-# QT_QTDESIGNERCOMPONENTS_LIBRARY_RELEASE
-# QT_QTDESIGNERCOMPONENTS_LIBRARY_DEBUG
-#
-# The QtGui library: QT_QTGUI_LIBRARY
-# QT_QTGUI_LIBRARY_RELEASE
-# QT_QTGUI_LIBRARY_DEBUG
-#
-# The QtMotif library: QT_QTMOTIF_LIBRARY
-# QT_QTMOTIF_LIBRARY_RELEASE
-# QT_QTMOTIF_LIBRARY_DEBUG
-#
-# The QtNetwork library: QT_QTNETWORK_LIBRARY
-# QT_QTNETWORK_LIBRARY_RELEASE
-# QT_QTNETWORK_LIBRARY_DEBUG
-#
-# The QtNsPLugin library: QT_QTNSPLUGIN_LIBRARY
-# QT_QTNSPLUGIN_LIBRARY_RELEASE
-# QT_QTNSPLUGIN_LIBRARY_DEBUG
-#
-# The QtOpenGL library: QT_QTOPENGL_LIBRARY
-# QT_QTOPENGL_LIBRARY_RELEASE
-# QT_QTOPENGL_LIBRARY_DEBUG
-#
-# The QtSql library: QT_QTSQL_LIBRARY
-# QT_QTSQL_LIBRARY_RELEASE
-# QT_QTSQL_LIBRARY_DEBUG
-#
-# The QtXml library: QT_QTXML_LIBRARY
-# QT_QTXML_LIBRARY_RELEASE
-# QT_QTXML_LIBRARY_DEBUG
-#
-# The QtSvg library: QT_QTSVG_LIBRARY
-# QT_QTSVG_LIBRARY_RELEASE
-# QT_QTSVG_LIBRARY_DEBUG
-#
-# The QtScript library: QT_QTSCRIPT_LIBRARY
-# QT_QTSCRIPT_LIBRARY_RELEASE
-# QT_QTSCRIPT_LIBRARY_DEBUG
-#
-# The QtTest library: QT_QTTEST_LIBRARY
-# QT_QTTEST_LIBRARY_RELEASE
-# QT_QTTEST_LIBRARY_DEBUG
-#
-# The qtmain library for Windows QT_QTMAIN_LIBRARY
-# QT_QTMAIN_LIBRARY_RELEASE
-# QT_QTMAIN_LIBRARY_DEBUG
-#
-# The QtUiTools library: QT_QTUITOOLS_LIBRARY
-# QT_QTUITOOLS_LIBRARY_RELEASE
-# QT_QTUITOOLS_LIBRARY_DEBUG
+# QT_QT3SUPPORT_LIBRARY The Qt3Support library
+# QT_QTASSISTANT_LIBRARY The QtAssistant library
+# QT_QTCORE_LIBRARY The QtCore library
+# QT_QTDBUS_LIBRARY The QtDBus library
+# QT_QTDESIGNER_LIBRARY The QtDesigner library
+# QT_QTDESIGNERCOMPONENTS_LIBRARY The QtDesignerComponents library
+# QT_QTGUI_LIBRARY The QtGui library
+# QT_QTMOTIF_LIBRARY The QtMotif library
+# QT_QTNETWORK_LIBRARY The QtNetwork library
+# QT_QTNSPLUGIN_LIBRARY The QtNsPLugin library
+# QT_QTOPENGL_LIBRARY The QtOpenGL library
+# QT_QTSQL_LIBRARY The QtSql library
+# QT_QTXML_LIBRARY The QtXml library
+# QT_QTSVG_LIBRARY The QtSvg library
+# QT_QTSCRIPT_LIBRARY The QtScript library
+# QT_QTTEST_LIBRARY The QtTest library
+# QT_QTMAIN_LIBRARY The qtmain library for Windows
+# QT_QTUITOOLS_LIBRARY The QtUiTools library
+# QT_QTASSISTANTCLIENT_LIBRARY The QtAssistantClient library
+# QT_QTHELP_LIBRARY The QtHelp library
+# QT_QTWEBKIT_LIBRARY The QtWebKit library
+# QT_QTXMLPATTERNS_LIBRARY The QtXmlPatterns library
#
# also defined, but NOT for general use are
# QT_MOC_EXECUTABLE Where to find the moc tool.
@@ -546,11 +508,12 @@ IF (QT4_QMAKE_FOUND)
NO_DEFAULT_PATH
)
-
-
# Set QT_QTMOTIF_INCLUDE_DIR
IF(Q_WS_X11)
- FIND_PATH(QT_QTMOTIF_INCLUDE_DIR QtMotif PATHS ${QT_INCLUDE_DIR}/QtMotif NO_DEFAULT_PATH )
+ FIND_PATH(QT_QTMOTIF_INCLUDE_DIR QtMotif
+ PATHS
+ ${QT_INCLUDE_DIR}/QtMotif
+ NO_DEFAULT_PATH )
ENDIF(Q_WS_X11)
# Set QT_QTNETWORK_INCLUDE_DIR
@@ -597,7 +560,6 @@ IF (QT4_QMAKE_FOUND)
FIND_PATH(QT_QTASSISTANT_INCLUDE_DIR QtAssistant
PATHS
${QT_INCLUDE_DIR}/QtAssistant
- ${QT_HEADERS_DIR}/QtAssistant
${QT_LIBRARY_DIR}/QtAssistant.framework/Headers
NO_DEFAULT_PATH
)
@@ -606,7 +568,6 @@ IF (QT4_QMAKE_FOUND)
FIND_PATH(QT_QTDESIGNER_INCLUDE_DIR QDesignerComponents
PATHS
${QT_INCLUDE_DIR}/QtDesigner
- ${QT_HEADERS_DIR}/QtDesigner
${QT_LIBRARY_DIR}/QtDesigner.framework/Headers
NO_DEFAULT_PATH
)
@@ -615,16 +576,46 @@ IF (QT4_QMAKE_FOUND)
FIND_PATH(QT_QTDESIGNERCOMPONENTS_INCLUDE_DIR QDesignerComponents
PATHS
${QT_INCLUDE_DIR}/QtDesigner
- ${QT_HEADERS_DIR}/QtDesigner
+ ${QT_LIBRARY_DIR}/QtDesigner.framework/Headers
NO_DEFAULT_PATH
)
-
# Set QT_QTDBUS_INCLUDE_DIR
FIND_PATH(QT_QTDBUS_INCLUDE_DIR QtDBus
PATHS
${QT_INCLUDE_DIR}/QtDBus
- ${QT_HEADERS_DIR}/QtDBus
+ NO_DEFAULT_PATH
+ )
+
+ # Set QT_QTASSISTANTCLIENT_INCLUDE_DIR
+ FIND_PATH(QT_QTASSISTANTCLIENT_INCLUDE_DIR QtAssistantClient
+ PATHS
+ ${QT_INCLUDE_DIR}/QtAssistant
+ ${QT_LIBRARY_DIR}/QtAssistant.framework/Headers
+ NO_DEFAULT_PATH
+ )
+
+ # Set QT_QTHELP_INCLUDE_DIR
+ FIND_PATH(QT_QTHELP_INCLUDE_DIR QtHelp
+ PATHS
+ ${QT_INCLUDE_DIR}/QtHelp
+ ${QT_LIBRARY_DIR}/QtHelp.framework/Headers
+ NO_DEFAULT_PATH
+ )
+
+ # Set QT_QTWEBKIT_INCLUDE_DIR
+ FIND_PATH(QT_QTWEBKIT_INCLUDE_DIR QtWebKit
+ PATHS
+ ${QT_INCLUDE_DIR}/QtWebKit
+ ${QT_LIBRARY_DIR}/QtWebKit.framework/Headers
+ NO_DEFAULT_PATH
+ )
+
+ # Set QT_QTXMLPATTERNS_INCLUDE_DIR
+ FIND_PATH(QT_QTXMLPATTERNS_INCLUDE_DIR QtXmlPatterns
+ PATHS
+ ${QT_INCLUDE_DIR}/QtXmlPatterns
+ ${QT_LIBRARY_DIR}/QtXmlPatterns.framework/Headers
NO_DEFAULT_PATH
)
@@ -632,7 +623,7 @@ IF (QT4_QMAKE_FOUND)
MARK_AS_ADVANCED( QT_LIBRARY_DIR QT_INCLUDE_DIR QT_QT_INCLUDE_DIR QT_DOC_DIR QT_MKSPECS_DIR QT_PLUGINS_DIR)
# Set QT_INCLUDES
- SET( QT_INCLUDES ${QT_INCLUDE_DIR} ${QT_QT_INCLUDE_DIR} ${QT_MKSPECS_DIR}/default )
+ SET( QT_INCLUDES ${QT_QT_INCLUDE_DIR} ${QT_MKSPECS_DIR}/default ${QT_INCLUDE_DIR} )
# Set QT_QTCORE_LIBRARY by searching for a lib with "QtCore." as part of the filename
FIND_LIBRARY(QT_QTCORE_LIBRARY_RELEASE NAMES QtCore QtCore4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH )
@@ -714,7 +705,7 @@ IF (QT4_QMAKE_FOUND)
# Set QT_QTDESIGNERCOMPONENTS_LIBRARY
FIND_LIBRARY(QT_QTDESIGNERCOMPONENTS_LIBRARY_RELEASE NAMES QtDesignerComponents QtDesignerComponents4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
- FIND_LIBRARY(QT_QTDESIGNERCOMPONENTS_LIBRARY_DEBUG NAMES QtDesigner_debug QtDesignerd4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
+ FIND_LIBRARY(QT_QTDESIGNERCOMPONENTS_LIBRARY_DEBUG NAMES QtDesignerComponents_debug QtDesignerComponentsd4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
# Set QT_QTMAIN_LIBRARY
IF(WIN32)
@@ -723,6 +714,22 @@ IF (QT4_QMAKE_FOUND)
FIND_LIBRARY(QT_QTMAIN_LIBRARY_DEBUG NAMES qtmaind PATHS ${QT_LIBRARY_DIR}
NO_DEFAULT_PATH)
ENDIF(WIN32)
+
+ # Set QT_QTASSISTANTCLIENT_LIBRARY
+ FIND_LIBRARY(QT_QTASSISTANTCLIENT_LIBRARY_RELEASE NAMES QtAssistantClient QtAssistantClient4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
+ FIND_LIBRARY(QT_QTASSISTANTCLIENT_LIBRARY_DEBUG NAMES QtAssistantClient_debug QtAssistantClientd4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
+
+ # Set QT_QTHELP_LIBRARY
+ FIND_LIBRARY(QT_QTHELP_LIBRARY_RELEASE NAMES QtHelp QtHelp4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
+ FIND_LIBRARY(QT_QTHELP_LIBRARY_DEBUG NAMES QtHelp_debug QtHelpd4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
+
+ # Set QT_QTWEBKIT_LIBRARY
+ FIND_LIBRARY(QT_QTWEBKIT_LIBRARY_RELEASE NAMES QtWebKit QtWebKit4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
+ FIND_LIBRARY(QT_QTWEBKIT_LIBRARY_DEBUG NAMES QtWebKit_debug QtWebKitd4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
+
+ # Set QT_QTXMLPATTERNS_LIBRARY
+ FIND_LIBRARY(QT_QTXMLPATTERNS_LIBRARY_RELEASE NAMES QtXmlPatterns QtXmlPatterns4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
+ FIND_LIBRARY(QT_QTXMLPATTERNS_LIBRARY_DEBUG NAMES QtXmlPatterns_debug QtXmlPatternsd4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
############################################
#
@@ -770,7 +777,7 @@ IF (QT4_QMAKE_FOUND)
IF (QT_${basename}_INCLUDE_DIR)
#add the include directory to QT_INCLUDES
- SET(QT_INCLUDES ${QT_INCLUDES} "${QT_${basename}_INCLUDE_DIR}")
+ SET(QT_INCLUDES "${QT_${basename}_INCLUDE_DIR}" ${QT_INCLUDES})
ENDIF (QT_${basename}_INCLUDE_DIR)
# Make variables changeble to the advanced user
@@ -796,6 +803,10 @@ IF (QT4_QMAKE_FOUND)
_QT4_ADJUST_LIB_VARS(QTUITOOLS)
_QT4_ADJUST_LIB_VARS(QTTEST)
_QT4_ADJUST_LIB_VARS(QTDBUS)
+ _QT4_ADJUST_LIB_VARS(QTASSISTANTCLIENT)
+ _QT4_ADJUST_LIB_VARS(QTHELP)
+ _QT4_ADJUST_LIB_VARS(QTWEBKIT)
+ _QT4_ADJUST_LIB_VARS(QTXMLPATTERNS)
# platform dependent libraries
IF(Q_WS_X11)