2005-12-14 18:51:08 +00:00
|
|
|
# - Find QT 4
|
|
|
|
# This module can be used to find Qt4.
|
2006-04-27 19:07:23 +00:00
|
|
|
# The most important issue is that the Qt4 qmake is available via the system path.
|
|
|
|
# This qmake is then used to detect basically everything else.
|
2008-03-18 22:37:28 +00:00
|
|
|
# This module defines a number of key variables and macros.
|
|
|
|
# First is QT_USE_FILE which is the path to a CMake file that can be included
|
|
|
|
# to compile Qt 4 applications and libraries. By default, the QtCore and QtGui
|
2006-05-19 20:57:49 +00:00
|
|
|
# libraries are loaded. This behavior can be changed by setting one or more
|
2008-03-18 22:37:28 +00:00
|
|
|
# of the following variables to true before doing INCLUDE(${QT_USE_FILE}):
|
2005-12-14 18:51:08 +00:00
|
|
|
# QT_DONT_USE_QTCORE
|
|
|
|
# QT_DONT_USE_QTGUI
|
|
|
|
# QT_USE_QT3SUPPORT
|
|
|
|
# QT_USE_QTASSISTANT
|
|
|
|
# QT_USE_QTDESIGNER
|
|
|
|
# QT_USE_QTMOTIF
|
2006-04-27 19:07:23 +00:00
|
|
|
# QT_USE_QTMAIN
|
2005-12-14 18:51:08 +00:00
|
|
|
# QT_USE_QTNETWORK
|
|
|
|
# QT_USE_QTNSPLUGIN
|
|
|
|
# QT_USE_QTOPENGL
|
|
|
|
# QT_USE_QTSQL
|
|
|
|
# QT_USE_QTXML
|
2006-09-06 12:31:50 +00:00
|
|
|
# QT_USE_QTSVG
|
|
|
|
# QT_USE_QTTEST
|
|
|
|
# QT_USE_QTUITOOLS
|
2007-01-04 21:50:18 +00:00
|
|
|
# QT_USE_QTDBUS
|
2007-08-21 20:50:49 +00:00
|
|
|
# QT_USE_QTSCRIPT
|
2008-03-13 19:29:28 +00:00
|
|
|
# QT_USE_QTASSISTANTCLIENT
|
|
|
|
# QT_USE_QTHELP
|
|
|
|
# QT_USE_QTWEBKIT
|
|
|
|
# QT_USE_QTXMLPATTERNS
|
2008-03-13 23:12:46 +00:00
|
|
|
# QT_USE_PHONON
|
2006-04-27 19:07:23 +00:00
|
|
|
#
|
2008-03-18 22:37:28 +00:00
|
|
|
# The file pointed to by QT_USE_FILE will set up your compile environment
|
|
|
|
# by adding include directories, preprocessor defines, and populate a
|
|
|
|
# QT_LIBRARIES variable containing all the Qt libraries and their dependencies.
|
|
|
|
# Add the QT_LIBRARIES variable to your TARGET_LINK_LIBRARIES.
|
|
|
|
#
|
|
|
|
# Typical usage could be something like:
|
|
|
|
# FIND_PACKAGE(Qt4)
|
|
|
|
# SET(QT_USE_QTXML 1)
|
|
|
|
# INCLUDE(${QT_USE_FILE})
|
|
|
|
# ADD_EXECUTABLE(myexe main.cpp)
|
|
|
|
# TARGET_LINK_LIBRARIES(myexe ${QT_LIBRARIES})
|
|
|
|
#
|
|
|
|
#
|
|
|
|
# There are also some files that need processing by some Qt tools such as moc
|
|
|
|
# and uic. Listed below are macros that may be used to process those files.
|
2006-05-19 20:57:49 +00:00
|
|
|
#
|
2007-12-14 21:56:25 +00:00
|
|
|
# macro QT4_WRAP_CPP(outfiles inputfile ... OPTIONS ...)
|
2007-12-18 18:05:43 +00:00
|
|
|
# create moc code from a list of files containing Qt class with
|
|
|
|
# the Q_OBJECT declaration. Options may be given to moc, such as those found
|
|
|
|
# when executing "moc -help"
|
|
|
|
#
|
2007-12-14 21:56:25 +00:00
|
|
|
# macro QT4_WRAP_UI(outfiles inputfile ... OPTIONS ...)
|
2007-12-18 18:05:43 +00:00
|
|
|
# create code from a list of Qt designer ui files.
|
|
|
|
# Options may be given to uic, such as those found
|
|
|
|
# when executing "uic -help"
|
|
|
|
#
|
2007-12-14 21:56:25 +00:00
|
|
|
# macro QT4_ADD_RESOURCES(outfiles inputfile ... OPTIONS ...)
|
2007-12-18 18:05:43 +00:00
|
|
|
# create code from a list of Qt resource files.
|
|
|
|
# Options may be given to rcc, such as those found
|
|
|
|
# when executing "rcc -help"
|
|
|
|
#
|
2006-04-27 19:07:23 +00:00
|
|
|
# macro QT4_AUTOMOC(inputfile ... )
|
|
|
|
# macro QT4_GENERATE_MOC(inputfile outputfile )
|
2007-01-03 23:20:55 +00:00
|
|
|
#
|
|
|
|
# macro QT4_ADD_DBUS_INTERFACE(outfiles interface basename)
|
|
|
|
# create a the interface header and implementation files with the
|
|
|
|
# given basename from the given interface xml file and add it to
|
|
|
|
# the list of sources
|
|
|
|
#
|
|
|
|
# macro QT4_ADD_DBUS_INTERFACES(outfiles inputfile ... )
|
|
|
|
# create the interface header and implementation files
|
|
|
|
# for all listed interface xml files
|
|
|
|
# the name will be automatically determined from the name of the xml file
|
|
|
|
#
|
|
|
|
# macro QT4_ADD_DBUS_ADAPTOR(outfiles xmlfile parentheader parentclassname [basename] )
|
|
|
|
# create a dbus adaptor (header and implementation file) from the xml file
|
|
|
|
# describing the interface, and add it to the list of sources. The adaptor
|
|
|
|
# forwards the calls to a parent class, defined in parentheader and named
|
|
|
|
# parentclassname. The name of the generated files will be
|
|
|
|
# <basename>adaptor.{cpp,h} where basename is the basename of the xml file.
|
|
|
|
#
|
|
|
|
# macro QT4_GENERATE_DBUS_INTERFACE( header [interfacename] )
|
|
|
|
# generate the xml interface file from the given header.
|
|
|
|
# If the optional argument interfacename is omitted, the name of the
|
|
|
|
# interface file is constructed from the basename of the header with
|
|
|
|
# the suffix .xml appended.
|
|
|
|
#
|
2008-01-22 15:11:29 +00:00
|
|
|
# macro QT4_CREATE_TRANSLATION( qm_files sources ... ts_files ... )
|
|
|
|
# out: qm_files
|
|
|
|
# in: sources ts_files
|
|
|
|
# generates commands to create .ts (vie lupdate) and .qm
|
|
|
|
# (via lrelease) - files from sources. The ts files are
|
|
|
|
# created and/or updated in the source tree (unless given with full paths).
|
|
|
|
# The qm files are generated in the build tree.
|
|
|
|
# Updating the translations can be done by adding the qm_files
|
|
|
|
# to the source list of your library/executable, so they are
|
|
|
|
# always updated, or by adding a custom target to control when
|
|
|
|
# they get updated/generated.
|
|
|
|
#
|
|
|
|
# macro QT4_ADD_TRANSLATION( qm_files ts_files ... )
|
|
|
|
# out: qm_files
|
|
|
|
# in: ts_files
|
|
|
|
# generates commands to create .qm from .ts - files. The generated
|
|
|
|
# filenames can be found in qm_files. The ts_files
|
|
|
|
# must exists and are not updated in any way.
|
|
|
|
#
|
|
|
|
#
|
2005-12-15 19:17:43 +00:00
|
|
|
# QT_FOUND If false, don't try to use Qt.
|
|
|
|
# QT4_FOUND If false, don't try to use Qt 4.
|
2007-01-03 21:01:59 +00:00
|
|
|
#
|
2008-03-13 19:29:28 +00:00
|
|
|
# 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.
|
2008-03-13 23:12:46 +00:00
|
|
|
# QT_PHONON_FOUND True if phonon was found.
|
2008-03-18 22:37:28 +00:00
|
|
|
#
|
|
|
|
#
|
2006-04-27 19:07:23 +00:00
|
|
|
# QT_DEFINITIONS Definitions to use when compiling code that uses Qt.
|
2008-03-18 22:37:28 +00:00
|
|
|
# You do not need to use this if you include QT_USE_FILE.
|
|
|
|
# The QT_USE_FILE will also define QT_DEBUG and QT_NO_DEBUG
|
|
|
|
# to fit your current build type. Those are not contained
|
|
|
|
# in QT_DEFINITIONS.
|
2006-05-19 20:57:49 +00:00
|
|
|
#
|
|
|
|
# QT_INCLUDES List of paths to all include directories of
|
2006-04-27 19:07:23 +00:00
|
|
|
# Qt4 QT_INCLUDE_DIR and QT_QTCORE_INCLUDE_DIR are
|
2005-12-14 18:51:08 +00:00
|
|
|
# always in this variable even if NOTFOUND,
|
|
|
|
# all other INCLUDE_DIRS are
|
|
|
|
# only added if they are found.
|
2008-03-18 22:37:28 +00:00
|
|
|
# You do not need to use this if you include QT_USE_FILE.
|
2006-05-19 20:57:49 +00:00
|
|
|
#
|
2008-03-18 22:37:28 +00:00
|
|
|
#
|
|
|
|
# Include directories for the Qt modules are listed here.
|
|
|
|
# You do not need to use these variables if you include QT_USE_FILE.
|
|
|
|
#
|
2005-12-14 18:51:08 +00:00
|
|
|
# QT_INCLUDE_DIR Path to "include" of Qt4
|
2006-05-19 20:57:49 +00:00
|
|
|
# QT_QT_INCLUDE_DIR Path to "include/Qt"
|
|
|
|
# QT_QT3SUPPORT_INCLUDE_DIR Path to "include/Qt3Support"
|
|
|
|
# QT_QTASSISTANT_INCLUDE_DIR Path to "include/QtAssistant"
|
|
|
|
# QT_QTCORE_INCLUDE_DIR Path to "include/QtCore"
|
|
|
|
# QT_QTDESIGNER_INCLUDE_DIR Path to "include/QtDesigner"
|
2007-01-03 21:38:26 +00:00
|
|
|
# QT_QTDESIGNERCOMPONENTS_INCLUDE_DIR Path to "include/QtDesigner"
|
|
|
|
# QT_QTDBUS_INCLUDE_DIR Path to "include/QtDBus"
|
2006-05-19 20:57:49 +00:00
|
|
|
# QT_QTGUI_INCLUDE_DIR Path to "include/QtGui"
|
|
|
|
# QT_QTMOTIF_INCLUDE_DIR Path to "include/QtMotif"
|
|
|
|
# QT_QTNETWORK_INCLUDE_DIR Path to "include/QtNetwork"
|
|
|
|
# QT_QTNSPLUGIN_INCLUDE_DIR Path to "include/QtNsPlugin"
|
|
|
|
# QT_QTOPENGL_INCLUDE_DIR Path to "include/QtOpenGL"
|
|
|
|
# QT_QTSQL_INCLUDE_DIR Path to "include/QtSql"
|
|
|
|
# QT_QTXML_INCLUDE_DIR Path to "include/QtXml"
|
2006-04-27 19:07:23 +00:00
|
|
|
# QT_QTSVG_INCLUDE_DIR Path to "include/QtSvg"
|
2007-08-21 20:50:49 +00:00
|
|
|
# QT_QTSCRIPT_INCLUDE_DIR Path to "include/QtScript"
|
2006-04-27 19:07:23 +00:00
|
|
|
# QT_QTTEST_INCLUDE_DIR Path to "include/QtTest"
|
2008-03-13 19:29:28 +00:00
|
|
|
# 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"
|
2008-03-13 23:12:46 +00:00
|
|
|
# QT_PHONON_INCLUDE_DIR Path to "include/phonon"
|
2006-05-19 20:57:49 +00:00
|
|
|
#
|
2005-12-14 18:51:08 +00:00
|
|
|
# QT_LIBRARY_DIR Path to "lib" of Qt4
|
2006-10-13 15:23:44 +00:00
|
|
|
#
|
|
|
|
# QT_PLUGINS_DIR Path to "plugins" for Qt4
|
2006-05-19 20:57:49 +00:00
|
|
|
#
|
2006-04-27 19:07:23 +00:00
|
|
|
#
|
2008-03-13 19:29:28 +00:00
|
|
|
# The Qt toolkit may contain both debug and release libraries.
|
2008-03-18 22:37:28 +00:00
|
|
|
# In that case, the following library variables will contain both.
|
|
|
|
# You do not need to use these variables if you include QT_USE_FILE,
|
|
|
|
# and use QT_LIBRARIES.
|
2008-03-13 19:29:28 +00:00
|
|
|
#
|
|
|
|
# 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
|
2008-03-13 23:12:46 +00:00
|
|
|
# QT_PHONON_LIBRARY The phonon library
|
2006-05-19 20:57:49 +00:00
|
|
|
#
|
2006-04-27 19:07:23 +00:00
|
|
|
# also defined, but NOT for general use are
|
2005-12-14 18:51:08 +00:00
|
|
|
# QT_MOC_EXECUTABLE Where to find the moc tool.
|
|
|
|
# QT_UIC_EXECUTABLE Where to find the uic tool.
|
2006-04-27 19:07:23 +00:00
|
|
|
# QT_UIC3_EXECUTABLE Where to find the uic3 tool.
|
2005-12-14 18:51:08 +00:00
|
|
|
# QT_RCC_EXECUTABLE Where to find the rcc tool
|
2007-01-03 21:01:59 +00:00
|
|
|
# QT_DBUSCPP2XML_EXECUTABLE Where to find the qdbuscpp2xml tool.
|
|
|
|
# QT_DBUSXML2CPP_EXECUTABLE Where to find the qdbusxml2cpp tool.
|
2008-01-22 15:11:29 +00:00
|
|
|
# QT_LUPDATE_EXECUTABLE Where to find the lupdate tool.
|
|
|
|
# QT_LRELEASE_EXECUTABLE Where to find the lrelease tool.
|
2006-05-19 20:57:49 +00:00
|
|
|
#
|
2006-04-27 19:07:23 +00:00
|
|
|
# QT_DOC_DIR Path to "doc" of Qt4
|
|
|
|
# QT_MKSPECS_DIR Path to "mkspecs" of Qt4
|
|
|
|
#
|
|
|
|
#
|
2006-05-19 20:57:49 +00:00
|
|
|
# These are around for backwards compatibility
|
2005-07-15 16:14:47 +00:00
|
|
|
# they will be set
|
2005-12-15 19:17:43 +00:00
|
|
|
# QT_WRAP_CPP Set true if QT_MOC_EXECUTABLE is found
|
|
|
|
# QT_WRAP_UI Set true if QT_UIC_EXECUTABLE is found
|
2006-05-19 20:57:49 +00:00
|
|
|
#
|
2005-07-15 16:14:47 +00:00
|
|
|
# These variables do _NOT_ have any effect anymore (compared to FindQt.cmake)
|
2005-12-14 18:51:08 +00:00
|
|
|
# QT_MT_REQUIRED Qt4 is now always multithreaded
|
2006-05-19 20:57:49 +00:00
|
|
|
#
|
|
|
|
# These variables are set to "" Because Qt structure changed
|
2005-12-15 19:17:43 +00:00
|
|
|
# (They make no sense in Qt4)
|
2006-04-27 19:07:23 +00:00
|
|
|
# QT_QT_LIBRARY Qt-Library is now split
|
|
|
|
|
|
|
|
INCLUDE(CheckSymbolExists)
|
2006-06-16 18:45:47 +00:00
|
|
|
INCLUDE(MacroAddFileDependencies)
|
2005-07-15 16:14:47 +00:00
|
|
|
|
2005-09-08 13:58:41 +00:00
|
|
|
SET(QT_USE_FILE ${CMAKE_ROOT}/Modules/UseQt4.cmake)
|
|
|
|
|
|
|
|
SET( QT_DEFINITIONS "")
|
|
|
|
|
2006-04-27 19:07:23 +00:00
|
|
|
SET(QT4_INSTALLED_VERSION_TOO_OLD FALSE)
|
|
|
|
|
2007-01-03 21:48:08 +00:00
|
|
|
# macro for asking qmake to process pro files
|
2006-09-06 12:31:50 +00:00
|
|
|
MACRO(QT_QUERY_QMAKE outvar invar)
|
|
|
|
FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmpQmake/tmp.pro
|
2006-10-04 14:33:10 +00:00
|
|
|
"message(CMAKE_MESSAGE<$$${invar}>)")
|
2007-01-03 21:48:08 +00:00
|
|
|
|
2007-03-01 21:44:32 +00:00
|
|
|
# Invoke qmake with the tmp.pro program to get the desired
|
|
|
|
# information. Use the same variable for both stdout and stderr
|
|
|
|
# to make sure we get the output on all platforms.
|
2006-09-06 12:31:50 +00:00
|
|
|
EXECUTE_PROCESS(COMMAND ${QT_QMAKE_EXECUTABLE}
|
2006-10-04 14:33:10 +00:00
|
|
|
WORKING_DIRECTORY
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmpQmake
|
|
|
|
OUTPUT_VARIABLE _qmake_query_output
|
2007-02-19 18:44:30 +00:00
|
|
|
RESULT_VARIABLE _qmake_result
|
2007-03-01 21:44:32 +00:00
|
|
|
ERROR_VARIABLE _qmake_query_output )
|
2007-02-19 18:44:30 +00:00
|
|
|
|
2006-09-06 12:31:50 +00:00
|
|
|
FILE(REMOVE_RECURSE
|
|
|
|
"${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmpQmake")
|
2007-01-03 21:48:08 +00:00
|
|
|
|
2007-02-19 18:44:30 +00:00
|
|
|
IF(_qmake_result)
|
2007-03-01 21:44:32 +00:00
|
|
|
MESSAGE(WARNING " querying qmake for ${invar}. qmake reported:\n${_qmake_query_output}")
|
2007-02-19 18:44:30 +00:00
|
|
|
ELSE(_qmake_result)
|
|
|
|
STRING(REGEX REPLACE ".*CMAKE_MESSAGE<([^>]*).*" "\\1" ${outvar} "${_qmake_query_output}")
|
|
|
|
ENDIF(_qmake_result)
|
|
|
|
|
2006-09-06 12:31:50 +00:00
|
|
|
ENDMACRO(QT_QUERY_QMAKE)
|
2007-12-16 10:49:23 +00:00
|
|
|
|
2007-09-27 00:53:29 +00:00
|
|
|
GET_FILENAME_COMPONENT(qt_install_version "[HKEY_CURRENT_USER\\Software\\trolltech\\Versions;DefaultQtVersion]" NAME)
|
2007-01-04 21:35:47 +00:00
|
|
|
# check for qmake
|
|
|
|
FIND_PROGRAM(QT_QMAKE_EXECUTABLE NAMES qmake qmake4 qmake-qt4 PATHS
|
|
|
|
"[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\4.0.0;InstallDir]/bin"
|
|
|
|
"[HKEY_CURRENT_USER\\Software\\Trolltech\\Versions\\4.0.0;InstallDir]/bin"
|
2007-09-27 00:53:29 +00:00
|
|
|
"[HKEY_CURRENT_USER\\Software\\Trolltech\\Versions\\${qt_install_version};InstallDir]/bin"
|
2007-01-04 21:35:47 +00:00
|
|
|
$ENV{QTDIR}/bin
|
|
|
|
)
|
2006-04-27 19:07:23 +00:00
|
|
|
|
|
|
|
IF (QT_QMAKE_EXECUTABLE)
|
|
|
|
|
2006-10-04 14:33:10 +00:00
|
|
|
SET(QT4_QMAKE_FOUND FALSE)
|
|
|
|
|
|
|
|
EXEC_PROGRAM(${QT_QMAKE_EXECUTABLE} ARGS "-query QT_VERSION" OUTPUT_VARIABLE QTVERSION)
|
2007-12-16 10:49:23 +00:00
|
|
|
|
2007-01-04 22:29:01 +00:00
|
|
|
# check for qt3 qmake and then try and find qmake4 or qmake-qt4 in the path
|
2006-10-04 14:33:10 +00:00
|
|
|
IF("${QTVERSION}" MATCHES "Unknown")
|
|
|
|
SET(QT_QMAKE_EXECUTABLE NOTFOUND CACHE FILEPATH "" FORCE)
|
2007-01-04 21:35:47 +00:00
|
|
|
FIND_PROGRAM(QT_QMAKE_EXECUTABLE NAMES qmake4 qmake-qt4 PATHS
|
2006-10-04 14:33:10 +00:00
|
|
|
"[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\4.0.0;InstallDir]/bin"
|
|
|
|
"[HKEY_CURRENT_USER\\Software\\Trolltech\\Versions\\4.0.0;InstallDir]/bin"
|
|
|
|
$ENV{QTDIR}/bin
|
|
|
|
)
|
|
|
|
IF(QT_QMAKE_EXECUTABLE)
|
|
|
|
EXEC_PROGRAM(${QT_QMAKE_EXECUTABLE}
|
|
|
|
ARGS "-query QT_VERSION" OUTPUT_VARIABLE QTVERSION)
|
|
|
|
ENDIF(QT_QMAKE_EXECUTABLE)
|
|
|
|
ENDIF("${QTVERSION}" MATCHES "Unknown")
|
2007-01-04 21:35:47 +00:00
|
|
|
|
2006-10-04 14:33:10 +00:00
|
|
|
# check that we found the Qt4 qmake, Qt3 qmake output won't match here
|
|
|
|
STRING(REGEX MATCH "^[0-9]+\\.[0-9]+\\.[0-9]+" qt_version_tmp "${QTVERSION}")
|
|
|
|
IF (qt_version_tmp)
|
|
|
|
|
|
|
|
# we need at least version 4.0.0
|
|
|
|
IF (NOT QT_MIN_VERSION)
|
|
|
|
SET(QT_MIN_VERSION "4.0.0")
|
|
|
|
ENDIF (NOT QT_MIN_VERSION)
|
2007-01-03 21:38:26 +00:00
|
|
|
|
2006-10-04 14:33:10 +00:00
|
|
|
#now parse the parts of the user given version string into variables
|
|
|
|
STRING(REGEX MATCH "^[0-9]+\\.[0-9]+\\.[0-9]+" req_qt_major_vers "${QT_MIN_VERSION}")
|
|
|
|
IF (NOT req_qt_major_vers)
|
|
|
|
MESSAGE( FATAL_ERROR "Invalid Qt version string given: \"${QT_MIN_VERSION}\", expected e.g. \"4.0.1\"")
|
|
|
|
ENDIF (NOT req_qt_major_vers)
|
2007-01-03 21:38:26 +00:00
|
|
|
|
2006-10-04 14:33:10 +00:00
|
|
|
# now parse the parts of the user given version string into variables
|
|
|
|
STRING(REGEX REPLACE "^([0-9]+)\\.[0-9]+\\.[0-9]+" "\\1" req_qt_major_vers "${QT_MIN_VERSION}")
|
|
|
|
STRING(REGEX REPLACE "^[0-9]+\\.([0-9])+\\.[0-9]+" "\\1" req_qt_minor_vers "${QT_MIN_VERSION}")
|
|
|
|
STRING(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+)" "\\1" req_qt_patch_vers "${QT_MIN_VERSION}")
|
2007-01-03 21:38:26 +00:00
|
|
|
|
2006-10-04 14:33:10 +00:00
|
|
|
IF (NOT req_qt_major_vers EQUAL 4)
|
|
|
|
MESSAGE( FATAL_ERROR "Invalid Qt version string given: \"${QT_MIN_VERSION}\", major version 4 is required, e.g. \"4.0.1\"")
|
|
|
|
ENDIF (NOT req_qt_major_vers EQUAL 4)
|
2007-01-03 21:38:26 +00:00
|
|
|
|
2006-10-04 14:33:10 +00:00
|
|
|
# and now the version string given by qmake
|
|
|
|
STRING(REGEX REPLACE "^([0-9]+)\\.[0-9]+\\.[0-9]+.*" "\\1" found_qt_major_vers "${QTVERSION}")
|
|
|
|
STRING(REGEX REPLACE "^[0-9]+\\.([0-9])+\\.[0-9]+.*" "\\1" found_qt_minor_vers "${QTVERSION}")
|
|
|
|
STRING(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" found_qt_patch_vers "${QTVERSION}")
|
2007-01-03 21:38:26 +00:00
|
|
|
|
2006-10-04 14:33:10 +00:00
|
|
|
# compute an overall version number which can be compared at once
|
|
|
|
MATH(EXPR req_vers "${req_qt_major_vers}*10000 + ${req_qt_minor_vers}*100 + ${req_qt_patch_vers}")
|
|
|
|
MATH(EXPR found_vers "${found_qt_major_vers}*10000 + ${found_qt_minor_vers}*100 + ${found_qt_patch_vers}")
|
2007-01-03 21:38:26 +00:00
|
|
|
|
2006-10-04 14:33:10 +00:00
|
|
|
IF (found_vers LESS req_vers)
|
|
|
|
SET(QT4_QMAKE_FOUND FALSE)
|
|
|
|
SET(QT4_INSTALLED_VERSION_TOO_OLD TRUE)
|
|
|
|
ELSE (found_vers LESS req_vers)
|
|
|
|
SET(QT4_QMAKE_FOUND TRUE)
|
|
|
|
ENDIF (found_vers LESS req_vers)
|
|
|
|
ENDIF (qt_version_tmp)
|
2006-04-27 19:07:23 +00:00
|
|
|
|
|
|
|
ENDIF (QT_QMAKE_EXECUTABLE)
|
|
|
|
|
|
|
|
IF (QT4_QMAKE_FOUND)
|
|
|
|
|
|
|
|
# ask qmake for the library dir
|
2005-09-12 13:00:55 +00:00
|
|
|
# Set QT_LIBRARY_DIR
|
2006-04-27 19:07:23 +00:00
|
|
|
IF (NOT QT_LIBRARY_DIR)
|
2005-08-10 12:48:03 +00:00
|
|
|
EXEC_PROGRAM( ${QT_QMAKE_EXECUTABLE}
|
2006-05-12 13:47:26 +00:00
|
|
|
ARGS "-query QT_INSTALL_LIBS"
|
|
|
|
OUTPUT_VARIABLE QT_LIBRARY_DIR_TMP )
|
2005-09-13 13:25:29 +00:00
|
|
|
IF(EXISTS "${QT_LIBRARY_DIR_TMP}")
|
2006-05-12 13:47:26 +00:00
|
|
|
SET(QT_LIBRARY_DIR ${QT_LIBRARY_DIR_TMP} CACHE PATH "Qt library dir")
|
2005-09-13 13:25:29 +00:00
|
|
|
ELSE(EXISTS "${QT_LIBRARY_DIR_TMP}")
|
2006-05-12 13:47:26 +00:00
|
|
|
MESSAGE("Warning: QT_QMAKE_EXECUTABLE reported QT_INSTALL_LIBS as ${QT_LIBRARY_DIR_TMP}")
|
2006-10-04 14:33:10 +00:00
|
|
|
MESSAGE("Warning: ${QT_LIBRARY_DIR_TMP} does NOT exist, Qt must NOT be installed correctly.")
|
2005-09-13 13:25:29 +00:00
|
|
|
ENDIF(EXISTS "${QT_LIBRARY_DIR_TMP}")
|
2005-09-12 13:00:55 +00:00
|
|
|
ENDIF(NOT QT_LIBRARY_DIR)
|
2006-05-19 20:57:49 +00:00
|
|
|
|
2005-09-12 13:00:55 +00:00
|
|
|
IF (APPLE)
|
|
|
|
IF (EXISTS ${QT_LIBRARY_DIR}/QtCore.framework)
|
|
|
|
SET(QT_USE_FRAMEWORKS ON
|
2006-05-12 13:47:26 +00:00
|
|
|
CACHE BOOL "Set to ON if Qt build uses frameworks.")
|
2005-09-12 13:00:55 +00:00
|
|
|
ELSE (EXISTS ${QT_LIBRARY_DIR}/QtCore.framework)
|
2006-05-12 13:47:26 +00:00
|
|
|
SET(QT_USE_FRAMEWORKS OFF
|
|
|
|
CACHE BOOL "Set to ON if Qt build uses frameworks.")
|
2005-09-12 13:00:55 +00:00
|
|
|
ENDIF (EXISTS ${QT_LIBRARY_DIR}/QtCore.framework)
|
2006-05-19 20:57:49 +00:00
|
|
|
|
2005-09-12 13:00:55 +00:00
|
|
|
MARK_AS_ADVANCED(QT_USE_FRAMEWORKS)
|
|
|
|
ENDIF (APPLE)
|
2006-05-19 20:57:49 +00:00
|
|
|
|
2006-04-27 19:07:23 +00:00
|
|
|
# ask qmake for the binary dir
|
2008-03-05 17:53:44 +00:00
|
|
|
IF (QT_LIBRARY_DIR AND NOT QT_BINARY_DIR)
|
2007-01-03 21:01:59 +00:00
|
|
|
EXEC_PROGRAM(${QT_QMAKE_EXECUTABLE}
|
|
|
|
ARGS "-query QT_INSTALL_BINS"
|
|
|
|
OUTPUT_VARIABLE qt_bins )
|
|
|
|
SET(QT_BINARY_DIR ${qt_bins} CACHE INTERNAL "")
|
2008-03-05 17:53:44 +00:00
|
|
|
ENDIF (QT_LIBRARY_DIR AND NOT QT_BINARY_DIR)
|
2006-04-27 19:07:23 +00:00
|
|
|
|
|
|
|
# ask qmake for the include dir
|
2008-03-05 17:53:44 +00:00
|
|
|
IF (QT_LIBRARY_DIR AND NOT QT_HEADERS_DIR)
|
2007-01-03 21:01:59 +00:00
|
|
|
EXEC_PROGRAM( ${QT_QMAKE_EXECUTABLE}
|
|
|
|
ARGS "-query QT_INSTALL_HEADERS"
|
|
|
|
OUTPUT_VARIABLE qt_headers )
|
|
|
|
SET(QT_HEADERS_DIR ${qt_headers} CACHE INTERNAL "")
|
2008-03-05 17:53:44 +00:00
|
|
|
ENDIF(QT_LIBRARY_DIR AND NOT QT_HEADERS_DIR)
|
2006-04-27 19:07:23 +00:00
|
|
|
|
|
|
|
|
|
|
|
# ask qmake for the documentation directory
|
2008-03-05 17:53:44 +00:00
|
|
|
IF (QT_LIBRARY_DIR AND NOT QT_DOC_DIR)
|
2006-04-27 19:07:23 +00:00
|
|
|
EXEC_PROGRAM( ${QT_QMAKE_EXECUTABLE}
|
|
|
|
ARGS "-query QT_INSTALL_DOCS"
|
|
|
|
OUTPUT_VARIABLE qt_doc_dir )
|
|
|
|
SET(QT_DOC_DIR ${qt_doc_dir} CACHE PATH "The location of the Qt docs")
|
2008-03-05 17:53:44 +00:00
|
|
|
ENDIF (QT_LIBRARY_DIR AND NOT QT_DOC_DIR)
|
2006-04-27 19:07:23 +00:00
|
|
|
|
|
|
|
# ask qmake for the mkspecs directory
|
2008-03-05 17:53:44 +00:00
|
|
|
IF (QT_LIBRARY_DIR AND NOT QT_MKSPECS_DIR)
|
2006-04-27 19:07:23 +00:00
|
|
|
EXEC_PROGRAM( ${QT_QMAKE_EXECUTABLE}
|
|
|
|
ARGS "-query QMAKE_MKSPECS"
|
2007-11-08 17:27:18 +00:00
|
|
|
OUTPUT_VARIABLE qt_mkspecs_dirs )
|
|
|
|
STRING(REPLACE ":" ";" qt_mkspecs_dirs "${qt_mkspecs_dirs}")
|
|
|
|
FIND_PATH(QT_MKSPECS_DIR qconfig.pri PATHS ${qt_mkspecs_dirs}
|
|
|
|
DOC "The location of the Qt mkspecs containing qconfig.pri"
|
|
|
|
NO_DEFAULT_PATH )
|
2008-03-05 17:53:44 +00:00
|
|
|
ENDIF (QT_LIBRARY_DIR AND NOT QT_MKSPECS_DIR)
|
2006-04-27 19:07:23 +00:00
|
|
|
|
2006-10-13 15:23:44 +00:00
|
|
|
# ask qmake for the plugins directory
|
2008-03-05 17:53:44 +00:00
|
|
|
IF (QT_LIBRARY_DIR AND NOT QT_PLUGINS_DIR)
|
2006-10-13 15:23:44 +00:00
|
|
|
EXEC_PROGRAM( ${QT_QMAKE_EXECUTABLE}
|
|
|
|
ARGS "-query QT_INSTALL_PLUGINS"
|
|
|
|
OUTPUT_VARIABLE qt_plugins_dir )
|
|
|
|
SET(QT_PLUGINS_DIR ${qt_plugins_dir} CACHE PATH "The location of the Qt plugins")
|
2008-03-05 17:53:44 +00:00
|
|
|
ENDIF (QT_LIBRARY_DIR AND NOT QT_PLUGINS_DIR)
|
2005-09-12 13:00:55 +00:00
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# Setting the INCLUDE-Variables
|
|
|
|
#
|
|
|
|
########################################
|
2006-04-27 19:07:23 +00:00
|
|
|
|
|
|
|
FIND_PATH(QT_QTCORE_INCLUDE_DIR QtGlobal
|
|
|
|
${QT_HEADERS_DIR}/QtCore
|
2005-09-12 13:00:55 +00:00
|
|
|
${QT_LIBRARY_DIR}/QtCore.framework/Headers
|
2006-06-16 18:45:47 +00:00
|
|
|
NO_DEFAULT_PATH
|
2006-10-04 14:33:10 +00:00
|
|
|
)
|
2006-04-27 19:07:23 +00:00
|
|
|
|
|
|
|
# Set QT_INCLUDE_DIR by removine "/QtCore" in the string ${QT_QTCORE_INCLUDE_DIR}
|
|
|
|
IF( QT_QTCORE_INCLUDE_DIR AND NOT QT_INCLUDE_DIR)
|
2005-09-12 13:00:55 +00:00
|
|
|
IF (QT_USE_FRAMEWORKS)
|
|
|
|
SET(QT_INCLUDE_DIR ${QT_HEADERS_DIR})
|
|
|
|
ELSE (QT_USE_FRAMEWORKS)
|
2006-04-27 19:07:23 +00:00
|
|
|
STRING( REGEX REPLACE "/QtCore$" "" qt4_include_dir ${QT_QTCORE_INCLUDE_DIR})
|
2005-09-12 13:00:55 +00:00
|
|
|
SET( QT_INCLUDE_DIR ${qt4_include_dir} CACHE PATH "")
|
|
|
|
ENDIF (QT_USE_FRAMEWORKS)
|
2006-04-27 19:07:23 +00:00
|
|
|
ENDIF( QT_QTCORE_INCLUDE_DIR AND NOT QT_INCLUDE_DIR)
|
|
|
|
|
2005-09-12 13:00:55 +00:00
|
|
|
IF( NOT QT_INCLUDE_DIR)
|
2006-01-09 17:45:37 +00:00
|
|
|
IF( NOT Qt4_FIND_QUIETLY AND Qt4_FIND_REQUIRED)
|
2006-04-27 19:07:23 +00:00
|
|
|
MESSAGE( FATAL_ERROR "Could NOT find QtGlobal header")
|
2006-01-09 17:45:37 +00:00
|
|
|
ENDIF( NOT Qt4_FIND_QUIETLY AND Qt4_FIND_REQUIRED)
|
2005-09-12 13:00:55 +00:00
|
|
|
ENDIF( NOT QT_INCLUDE_DIR)
|
2005-08-02 20:34:23 +00:00
|
|
|
|
2006-04-27 19:07:23 +00:00
|
|
|
#############################################
|
|
|
|
#
|
|
|
|
# Find out what window system we're using
|
|
|
|
#
|
|
|
|
#############################################
|
2007-09-19 13:35:37 +00:00
|
|
|
# Save required variable
|
2006-04-27 19:07:23 +00:00
|
|
|
SET(CMAKE_REQUIRED_INCLUDES_SAVE ${CMAKE_REQUIRED_INCLUDES})
|
2007-09-19 13:35:37 +00:00
|
|
|
SET(CMAKE_REQUIRED_FLAGS_SAVE ${CMAKE_REQUIRED_FLAGS})
|
2006-04-27 19:07:23 +00:00
|
|
|
# Add QT_INCLUDE_DIR to CMAKE_REQUIRED_INCLUDES
|
|
|
|
SET(CMAKE_REQUIRED_INCLUDES "${CMAKE_REQUIRED_INCLUDES};${QT_INCLUDE_DIR}")
|
2007-09-19 13:35:37 +00:00
|
|
|
# On Mac OS X when Qt has framework support, also add the framework path
|
|
|
|
IF( QT_USE_FRAMEWORKS )
|
|
|
|
SET(CMAKE_REQUIRED_FLAGS "-F${QT_LIBRARY_DIR} ")
|
|
|
|
ENDIF( QT_USE_FRAMEWORKS )
|
2006-04-27 19:07:23 +00:00
|
|
|
# Check for Window system symbols (note: only one should end up being set)
|
|
|
|
CHECK_SYMBOL_EXISTS(Q_WS_X11 "QtCore/qglobal.h" Q_WS_X11)
|
|
|
|
CHECK_SYMBOL_EXISTS(Q_WS_WIN "QtCore/qglobal.h" Q_WS_WIN)
|
2007-09-19 13:35:37 +00:00
|
|
|
CHECK_SYMBOL_EXISTS(Q_WS_QWS "QtCore/qglobal.h" Q_WS_QWS)
|
|
|
|
CHECK_SYMBOL_EXISTS(Q_WS_MAC "QtCore/qglobal.h" Q_WS_MAC)
|
2006-04-27 19:07:23 +00:00
|
|
|
|
|
|
|
IF (QT_QTCOPY_REQUIRED)
|
2007-01-03 21:01:59 +00:00
|
|
|
CHECK_SYMBOL_EXISTS(QT_IS_QTCOPY "QtCore/qglobal.h" QT_KDE_QT_COPY)
|
|
|
|
IF (NOT QT_IS_QTCOPY)
|
|
|
|
MESSAGE(FATAL_ERROR "qt-copy is required, but hasn't been found")
|
|
|
|
ENDIF (NOT QT_IS_QTCOPY)
|
2006-04-27 19:07:23 +00:00
|
|
|
ENDIF (QT_QTCOPY_REQUIRED)
|
|
|
|
|
2007-09-19 13:35:37 +00:00
|
|
|
# Restore CMAKE_REQUIRED_INCLUDES and CMAKE_REQUIRED_FLAGS variables
|
2006-04-27 19:07:23 +00:00
|
|
|
SET(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES_SAVE})
|
2007-09-19 13:35:37 +00:00
|
|
|
SET(CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS_SAVE})
|
2006-04-27 19:07:23 +00:00
|
|
|
#
|
|
|
|
#############################################
|
|
|
|
|
2005-09-12 13:00:55 +00:00
|
|
|
IF (QT_USE_FRAMEWORKS)
|
2006-04-27 19:07:23 +00:00
|
|
|
SET(QT_DEFINITIONS ${QT_DEFINITIONS} -F${QT_LIBRARY_DIR} -L${QT_LIBRARY_DIR} )
|
2005-09-12 13:00:55 +00:00
|
|
|
ENDIF (QT_USE_FRAMEWORKS)
|
2005-08-02 20:34:23 +00:00
|
|
|
|
2005-09-12 13:00:55 +00:00
|
|
|
# Set QT_QT3SUPPORT_INCLUDE_DIR
|
2006-04-27 19:07:23 +00:00
|
|
|
FIND_PATH(QT_QT3SUPPORT_INCLUDE_DIR Qt3Support
|
|
|
|
PATHS
|
2005-09-12 13:00:55 +00:00
|
|
|
${QT_INCLUDE_DIR}/Qt3Support
|
|
|
|
${QT_LIBRARY_DIR}/Qt3Support.framework/Headers
|
2006-04-27 19:07:23 +00:00
|
|
|
NO_DEFAULT_PATH
|
2005-09-12 13:00:55 +00:00
|
|
|
)
|
2005-08-02 20:34:23 +00:00
|
|
|
|
2006-04-27 19:07:23 +00:00
|
|
|
# Set QT_QT_INCLUDE_DIR
|
|
|
|
FIND_PATH(QT_QT_INCLUDE_DIR qglobal.h
|
|
|
|
PATHS
|
|
|
|
${QT_INCLUDE_DIR}/Qt
|
2005-09-12 13:00:55 +00:00
|
|
|
${QT_LIBRARY_DIR}/QtCore.framework/Headers
|
2006-04-27 19:07:23 +00:00
|
|
|
NO_DEFAULT_PATH
|
2005-09-12 13:00:55 +00:00
|
|
|
)
|
2005-08-02 20:34:23 +00:00
|
|
|
|
2005-09-12 13:00:55 +00:00
|
|
|
# Set QT_QTGUI_INCLUDE_DIR
|
2006-04-27 19:07:23 +00:00
|
|
|
FIND_PATH(QT_QTGUI_INCLUDE_DIR QtGui
|
|
|
|
PATHS
|
2005-09-12 13:00:55 +00:00
|
|
|
${QT_INCLUDE_DIR}/QtGui
|
|
|
|
${QT_LIBRARY_DIR}/QtGui.framework/Headers
|
2006-04-27 19:07:23 +00:00
|
|
|
NO_DEFAULT_PATH
|
|
|
|
)
|
|
|
|
|
|
|
|
# Set QT_QTSVG_INCLUDE_DIR
|
|
|
|
FIND_PATH(QT_QTSVG_INCLUDE_DIR QtSvg
|
|
|
|
PATHS
|
|
|
|
${QT_INCLUDE_DIR}/QtSvg
|
|
|
|
${QT_LIBRARY_DIR}/QtSvg.framework/Headers
|
|
|
|
NO_DEFAULT_PATH
|
|
|
|
)
|
|
|
|
|
2007-08-21 20:50:49 +00:00
|
|
|
# Set QT_QTSCRIPT_INCLUDE_DIR
|
|
|
|
FIND_PATH(QT_QTSCRIPT_INCLUDE_DIR QtScript
|
|
|
|
PATHS
|
|
|
|
${QT_INCLUDE_DIR}/QtScript
|
|
|
|
${QT_LIBRARY_DIR}/QtScript.framework/Headers
|
|
|
|
NO_DEFAULT_PATH
|
|
|
|
)
|
|
|
|
|
2006-04-27 19:07:23 +00:00
|
|
|
# Set QT_QTTEST_INCLUDE_DIR
|
|
|
|
FIND_PATH(QT_QTTEST_INCLUDE_DIR QtTest
|
|
|
|
PATHS
|
|
|
|
${QT_INCLUDE_DIR}/QtTest
|
|
|
|
${QT_LIBRARY_DIR}/QtTest.framework/Headers
|
|
|
|
NO_DEFAULT_PATH
|
2005-09-12 13:00:55 +00:00
|
|
|
)
|
2005-08-02 20:34:23 +00:00
|
|
|
|
2006-04-27 19:07:23 +00:00
|
|
|
# Set QT_QTUITOOLS_INCLUDE_DIR
|
2006-10-02 13:03:17 +00:00
|
|
|
FIND_PATH(QT_QTUITOOLS_INCLUDE_DIR QtUiTools
|
2006-04-27 19:07:23 +00:00
|
|
|
PATHS
|
|
|
|
${QT_INCLUDE_DIR}/QtUiTools
|
|
|
|
${QT_LIBRARY_DIR}/QtUiTools.framework/Headers
|
|
|
|
NO_DEFAULT_PATH
|
|
|
|
)
|
|
|
|
|
2005-09-12 13:00:55 +00:00
|
|
|
# Set QT_QTMOTIF_INCLUDE_DIR
|
2006-04-27 19:07:23 +00:00
|
|
|
IF(Q_WS_X11)
|
2008-03-13 19:29:28 +00:00
|
|
|
FIND_PATH(QT_QTMOTIF_INCLUDE_DIR QtMotif
|
|
|
|
PATHS
|
|
|
|
${QT_INCLUDE_DIR}/QtMotif
|
|
|
|
NO_DEFAULT_PATH )
|
2006-04-27 19:07:23 +00:00
|
|
|
ENDIF(Q_WS_X11)
|
2005-08-02 20:34:23 +00:00
|
|
|
|
2005-09-12 13:00:55 +00:00
|
|
|
# Set QT_QTNETWORK_INCLUDE_DIR
|
2006-04-27 19:07:23 +00:00
|
|
|
FIND_PATH(QT_QTNETWORK_INCLUDE_DIR QtNetwork
|
|
|
|
PATHS
|
2005-09-12 13:00:55 +00:00
|
|
|
${QT_INCLUDE_DIR}/QtNetwork
|
|
|
|
${QT_LIBRARY_DIR}/QtNetwork.framework/Headers
|
2006-04-27 19:07:23 +00:00
|
|
|
NO_DEFAULT_PATH
|
2005-09-12 13:00:55 +00:00
|
|
|
)
|
2005-08-02 20:34:23 +00:00
|
|
|
|
2005-09-12 13:00:55 +00:00
|
|
|
# Set QT_QTNSPLUGIN_INCLUDE_DIR
|
2006-04-27 19:07:23 +00:00
|
|
|
FIND_PATH(QT_QTNSPLUGIN_INCLUDE_DIR QtNsPlugin
|
|
|
|
PATHS
|
2005-09-12 13:00:55 +00:00
|
|
|
${QT_INCLUDE_DIR}/QtNsPlugin
|
|
|
|
${QT_LIBRARY_DIR}/QtNsPlugin.framework/Headers
|
2006-04-27 19:07:23 +00:00
|
|
|
NO_DEFAULT_PATH
|
2005-09-12 13:00:55 +00:00
|
|
|
)
|
2005-08-02 20:34:23 +00:00
|
|
|
|
2005-09-12 13:00:55 +00:00
|
|
|
# Set QT_QTOPENGL_INCLUDE_DIR
|
2006-04-27 19:07:23 +00:00
|
|
|
FIND_PATH(QT_QTOPENGL_INCLUDE_DIR QtOpenGL
|
|
|
|
PATHS
|
2005-09-12 13:00:55 +00:00
|
|
|
${QT_INCLUDE_DIR}/QtOpenGL
|
|
|
|
${QT_LIBRARY_DIR}/QtOpenGL.framework/Headers
|
2006-04-27 19:07:23 +00:00
|
|
|
NO_DEFAULT_PATH
|
2005-09-12 13:00:55 +00:00
|
|
|
)
|
2005-08-02 20:34:23 +00:00
|
|
|
|
2005-09-12 13:00:55 +00:00
|
|
|
# Set QT_QTSQL_INCLUDE_DIR
|
2006-04-27 19:07:23 +00:00
|
|
|
FIND_PATH(QT_QTSQL_INCLUDE_DIR QtSql
|
|
|
|
PATHS
|
2005-09-12 13:00:55 +00:00
|
|
|
${QT_INCLUDE_DIR}/QtSql
|
|
|
|
${QT_LIBRARY_DIR}/QtSql.framework/Headers
|
2006-04-27 19:07:23 +00:00
|
|
|
NO_DEFAULT_PATH
|
2005-09-12 13:00:55 +00:00
|
|
|
)
|
2005-08-02 20:34:23 +00:00
|
|
|
|
2005-09-12 13:00:55 +00:00
|
|
|
# Set QT_QTXML_INCLUDE_DIR
|
2006-04-27 19:07:23 +00:00
|
|
|
FIND_PATH(QT_QTXML_INCLUDE_DIR QtXml
|
|
|
|
PATHS
|
2005-09-12 13:00:55 +00:00
|
|
|
${QT_INCLUDE_DIR}/QtXml
|
|
|
|
${QT_LIBRARY_DIR}/QtXml.framework/Headers
|
2006-04-27 19:07:23 +00:00
|
|
|
NO_DEFAULT_PATH
|
2005-09-12 13:00:55 +00:00
|
|
|
)
|
2005-08-02 20:34:23 +00:00
|
|
|
|
2005-09-12 13:00:55 +00:00
|
|
|
# Set QT_QTASSISTANT_INCLUDE_DIR
|
2006-04-27 19:07:23 +00:00
|
|
|
FIND_PATH(QT_QTASSISTANT_INCLUDE_DIR QtAssistant
|
|
|
|
PATHS
|
2005-09-12 13:00:55 +00:00
|
|
|
${QT_INCLUDE_DIR}/QtAssistant
|
2007-02-07 16:50:57 +00:00
|
|
|
${QT_LIBRARY_DIR}/QtAssistant.framework/Headers
|
2006-04-27 19:07:23 +00:00
|
|
|
NO_DEFAULT_PATH
|
2005-09-12 13:00:55 +00:00
|
|
|
)
|
2005-08-02 20:34:23 +00:00
|
|
|
|
2005-09-12 13:00:55 +00:00
|
|
|
# Set QT_QTDESIGNER_INCLUDE_DIR
|
2006-04-27 19:07:23 +00:00
|
|
|
FIND_PATH(QT_QTDESIGNER_INCLUDE_DIR QDesignerComponents
|
|
|
|
PATHS
|
2005-09-12 13:00:55 +00:00
|
|
|
${QT_INCLUDE_DIR}/QtDesigner
|
2007-02-07 16:50:57 +00:00
|
|
|
${QT_LIBRARY_DIR}/QtDesigner.framework/Headers
|
2006-04-27 19:07:23 +00:00
|
|
|
NO_DEFAULT_PATH
|
2005-09-12 13:00:55 +00:00
|
|
|
)
|
2005-08-02 20:34:23 +00:00
|
|
|
|
2007-01-03 21:38:26 +00:00
|
|
|
# Set QT_QTDESIGNERCOMPONENTS_INCLUDE_DIR
|
|
|
|
FIND_PATH(QT_QTDESIGNERCOMPONENTS_INCLUDE_DIR QDesignerComponents
|
|
|
|
PATHS
|
|
|
|
${QT_INCLUDE_DIR}/QtDesigner
|
2008-03-13 19:29:28 +00:00
|
|
|
${QT_LIBRARY_DIR}/QtDesigner.framework/Headers
|
2007-01-03 21:38:26 +00:00
|
|
|
NO_DEFAULT_PATH
|
|
|
|
)
|
|
|
|
|
|
|
|
# Set QT_QTDBUS_INCLUDE_DIR
|
|
|
|
FIND_PATH(QT_QTDBUS_INCLUDE_DIR QtDBus
|
|
|
|
PATHS
|
|
|
|
${QT_INCLUDE_DIR}/QtDBus
|
2008-03-13 19:29:28 +00:00
|
|
|
NO_DEFAULT_PATH
|
|
|
|
)
|
|
|
|
|
|
|
|
# Set QT_QTASSISTANTCLIENT_INCLUDE_DIR
|
2008-03-14 18:28:29 +00:00
|
|
|
FIND_PATH(QT_QTASSISTANTCLIENT_INCLUDE_DIR QAssistantClient
|
2008-03-13 19:29:28 +00:00
|
|
|
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
|
2007-01-03 21:38:26 +00:00
|
|
|
NO_DEFAULT_PATH
|
|
|
|
)
|
2008-03-13 23:12:46 +00:00
|
|
|
|
|
|
|
# Set QT_PHONON_INCLUDE_DIR
|
|
|
|
FIND_PATH(QT_PHONON_INCLUDE_DIR phonon
|
|
|
|
PATHS
|
|
|
|
${QT_INCLUDE_DIR}/phonon
|
|
|
|
NO_DEFAULT_PATH
|
|
|
|
)
|
2007-01-03 21:38:26 +00:00
|
|
|
|
2005-09-12 13:00:55 +00:00
|
|
|
# Make variables changeble to the advanced user
|
2007-01-03 22:50:16 +00:00
|
|
|
MARK_AS_ADVANCED( QT_LIBRARY_DIR QT_INCLUDE_DIR QT_QT_INCLUDE_DIR QT_DOC_DIR QT_MKSPECS_DIR QT_PLUGINS_DIR)
|
2005-08-02 20:34:23 +00:00
|
|
|
|
2005-09-12 13:00:55 +00:00
|
|
|
# Set QT_INCLUDES
|
2008-03-13 19:29:28 +00:00
|
|
|
SET( QT_INCLUDES ${QT_QT_INCLUDE_DIR} ${QT_MKSPECS_DIR}/default ${QT_INCLUDE_DIR} )
|
2005-09-12 13:00:55 +00:00
|
|
|
|
2006-09-06 12:31:50 +00:00
|
|
|
# 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 )
|
|
|
|
FIND_LIBRARY(QT_QTCORE_LIBRARY_DEBUG NAMES QtCore_debug QtCored QtCored4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
|
2005-09-12 13:00:55 +00:00
|
|
|
|
2006-09-06 12:31:50 +00:00
|
|
|
# Set QT_QT3SUPPORT_LIBRARY
|
|
|
|
FIND_LIBRARY(QT_QT3SUPPORT_LIBRARY_RELEASE NAMES Qt3Support Qt3Support4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
|
|
|
|
FIND_LIBRARY(QT_QT3SUPPORT_LIBRARY_DEBUG NAMES Qt3Support_debug Qt3Supportd4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
|
2005-09-12 13:00:55 +00:00
|
|
|
|
2006-09-06 12:31:50 +00:00
|
|
|
# Set QT_QTGUI_LIBRARY
|
|
|
|
FIND_LIBRARY(QT_QTGUI_LIBRARY_RELEASE NAMES QtGui QtGui4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
|
|
|
|
FIND_LIBRARY(QT_QTGUI_LIBRARY_DEBUG NAMES QtGui_debug QtGuid4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
|
2005-09-12 13:00:55 +00:00
|
|
|
|
2006-09-06 12:31:50 +00:00
|
|
|
# Set QT_QTMOTIF_LIBRARY
|
|
|
|
IF(Q_WS_X11)
|
|
|
|
FIND_LIBRARY(QT_QTMOTIF_LIBRARY_RELEASE NAMES QtMotif PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
|
|
|
|
FIND_LIBRARY(QT_QTMOTIF_LIBRARY_DEBUG NAMES QtMotif_debug PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
|
|
|
|
ENDIF(Q_WS_X11)
|
2005-09-12 13:00:55 +00:00
|
|
|
|
2006-09-06 12:31:50 +00:00
|
|
|
# Set QT_QTNETWORK_LIBRARY
|
|
|
|
FIND_LIBRARY(QT_QTNETWORK_LIBRARY_RELEASE NAMES QtNetwork QtNetwork4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
|
|
|
|
FIND_LIBRARY(QT_QTNETWORK_LIBRARY_DEBUG NAMES QtNetwork_debug QtNetworkd4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
|
2005-09-12 13:00:55 +00:00
|
|
|
|
2006-09-06 12:31:50 +00:00
|
|
|
# Set QT_QTNSPLUGIN_LIBRARY
|
|
|
|
FIND_LIBRARY(QT_QTNSPLUGIN_LIBRARY_RELEASE NAMES QtNsPlugin PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
|
|
|
|
FIND_LIBRARY(QT_QTNSPLUGIN_LIBRARY_DEBUG NAMES QtNsPlugin_debug PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
|
2005-09-12 13:00:55 +00:00
|
|
|
|
2006-09-06 12:31:50 +00:00
|
|
|
# Set QT_QTOPENGL_LIBRARY
|
|
|
|
FIND_LIBRARY(QT_QTOPENGL_LIBRARY_RELEASE NAMES QtOpenGL QtOpenGL4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
|
|
|
|
FIND_LIBRARY(QT_QTOPENGL_LIBRARY_DEBUG NAMES QtOpenGL_debug QtOpenGLd4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
|
2005-09-12 13:00:55 +00:00
|
|
|
|
2006-09-06 12:31:50 +00:00
|
|
|
# Set QT_QTSQL_LIBRARY
|
|
|
|
FIND_LIBRARY(QT_QTSQL_LIBRARY_RELEASE NAMES QtSql QtSql4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
|
|
|
|
FIND_LIBRARY(QT_QTSQL_LIBRARY_DEBUG NAMES QtSql_debug QtSqld4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
|
2005-09-12 13:00:55 +00:00
|
|
|
|
2006-09-06 12:31:50 +00:00
|
|
|
# Set QT_QTXML_LIBRARY
|
|
|
|
FIND_LIBRARY(QT_QTXML_LIBRARY_RELEASE NAMES QtXml QtXml4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
|
|
|
|
FIND_LIBRARY(QT_QTXML_LIBRARY_DEBUG NAMES QtXml_debug QtXmld4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
|
2005-08-02 20:34:23 +00:00
|
|
|
|
2006-09-06 12:31:50 +00:00
|
|
|
# Set QT_QTSVG_LIBRARY
|
|
|
|
FIND_LIBRARY(QT_QTSVG_LIBRARY_RELEASE NAMES QtSvg QtSvg4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
|
|
|
|
FIND_LIBRARY(QT_QTSVG_LIBRARY_DEBUG NAMES QtSvg_debug QtSvgd4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
|
2005-07-15 16:14:47 +00:00
|
|
|
|
2006-09-06 12:31:50 +00:00
|
|
|
# Set QT_QTUITOOLS_LIBRARY
|
|
|
|
FIND_LIBRARY(QT_QTUITOOLS_LIBRARY_RELEASE NAMES QtUiTools QtUiTools4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
|
2007-06-08 13:28:33 +00:00
|
|
|
FIND_LIBRARY(QT_QTUITOOLS_LIBRARY_DEBUG NAMES QtUiTools_debug QtUiToolsd QtUiToolsd4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
|
2007-12-11 17:57:54 +00:00
|
|
|
# QtUiTools not with other frameworks with binary installation (in /usr/lib)
|
|
|
|
IF(Q_WS_MAC AND QT_QTCORE_LIBRARY_RELEASE AND NOT QT_QTUITOOLS_LIBRARY_RELEASE)
|
|
|
|
FIND_LIBRARY(QT_QTUITOOLS_LIBRARY_RELEASE NAMES QtUiTools PATHS ${QT_LIBRARY_DIR})
|
|
|
|
ENDIF(Q_WS_MAC AND QT_QTCORE_LIBRARY_RELEASE AND NOT QT_QTUITOOLS_LIBRARY_RELEASE)
|
2005-09-12 13:00:55 +00:00
|
|
|
|
2006-09-06 12:31:50 +00:00
|
|
|
# Set QT_QTTEST_LIBRARY
|
|
|
|
FIND_LIBRARY(QT_QTTEST_LIBRARY_RELEASE NAMES QtTest QtTest4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
|
|
|
|
FIND_LIBRARY(QT_QTTEST_LIBRARY_DEBUG NAMES QtTest_debug QtTest_debug4 QtTestd4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
|
2005-09-12 13:00:55 +00:00
|
|
|
|
2007-01-03 21:38:26 +00:00
|
|
|
# Set QT_QTDBUS_LIBRARY
|
|
|
|
# This was introduced with Qt 4.2, where also the naming scheme for debug libs was changed
|
|
|
|
# So does any of the debug lib names listed here actually exist ?
|
|
|
|
FIND_LIBRARY(QT_QTDBUS_LIBRARY_RELEASE NAMES QtDBus QtDBus4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
|
|
|
|
FIND_LIBRARY(QT_QTDBUS_LIBRARY_DEBUG NAMES QtDBus_debug QtDBus_debug4 QtDBusd4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
|
|
|
|
|
2007-08-21 20:50:49 +00:00
|
|
|
# Set QT_QTSCRIPT_LIBRARY
|
|
|
|
FIND_LIBRARY(QT_QTSCRIPT_LIBRARY_RELEASE NAMES QtScript QtScript4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
|
|
|
|
FIND_LIBRARY(QT_QTSCRIPT_LIBRARY_DEBUG NAMES QtScript_debug QtScriptd4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
|
2007-01-03 21:38:26 +00:00
|
|
|
|
2006-06-16 18:45:47 +00:00
|
|
|
IF( NOT QT_QTCORE_LIBRARY_DEBUG AND NOT QT_QTCORE_LIBRARY_RELEASE )
|
|
|
|
IF( NOT Qt4_FIND_QUIETLY AND Qt4_FIND_REQUIRED)
|
2006-08-01 19:24:46 +00:00
|
|
|
MESSAGE( FATAL_ERROR "Could NOT find QtCore. Check ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log for more details.")
|
2006-06-16 18:45:47 +00:00
|
|
|
ENDIF( NOT Qt4_FIND_QUIETLY AND Qt4_FIND_REQUIRED)
|
|
|
|
ENDIF( NOT QT_QTCORE_LIBRARY_DEBUG AND NOT QT_QTCORE_LIBRARY_RELEASE )
|
2006-04-27 19:07:23 +00:00
|
|
|
|
|
|
|
# Set QT_QTASSISTANT_LIBRARY
|
2006-11-02 22:51:36 +00:00
|
|
|
FIND_LIBRARY(QT_QTASSISTANT_LIBRARY_RELEASE NAMES QtAssistantClient QtAssistantClient4 QtAssistant QtAssistant4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
|
|
|
|
FIND_LIBRARY(QT_QTASSISTANT_LIBRARY_DEBUG NAMES QtAssistantClientd QtAssistantClientd4 QtAssistantClient_debug QtAssistant_debug QtAssistantd4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
|
2005-09-12 13:00:55 +00:00
|
|
|
|
2006-04-27 19:07:23 +00:00
|
|
|
# Set QT_QTDESIGNER_LIBRARY
|
|
|
|
FIND_LIBRARY(QT_QTDESIGNER_LIBRARY_RELEASE NAMES QtDesigner QtDesigner4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
|
|
|
|
FIND_LIBRARY(QT_QTDESIGNER_LIBRARY_DEBUG NAMES QtDesigner_debug QtDesignerd4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
|
2006-04-27 19:14:25 +00:00
|
|
|
|
2007-01-03 21:38:26 +00:00
|
|
|
# Set QT_QTDESIGNERCOMPONENTS_LIBRARY
|
|
|
|
FIND_LIBRARY(QT_QTDESIGNERCOMPONENTS_LIBRARY_RELEASE NAMES QtDesignerComponents QtDesignerComponents4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
|
2008-03-13 19:29:28 +00:00
|
|
|
FIND_LIBRARY(QT_QTDESIGNERCOMPONENTS_LIBRARY_DEBUG NAMES QtDesignerComponents_debug QtDesignerComponentsd4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
|
2007-01-03 21:38:26 +00:00
|
|
|
|
2006-08-01 13:12:18 +00:00
|
|
|
# Set QT_QTMAIN_LIBRARY
|
|
|
|
IF(WIN32)
|
|
|
|
FIND_LIBRARY(QT_QTMAIN_LIBRARY_RELEASE NAMES qtmain PATHS ${QT_LIBRARY_DIR}
|
|
|
|
NO_DEFAULT_PATH)
|
|
|
|
FIND_LIBRARY(QT_QTMAIN_LIBRARY_DEBUG NAMES qtmaind PATHS ${QT_LIBRARY_DIR}
|
|
|
|
NO_DEFAULT_PATH)
|
|
|
|
ENDIF(WIN32)
|
2008-03-13 19:29:28 +00:00
|
|
|
|
|
|
|
# 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)
|
2008-03-14 16:11:01 +00:00
|
|
|
FIND_LIBRARY(QT_QTCLUCENE_LIBRARY_RELEASE NAMES QtCLucene QtCLucene4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
|
|
|
|
FIND_LIBRARY(QT_QTCLUCENE_LIBRARY_DEBUG NAMES QtCLucene_debug QtCLucened4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
|
2008-03-13 19:29:28 +00:00
|
|
|
|
|
|
|
# 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)
|
2008-03-13 23:12:46 +00:00
|
|
|
|
|
|
|
# Set QT_PHONON_LIBRARY
|
|
|
|
FIND_LIBRARY(QT_PHONON_LIBRARY_RELEASE NAMES phonon phonon4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
|
|
|
|
FIND_LIBRARY(QT_PHONON_LIBRARY_DEBUG NAMES phonon_debug phonond4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
|
2006-08-01 13:12:18 +00:00
|
|
|
|
2005-09-12 13:00:55 +00:00
|
|
|
############################################
|
|
|
|
#
|
|
|
|
# Check the existence of the libraries.
|
|
|
|
#
|
|
|
|
############################################
|
|
|
|
|
2006-04-27 19:07:23 +00:00
|
|
|
MACRO (_QT4_ADJUST_LIB_VARS basename)
|
2007-01-03 22:32:02 +00:00
|
|
|
IF (QT_${basename}_LIBRARY_RELEASE OR QT_${basename}_LIBRARY_DEBUG)
|
2006-04-27 19:07:23 +00:00
|
|
|
|
|
|
|
# if only the release version was found, set the debug variable also to the release version
|
|
|
|
IF (QT_${basename}_LIBRARY_RELEASE AND NOT QT_${basename}_LIBRARY_DEBUG)
|
|
|
|
SET(QT_${basename}_LIBRARY_DEBUG ${QT_${basename}_LIBRARY_RELEASE})
|
|
|
|
SET(QT_${basename}_LIBRARY ${QT_${basename}_LIBRARY_RELEASE})
|
|
|
|
SET(QT_${basename}_LIBRARIES ${QT_${basename}_LIBRARY_RELEASE})
|
|
|
|
ENDIF (QT_${basename}_LIBRARY_RELEASE AND NOT QT_${basename}_LIBRARY_DEBUG)
|
|
|
|
|
|
|
|
# if only the debug version was found, set the release variable also to the debug version
|
|
|
|
IF (QT_${basename}_LIBRARY_DEBUG AND NOT QT_${basename}_LIBRARY_RELEASE)
|
|
|
|
SET(QT_${basename}_LIBRARY_RELEASE ${QT_${basename}_LIBRARY_DEBUG})
|
|
|
|
SET(QT_${basename}_LIBRARY ${QT_${basename}_LIBRARY_DEBUG})
|
|
|
|
SET(QT_${basename}_LIBRARIES ${QT_${basename}_LIBRARY_DEBUG})
|
|
|
|
ENDIF (QT_${basename}_LIBRARY_DEBUG AND NOT QT_${basename}_LIBRARY_RELEASE)
|
2007-01-03 22:32:02 +00:00
|
|
|
|
2006-04-27 19:07:23 +00:00
|
|
|
IF (QT_${basename}_LIBRARY_DEBUG AND QT_${basename}_LIBRARY_RELEASE)
|
2006-08-01 16:27:53 +00:00
|
|
|
# if the generator supports configuration types then set
|
|
|
|
# optimized and debug libraries, or if the CMAKE_BUILD_TYPE has a value
|
|
|
|
IF (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
|
2006-06-16 18:45:47 +00:00
|
|
|
SET(QT_${basename}_LIBRARY optimized ${QT_${basename}_LIBRARY_RELEASE} debug ${QT_${basename}_LIBRARY_DEBUG})
|
2006-08-01 16:27:53 +00:00
|
|
|
ELSE(CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
|
|
|
|
# if there are no configuration types and CMAKE_BUILD_TYPE has no value
|
|
|
|
# then just use the release libraries
|
|
|
|
SET(QT_${basename}_LIBRARY ${QT_${basename}_LIBRARY_RELEASE} )
|
|
|
|
ENDIF(CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
|
2006-04-27 19:07:23 +00:00
|
|
|
SET(QT_${basename}_LIBRARIES optimized ${QT_${basename}_LIBRARY_RELEASE} debug ${QT_${basename}_LIBRARY_DEBUG})
|
|
|
|
ENDIF (QT_${basename}_LIBRARY_DEBUG AND QT_${basename}_LIBRARY_RELEASE)
|
|
|
|
|
|
|
|
SET(QT_${basename}_LIBRARY ${QT_${basename}_LIBRARY} CACHE FILEPATH "The Qt ${basename} library")
|
|
|
|
|
|
|
|
IF (QT_${basename}_LIBRARY)
|
|
|
|
SET(QT_${basename}_FOUND 1)
|
|
|
|
ENDIF (QT_${basename}_LIBRARY)
|
|
|
|
|
2007-01-03 22:32:02 +00:00
|
|
|
ENDIF (QT_${basename}_LIBRARY_RELEASE OR QT_${basename}_LIBRARY_DEBUG)
|
|
|
|
|
|
|
|
IF (QT_${basename}_INCLUDE_DIR)
|
2006-04-27 19:07:23 +00:00
|
|
|
#add the include directory to QT_INCLUDES
|
2008-03-13 19:29:28 +00:00
|
|
|
SET(QT_INCLUDES "${QT_${basename}_INCLUDE_DIR}" ${QT_INCLUDES})
|
2007-01-03 22:32:02 +00:00
|
|
|
ENDIF (QT_${basename}_INCLUDE_DIR)
|
2006-04-27 19:07:23 +00:00
|
|
|
|
|
|
|
# Make variables changeble to the advanced user
|
|
|
|
MARK_AS_ADVANCED(QT_${basename}_LIBRARY QT_${basename}_LIBRARY_RELEASE QT_${basename}_LIBRARY_DEBUG QT_${basename}_INCLUDE_DIR)
|
|
|
|
ENDMACRO (_QT4_ADJUST_LIB_VARS)
|
|
|
|
|
|
|
|
|
2007-01-03 22:32:02 +00:00
|
|
|
# Set QT_xyz_LIBRARY variable and add
|
|
|
|
# library include path to QT_INCLUDES
|
2006-04-27 19:07:23 +00:00
|
|
|
_QT4_ADJUST_LIB_VARS(QTCORE)
|
|
|
|
_QT4_ADJUST_LIB_VARS(QTGUI)
|
|
|
|
_QT4_ADJUST_LIB_VARS(QT3SUPPORT)
|
|
|
|
_QT4_ADJUST_LIB_VARS(QTASSISTANT)
|
|
|
|
_QT4_ADJUST_LIB_VARS(QTDESIGNER)
|
2007-01-03 21:38:26 +00:00
|
|
|
_QT4_ADJUST_LIB_VARS(QTDESIGNERCOMPONENTS)
|
2006-04-27 19:07:23 +00:00
|
|
|
_QT4_ADJUST_LIB_VARS(QTNETWORK)
|
|
|
|
_QT4_ADJUST_LIB_VARS(QTNSPLUGIN)
|
|
|
|
_QT4_ADJUST_LIB_VARS(QTOPENGL)
|
|
|
|
_QT4_ADJUST_LIB_VARS(QTSQL)
|
|
|
|
_QT4_ADJUST_LIB_VARS(QTXML)
|
|
|
|
_QT4_ADJUST_LIB_VARS(QTSVG)
|
2007-08-21 20:50:49 +00:00
|
|
|
_QT4_ADJUST_LIB_VARS(QTSCRIPT)
|
2006-04-27 19:07:23 +00:00
|
|
|
_QT4_ADJUST_LIB_VARS(QTUITOOLS)
|
|
|
|
_QT4_ADJUST_LIB_VARS(QTTEST)
|
2007-01-03 21:38:26 +00:00
|
|
|
_QT4_ADJUST_LIB_VARS(QTDBUS)
|
2008-03-13 19:29:28 +00:00
|
|
|
_QT4_ADJUST_LIB_VARS(QTASSISTANTCLIENT)
|
|
|
|
_QT4_ADJUST_LIB_VARS(QTHELP)
|
|
|
|
_QT4_ADJUST_LIB_VARS(QTWEBKIT)
|
|
|
|
_QT4_ADJUST_LIB_VARS(QTXMLPATTERNS)
|
2008-03-13 23:12:46 +00:00
|
|
|
_QT4_ADJUST_LIB_VARS(PHONON)
|
2008-03-14 16:11:01 +00:00
|
|
|
_QT4_ADJUST_LIB_VARS(QTCLUCENE)
|
2007-09-27 00:53:29 +00:00
|
|
|
|
2007-01-03 21:38:26 +00:00
|
|
|
# platform dependent libraries
|
|
|
|
IF(Q_WS_X11)
|
|
|
|
_QT4_ADJUST_LIB_VARS(QTMOTIF)
|
|
|
|
ENDIF(Q_WS_X11)
|
2007-01-03 22:32:02 +00:00
|
|
|
IF(WIN32)
|
|
|
|
_QT4_ADJUST_LIB_VARS(QTMAIN)
|
|
|
|
ENDIF(WIN32)
|
|
|
|
|
2006-09-06 12:31:50 +00:00
|
|
|
|
2005-09-12 13:00:55 +00:00
|
|
|
#######################################
|
|
|
|
#
|
2006-05-19 20:57:49 +00:00
|
|
|
# Check the executables of Qt
|
2005-09-12 13:00:55 +00:00
|
|
|
# ( moc, uic, rcc )
|
|
|
|
#
|
|
|
|
#######################################
|
2005-07-15 16:14:47 +00:00
|
|
|
|
2005-09-12 13:00:55 +00:00
|
|
|
|
2006-10-04 14:33:10 +00:00
|
|
|
# find moc and uic using qmake
|
|
|
|
QT_QUERY_QMAKE(QT_MOC_EXECUTABLE_INTERNAL "QMAKE_MOC")
|
|
|
|
QT_QUERY_QMAKE(QT_UIC_EXECUTABLE_INTERNAL "QMAKE_UIC")
|
2006-06-14 16:28:32 +00:00
|
|
|
|
2006-10-04 14:33:10 +00:00
|
|
|
FILE(TO_CMAKE_PATH
|
|
|
|
"${QT_MOC_EXECUTABLE_INTERNAL}" QT_MOC_EXECUTABLE_INTERNAL)
|
|
|
|
FILE(TO_CMAKE_PATH
|
|
|
|
"${QT_UIC_EXECUTABLE_INTERNAL}" QT_UIC_EXECUTABLE_INTERNAL)
|
2006-06-14 16:28:32 +00:00
|
|
|
|
2006-10-04 14:33:10 +00:00
|
|
|
SET(QT_MOC_EXECUTABLE
|
|
|
|
${QT_MOC_EXECUTABLE_INTERNAL} CACHE FILEPATH "The moc executable")
|
|
|
|
SET(QT_UIC_EXECUTABLE
|
|
|
|
${QT_UIC_EXECUTABLE_INTERNAL} CACHE FILEPATH "The uic executable")
|
2006-05-19 20:57:49 +00:00
|
|
|
|
2006-04-27 19:07:23 +00:00
|
|
|
FIND_PROGRAM(QT_UIC3_EXECUTABLE
|
|
|
|
NAMES uic3
|
|
|
|
PATHS ${QT_BINARY_DIR}
|
|
|
|
NO_DEFAULT_PATH
|
|
|
|
)
|
|
|
|
|
2006-05-19 20:57:49 +00:00
|
|
|
FIND_PROGRAM(QT_RCC_EXECUTABLE
|
2005-09-12 13:00:55 +00:00
|
|
|
NAMES rcc
|
2006-04-27 19:07:23 +00:00
|
|
|
PATHS ${QT_BINARY_DIR}
|
|
|
|
NO_DEFAULT_PATH
|
2005-09-12 13:00:55 +00:00
|
|
|
)
|
2005-07-15 16:14:47 +00:00
|
|
|
|
2007-01-03 21:01:59 +00:00
|
|
|
FIND_PROGRAM(QT_DBUSCPP2XML_EXECUTABLE
|
|
|
|
NAMES qdbuscpp2xml
|
|
|
|
PATHS ${QT_BINARY_DIR}
|
|
|
|
NO_DEFAULT_PATH
|
|
|
|
)
|
|
|
|
|
|
|
|
FIND_PROGRAM(QT_DBUSXML2CPP_EXECUTABLE
|
|
|
|
NAMES qdbusxml2cpp
|
|
|
|
PATHS ${QT_BINARY_DIR}
|
|
|
|
NO_DEFAULT_PATH
|
|
|
|
)
|
|
|
|
|
2008-01-22 15:11:29 +00:00
|
|
|
FIND_PROGRAM(QT_LUPDATE_EXECUTABLE
|
|
|
|
NAMES lupdate
|
|
|
|
PATHS ${QT_BINARY_DIR}
|
|
|
|
NO_DEFAULT_PATH
|
|
|
|
)
|
|
|
|
|
|
|
|
FIND_PROGRAM(QT_LRELEASE_EXECUTABLE
|
|
|
|
NAMES lrelease
|
|
|
|
PATHS ${QT_BINARY_DIR}
|
|
|
|
NO_DEFAULT_PATH
|
|
|
|
)
|
|
|
|
|
2006-04-27 19:07:23 +00:00
|
|
|
IF (QT_MOC_EXECUTABLE)
|
2007-01-03 21:01:59 +00:00
|
|
|
SET(QT_WRAP_CPP "YES")
|
2006-04-27 19:07:23 +00:00
|
|
|
ENDIF (QT_MOC_EXECUTABLE)
|
|
|
|
|
|
|
|
IF (QT_UIC_EXECUTABLE)
|
2007-01-03 21:01:59 +00:00
|
|
|
SET(QT_WRAP_UI "YES")
|
2006-04-27 19:07:23 +00:00
|
|
|
ENDIF (QT_UIC_EXECUTABLE)
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-01-29 22:01:00 +00:00
|
|
|
MARK_AS_ADVANCED( QT_UIC_EXECUTABLE QT_UIC3_EXECUTABLE QT_MOC_EXECUTABLE
|
|
|
|
QT_RCC_EXECUTABLE QT_DBUSXML2CPP_EXECUTABLE QT_DBUSCPP2XML_EXECUTABLE
|
|
|
|
QT_LUPDATE_EXECUTABLE QT_LRELEASE_EXECUTABLE)
|
2005-09-12 13:00:55 +00:00
|
|
|
|
|
|
|
######################################
|
|
|
|
#
|
|
|
|
# Macros for building Qt files
|
|
|
|
#
|
|
|
|
######################################
|
|
|
|
|
2007-12-19 21:48:04 +00:00
|
|
|
MACRO (QT4_EXTRACT_OPTIONS _qt4_files _qt4_options)
|
|
|
|
SET(${_qt4_files})
|
|
|
|
SET(${_qt4_options})
|
|
|
|
SET(_QT4_DOING_OPTIONS FALSE)
|
|
|
|
FOREACH(_currentArg ${ARGN})
|
|
|
|
IF ("${_currentArg}" STREQUAL "OPTIONS")
|
|
|
|
SET(_QT4_DOING_OPTIONS TRUE)
|
|
|
|
ELSE ("${_currentArg}" STREQUAL "OPTIONS")
|
|
|
|
IF(_QT4_DOING_OPTIONS)
|
|
|
|
LIST(APPEND ${_qt4_options} "${_currentArg}")
|
|
|
|
ELSE(_QT4_DOING_OPTIONS)
|
|
|
|
LIST(APPEND ${_qt4_files} "${_currentArg}")
|
|
|
|
ENDIF(_QT4_DOING_OPTIONS)
|
|
|
|
ENDIF ("${_currentArg}" STREQUAL "OPTIONS")
|
|
|
|
ENDFOREACH(_currentArg)
|
2007-12-14 21:56:25 +00:00
|
|
|
ENDMACRO (QT4_EXTRACT_OPTIONS)
|
2008-01-29 18:07:52 +00:00
|
|
|
|
|
|
|
# macro used to create the names of output files preserving relative dirs
|
|
|
|
MACRO (QT4_MAKE_OUTPUT_FILE infile prefix ext outfile )
|
2008-02-14 06:11:20 +00:00
|
|
|
FILE(RELATIVE_PATH rel ${CMAKE_CURRENT_SOURCE_DIR} ${infile})
|
2008-01-29 18:07:52 +00:00
|
|
|
SET(_outfile "${CMAKE_CURRENT_BINARY_DIR}/${rel}")
|
|
|
|
GET_FILENAME_COMPONENT(outpath ${_outfile} PATH)
|
|
|
|
GET_FILENAME_COMPONENT(_outfile ${_outfile} NAME_WE)
|
|
|
|
FILE(MAKE_DIRECTORY ${outpath})
|
|
|
|
SET(${outfile} ${outpath}/${prefix}${_outfile}.${ext})
|
|
|
|
ENDMACRO (QT4_MAKE_OUTPUT_FILE )
|
2007-12-14 21:56:25 +00:00
|
|
|
|
2006-04-27 19:07:23 +00:00
|
|
|
MACRO (QT4_GET_MOC_INC_DIRS _moc_INC_DIRS)
|
2007-01-03 21:01:59 +00:00
|
|
|
SET(${_moc_INC_DIRS})
|
|
|
|
GET_DIRECTORY_PROPERTY(_inc_DIRS INCLUDE_DIRECTORIES)
|
2006-04-27 19:07:23 +00:00
|
|
|
|
2007-01-03 21:01:59 +00:00
|
|
|
FOREACH(_current ${_inc_DIRS})
|
|
|
|
SET(${_moc_INC_DIRS} ${${_moc_INC_DIRS}} "-I" ${_current})
|
|
|
|
ENDFOREACH(_current ${_inc_DIRS})
|
2007-12-16 10:49:23 +00:00
|
|
|
|
2006-04-27 19:07:23 +00:00
|
|
|
ENDMACRO(QT4_GET_MOC_INC_DIRS)
|
|
|
|
|
2008-01-11 17:40:24 +00:00
|
|
|
# helper macro to set up a moc rule
|
|
|
|
MACRO (QT4_CREATE_MOC_COMMAND infile outfile moc_includes moc_options)
|
|
|
|
# For Windows, create a parameters file to work around command line length limit
|
|
|
|
IF (WIN32)
|
2008-02-13 19:35:10 +00:00
|
|
|
# Pass the parameters in a file. Set the working directory to
|
|
|
|
# be that containing the parameters file and reference it by
|
|
|
|
# just the file name. This is necessary because the moc tool on
|
|
|
|
# MinGW builds does not seem to handle spaces in the path to the
|
|
|
|
# file given with the @ syntax.
|
|
|
|
GET_FILENAME_COMPONENT(_moc_outfile_name "${outfile}" NAME)
|
|
|
|
GET_FILENAME_COMPONENT(_moc_outfile_dir "${outfile}" PATH)
|
|
|
|
IF(_moc_outfile_dir)
|
|
|
|
SET(_moc_working_dir WORKING_DIRECTORY ${_moc_outfile_dir})
|
|
|
|
ENDIF(_moc_outfile_dir)
|
2008-01-11 17:40:24 +00:00
|
|
|
SET (_moc_parameters_file ${outfile}_parameters)
|
|
|
|
SET (_moc_parameters ${moc_includes} ${moc_options} -o "${outfile}" "${infile}")
|
|
|
|
FILE (REMOVE ${_moc_parameters_file})
|
|
|
|
FOREACH(arg ${_moc_parameters})
|
|
|
|
FILE (APPEND ${_moc_parameters_file} "${arg}\n")
|
|
|
|
ENDFOREACH(arg)
|
|
|
|
ADD_CUSTOM_COMMAND(OUTPUT ${outfile}
|
2008-02-13 19:35:10 +00:00
|
|
|
COMMAND ${QT_MOC_EXECUTABLE} @${_moc_outfile_name}_parameters
|
2008-02-08 17:01:54 +00:00
|
|
|
DEPENDS ${infile}
|
2008-02-13 19:35:10 +00:00
|
|
|
${_moc_working_dir}
|
2008-02-08 17:01:54 +00:00
|
|
|
VERBATIM)
|
2008-01-11 17:40:24 +00:00
|
|
|
ELSE (WIN32)
|
|
|
|
ADD_CUSTOM_COMMAND(OUTPUT ${outfile}
|
|
|
|
COMMAND ${QT_MOC_EXECUTABLE}
|
|
|
|
ARGS ${moc_includes} ${moc_options} -o ${outfile} ${infile}
|
|
|
|
DEPENDS ${infile})
|
|
|
|
ENDIF (WIN32)
|
|
|
|
ENDMACRO (QT4_CREATE_MOC_COMMAND)
|
2006-04-27 19:07:23 +00:00
|
|
|
|
2008-01-11 17:40:24 +00:00
|
|
|
|
2006-04-27 19:07:23 +00:00
|
|
|
MACRO (QT4_GENERATE_MOC infile outfile )
|
2007-01-03 22:00:36 +00:00
|
|
|
QT4_GET_MOC_INC_DIRS(moc_includes)
|
|
|
|
GET_FILENAME_COMPONENT(abs_infile ${infile} ABSOLUTE)
|
2008-01-11 17:40:24 +00:00
|
|
|
QT4_CREATE_MOC_COMMAND(${abs_infile} ${outfile} "${moc_includes}" "")
|
2007-01-03 22:00:36 +00:00
|
|
|
SET_SOURCE_FILES_PROPERTIES(${outfile} PROPERTIES SKIP_AUTOMOC TRUE) # dont run automoc on this file
|
2006-04-27 19:07:23 +00:00
|
|
|
ENDMACRO (QT4_GENERATE_MOC)
|
|
|
|
|
2005-09-12 13:00:55 +00:00
|
|
|
|
|
|
|
# QT4_WRAP_CPP(outfiles inputfile ... )
|
|
|
|
|
2006-04-27 19:07:23 +00:00
|
|
|
MACRO (QT4_WRAP_CPP outfiles )
|
2005-09-12 13:00:55 +00:00
|
|
|
# get include dirs
|
2006-04-27 19:07:23 +00:00
|
|
|
QT4_GET_MOC_INC_DIRS(moc_includes)
|
2007-12-14 21:56:25 +00:00
|
|
|
QT4_EXTRACT_OPTIONS(moc_files moc_options ${ARGN})
|
2005-09-12 13:00:55 +00:00
|
|
|
|
2007-12-14 21:56:25 +00:00
|
|
|
FOREACH (it ${moc_files})
|
2006-04-27 19:07:23 +00:00
|
|
|
GET_FILENAME_COMPONENT(it ${it} ABSOLUTE)
|
2008-01-29 18:07:52 +00:00
|
|
|
QT4_MAKE_OUTPUT_FILE(${it} moc_ cxx outfile)
|
2008-01-11 17:40:24 +00:00
|
|
|
QT4_CREATE_MOC_COMMAND(${it} ${outfile} "${moc_includes}" "${moc_options}")
|
2005-09-12 13:00:55 +00:00
|
|
|
SET(${outfiles} ${${outfiles}} ${outfile})
|
|
|
|
ENDFOREACH(it)
|
|
|
|
|
2006-04-27 19:07:23 +00:00
|
|
|
ENDMACRO (QT4_WRAP_CPP)
|
2005-09-12 13:00:55 +00:00
|
|
|
|
|
|
|
|
|
|
|
# QT4_WRAP_UI(outfiles inputfile ... )
|
|
|
|
|
2006-04-27 19:07:23 +00:00
|
|
|
MACRO (QT4_WRAP_UI outfiles )
|
2007-12-14 21:56:25 +00:00
|
|
|
QT4_EXTRACT_OPTIONS(ui_files ui_options ${ARGN})
|
2005-09-12 13:00:55 +00:00
|
|
|
|
2007-12-14 21:56:25 +00:00
|
|
|
FOREACH (it ${ui_files})
|
2005-09-12 13:00:55 +00:00
|
|
|
GET_FILENAME_COMPONENT(outfile ${it} NAME_WE)
|
2006-05-11 14:41:42 +00:00
|
|
|
GET_FILENAME_COMPONENT(infile ${it} ABSOLUTE)
|
2005-09-12 13:00:55 +00:00
|
|
|
SET(outfile ${CMAKE_CURRENT_BINARY_DIR}/ui_${outfile}.h)
|
|
|
|
ADD_CUSTOM_COMMAND(OUTPUT ${outfile}
|
|
|
|
COMMAND ${QT_UIC_EXECUTABLE}
|
2007-12-14 21:56:25 +00:00
|
|
|
ARGS ${ui_options} -o ${outfile} ${infile}
|
2005-09-12 13:00:55 +00:00
|
|
|
MAIN_DEPENDENCY ${infile})
|
|
|
|
SET(${outfiles} ${${outfiles}} ${outfile})
|
2006-04-27 19:07:23 +00:00
|
|
|
ENDFOREACH (it)
|
|
|
|
|
|
|
|
ENDMACRO (QT4_WRAP_UI)
|
2005-09-12 13:00:55 +00:00
|
|
|
|
|
|
|
|
2007-02-20 20:15:55 +00:00
|
|
|
# QT4_ADD_RESOURCES(outfiles inputfile ... )
|
2005-09-12 13:00:55 +00:00
|
|
|
|
2006-04-27 19:07:23 +00:00
|
|
|
MACRO (QT4_ADD_RESOURCES outfiles )
|
2007-12-14 21:56:25 +00:00
|
|
|
QT4_EXTRACT_OPTIONS(rcc_files rcc_options ${ARGN})
|
2005-09-12 13:00:55 +00:00
|
|
|
|
2007-12-14 21:56:25 +00:00
|
|
|
FOREACH (it ${rcc_files})
|
2005-09-12 13:00:55 +00:00
|
|
|
GET_FILENAME_COMPONENT(outfilename ${it} NAME_WE)
|
2006-05-11 14:41:42 +00:00
|
|
|
GET_FILENAME_COMPONENT(infile ${it} ABSOLUTE)
|
2006-11-13 19:22:08 +00:00
|
|
|
GET_FILENAME_COMPONENT(rc_path ${infile} PATH)
|
2005-09-12 13:00:55 +00:00
|
|
|
SET(outfile ${CMAKE_CURRENT_BINARY_DIR}/qrc_${outfilename}.cxx)
|
2007-02-02 21:51:51 +00:00
|
|
|
# parse file for dependencies
|
|
|
|
# all files are absolute paths or relative to the location of the qrc file
|
2006-11-13 19:22:08 +00:00
|
|
|
FILE(READ "${infile}" _RC_FILE_CONTENTS)
|
2007-01-31 20:06:07 +00:00
|
|
|
STRING(REGEX MATCHALL "<file[^<]+" _RC_FILES "${_RC_FILE_CONTENTS}")
|
2006-11-13 19:22:08 +00:00
|
|
|
SET(_RC_DEPENDS)
|
|
|
|
FOREACH(_RC_FILE ${_RC_FILES})
|
2007-01-31 20:06:07 +00:00
|
|
|
STRING(REGEX REPLACE "^<file[^>]*>" "" _RC_FILE "${_RC_FILE}")
|
2007-02-02 21:51:51 +00:00
|
|
|
STRING(REGEX MATCH "^/|([A-Za-z]:/)" _ABS_PATH_INDICATOR "${_RC_FILE}")
|
|
|
|
IF(NOT _ABS_PATH_INDICATOR)
|
|
|
|
SET(_RC_FILE "${rc_path}/${_RC_FILE}")
|
|
|
|
ENDIF(NOT _ABS_PATH_INDICATOR)
|
|
|
|
SET(_RC_DEPENDS ${_RC_DEPENDS} "${_RC_FILE}")
|
2006-11-13 19:22:08 +00:00
|
|
|
ENDFOREACH(_RC_FILE)
|
2005-09-12 13:00:55 +00:00
|
|
|
ADD_CUSTOM_COMMAND(OUTPUT ${outfile}
|
|
|
|
COMMAND ${QT_RCC_EXECUTABLE}
|
2007-12-14 21:56:25 +00:00
|
|
|
ARGS ${rcc_options} -name ${outfilename} -o ${outfile} ${infile}
|
2006-11-13 19:22:08 +00:00
|
|
|
MAIN_DEPENDENCY ${infile}
|
|
|
|
DEPENDS ${_RC_DEPENDS})
|
2005-09-12 13:00:55 +00:00
|
|
|
SET(${outfiles} ${${outfiles}} ${outfile})
|
2006-04-27 19:07:23 +00:00
|
|
|
ENDFOREACH (it)
|
|
|
|
|
|
|
|
ENDMACRO (QT4_ADD_RESOURCES)
|
|
|
|
|
2007-01-03 23:20:55 +00:00
|
|
|
MACRO(QT4_ADD_DBUS_INTERFACE _sources _interface _basename)
|
|
|
|
GET_FILENAME_COMPONENT(_infile ${_interface} ABSOLUTE)
|
|
|
|
SET(_header ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.h)
|
|
|
|
SET(_impl ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.cpp)
|
|
|
|
SET(_moc ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.moc)
|
|
|
|
|
|
|
|
ADD_CUSTOM_COMMAND(OUTPUT ${_impl} ${_header}
|
|
|
|
COMMAND ${QT_DBUSXML2CPP_EXECUTABLE} -m -p ${_basename} ${_infile}
|
|
|
|
DEPENDS ${_infile})
|
|
|
|
|
|
|
|
SET_SOURCE_FILES_PROPERTIES(${_impl} PROPERTIES SKIP_AUTOMOC TRUE)
|
|
|
|
|
|
|
|
QT4_GENERATE_MOC(${_header} ${_moc})
|
|
|
|
|
|
|
|
SET(${_sources} ${${_sources}} ${_impl} ${_header} ${_moc})
|
|
|
|
MACRO_ADD_FILE_DEPENDENCIES(${_impl} ${_moc})
|
|
|
|
|
|
|
|
ENDMACRO(QT4_ADD_DBUS_INTERFACE)
|
|
|
|
|
|
|
|
|
|
|
|
MACRO(QT4_ADD_DBUS_INTERFACES _sources)
|
|
|
|
FOREACH (_current_FILE ${ARGN})
|
|
|
|
GET_FILENAME_COMPONENT(_infile ${_current_FILE} ABSOLUTE)
|
2007-12-16 10:49:23 +00:00
|
|
|
# get the part before the ".xml" suffix
|
2007-01-03 23:20:55 +00:00
|
|
|
STRING(REGEX REPLACE "(.*[/\\.])?([^\\.]+)\\.xml" "\\2" _basename ${_current_FILE})
|
|
|
|
STRING(TOLOWER ${_basename} _basename)
|
|
|
|
QT4_ADD_DBUS_INTERFACE(${_sources} ${_infile} ${_basename}interface)
|
|
|
|
ENDFOREACH (_current_FILE)
|
|
|
|
ENDMACRO(QT4_ADD_DBUS_INTERFACES)
|
|
|
|
|
|
|
|
|
|
|
|
MACRO(QT4_GENERATE_DBUS_INTERFACE _header) # _customName )
|
|
|
|
SET(_customName "${ARGV1}")
|
|
|
|
GET_FILENAME_COMPONENT(_in_file ${_header} ABSOLUTE)
|
|
|
|
GET_FILENAME_COMPONENT(_basename ${_header} NAME_WE)
|
|
|
|
|
|
|
|
IF (_customName)
|
|
|
|
SET(_target ${CMAKE_CURRENT_BINARY_DIR}/${_customName})
|
|
|
|
ELSE (_customName)
|
|
|
|
SET(_target ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.xml)
|
|
|
|
ENDIF (_customName)
|
|
|
|
|
|
|
|
ADD_CUSTOM_COMMAND(OUTPUT ${_target}
|
|
|
|
COMMAND ${QT_DBUSCPP2XML_EXECUTABLE} ${_in_file} > ${_target}
|
|
|
|
DEPENDS ${_in_file}
|
|
|
|
)
|
|
|
|
ENDMACRO(QT4_GENERATE_DBUS_INTERFACE)
|
|
|
|
|
|
|
|
|
|
|
|
MACRO(QT4_ADD_DBUS_ADAPTOR _sources _xml_file _include _parentClass) # _optionalBasename )
|
|
|
|
GET_FILENAME_COMPONENT(_infile ${_xml_file} ABSOLUTE)
|
|
|
|
|
|
|
|
SET(_optionalBasename "${ARGV4}")
|
|
|
|
IF (_optionalBasename)
|
|
|
|
SET(_basename ${_optionalBasename} )
|
|
|
|
ELSE (_optionalBasename)
|
|
|
|
STRING(REGEX REPLACE "(.*[/\\.])?([^\\.]+)\\.xml" "\\2adaptor" _basename ${_infile})
|
|
|
|
STRING(TOLOWER ${_basename} _basename)
|
|
|
|
ENDIF (_optionalBasename)
|
|
|
|
|
|
|
|
SET(_optionalClassName "${ARGV5}")
|
|
|
|
SET(_header ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.h)
|
|
|
|
SET(_impl ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.cpp)
|
|
|
|
SET(_moc ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.moc)
|
|
|
|
|
|
|
|
IF(_optionalClassName)
|
|
|
|
ADD_CUSTOM_COMMAND(OUTPUT ${_impl} ${_header}
|
|
|
|
COMMAND ${QT_DBUSXML2CPP_EXECUTABLE} -m -a ${_basename} -c ${_optionalClassName} -i ${_include} -l ${_parentClass} ${_infile}
|
|
|
|
DEPENDS ${_infile}
|
|
|
|
)
|
|
|
|
ELSE(_optionalClassName)
|
|
|
|
ADD_CUSTOM_COMMAND(OUTPUT ${_impl} ${_header}
|
|
|
|
COMMAND ${QT_DBUSXML2CPP_EXECUTABLE} -m -a ${_basename} -i ${_include} -l ${_parentClass} ${_infile}
|
|
|
|
DEPENDS ${_infile}
|
|
|
|
)
|
|
|
|
ENDIF(_optionalClassName)
|
|
|
|
|
|
|
|
QT4_GENERATE_MOC(${_header} ${_moc})
|
|
|
|
SET_SOURCE_FILES_PROPERTIES(${_impl} PROPERTIES SKIP_AUTOMOC TRUE)
|
|
|
|
MACRO_ADD_FILE_DEPENDENCIES(${_impl} ${_moc})
|
|
|
|
|
|
|
|
SET(${_sources} ${${_sources}} ${_impl} ${_header} ${_moc})
|
|
|
|
ENDMACRO(QT4_ADD_DBUS_ADAPTOR)
|
|
|
|
|
|
|
|
MACRO(QT4_AUTOMOC)
|
|
|
|
QT4_GET_MOC_INC_DIRS(_moc_INCS)
|
|
|
|
|
|
|
|
SET(_matching_FILES )
|
|
|
|
FOREACH (_current_FILE ${ARGN})
|
|
|
|
|
|
|
|
GET_FILENAME_COMPONENT(_abs_FILE ${_current_FILE} ABSOLUTE)
|
|
|
|
# if "SKIP_AUTOMOC" is set to true, we will not handle this file here.
|
|
|
|
# here. this is required to make bouic work correctly:
|
|
|
|
# we need to add generated .cpp files to the sources (to compile them),
|
|
|
|
# but we cannot let automoc handle them, as the .cpp files don't exist yet when
|
|
|
|
# cmake is run for the very first time on them -> however the .cpp files might
|
|
|
|
# exist at a later run. at that time we need to skip them, so that we don't add two
|
|
|
|
# different rules for the same moc file
|
|
|
|
GET_SOURCE_FILE_PROPERTY(_skip ${_abs_FILE} SKIP_AUTOMOC)
|
|
|
|
|
|
|
|
IF ( NOT _skip AND EXISTS ${_abs_FILE} )
|
|
|
|
|
|
|
|
FILE(READ ${_abs_FILE} _contents)
|
|
|
|
|
|
|
|
GET_FILENAME_COMPONENT(_abs_PATH ${_abs_FILE} PATH)
|
|
|
|
|
|
|
|
STRING(REGEX MATCHALL "#include +[^ ]+\\.moc[\">]" _match "${_contents}")
|
|
|
|
IF(_match)
|
|
|
|
FOREACH (_current_MOC_INC ${_match})
|
|
|
|
STRING(REGEX MATCH "[^ <\"]+\\.moc" _current_MOC "${_current_MOC_INC}")
|
2008-01-11 17:40:24 +00:00
|
|
|
GET_FILENAME_COMPONENT(_basename ${_current_MOC} NAME_WE)
|
2007-01-03 23:20:55 +00:00
|
|
|
SET(_header ${_abs_PATH}/${_basename}.h)
|
|
|
|
SET(_moc ${CMAKE_CURRENT_BINARY_DIR}/${_current_MOC})
|
2008-01-11 17:40:24 +00:00
|
|
|
QT4_CREATE_MOC_COMMAND(${_header} ${_moc} "${moc_INCS}" "")
|
2007-01-03 23:20:55 +00:00
|
|
|
MACRO_ADD_FILE_DEPENDENCIES(${_abs_FILE} ${_moc})
|
|
|
|
ENDFOREACH (_current_MOC_INC)
|
|
|
|
ENDIF(_match)
|
|
|
|
ENDIF ( NOT _skip AND EXISTS ${_abs_FILE} )
|
|
|
|
ENDFOREACH (_current_FILE)
|
|
|
|
ENDMACRO(QT4_AUTOMOC)
|
2005-09-12 13:00:55 +00:00
|
|
|
|
2008-01-22 15:11:29 +00:00
|
|
|
MACRO(QT4_CREATE_TRANSLATION _qm_files)
|
|
|
|
SET(_my_sources)
|
|
|
|
SET(_my_tsfiles)
|
|
|
|
FOREACH (_file ${ARGN})
|
|
|
|
GET_FILENAME_COMPONENT(_ext ${_file} EXT)
|
|
|
|
GET_FILENAME_COMPONENT(_abs_FILE ${_file} ABSOLUTE)
|
|
|
|
IF(_ext MATCHES "ts")
|
|
|
|
LIST(APPEND _my_tsfiles ${_abs_FILE})
|
|
|
|
ELSE(_ext MATCHES "ts")
|
|
|
|
LIST(APPEND _my_sources ${_abs_FILE})
|
|
|
|
ENDIF(_ext MATCHES "ts")
|
|
|
|
ENDFOREACH(_file)
|
|
|
|
FOREACH(_ts_file ${_my_tsfiles})
|
|
|
|
ADD_CUSTOM_COMMAND(OUTPUT ${_ts_file}
|
|
|
|
COMMAND ${QT_LUPDATE_EXECUTABLE}
|
|
|
|
ARGS ${_my_sources} -ts ${_ts_file}
|
|
|
|
DEPENDS ${_my_sources})
|
|
|
|
ENDFOREACH(_ts_file)
|
|
|
|
QT4_ADD_TRANSLATION(${_qm_files} ${_my_tsfiles})
|
|
|
|
ENDMACRO(QT4_CREATE_TRANSLATION)
|
|
|
|
|
|
|
|
MACRO(QT4_ADD_TRANSLATION _qm_files)
|
|
|
|
FOREACH (_current_FILE ${ARGN})
|
|
|
|
GET_FILENAME_COMPONENT(_abs_FILE ${_current_FILE} ABSOLUTE)
|
|
|
|
GET_FILENAME_COMPONENT(qm ${_abs_FILE} NAME_WE)
|
|
|
|
SET(qm "${CMAKE_CURRENT_BINARY_DIR}/${qm}.qm")
|
|
|
|
|
|
|
|
ADD_CUSTOM_COMMAND(OUTPUT ${qm}
|
|
|
|
COMMAND ${QT_LRELEASE_EXECUTABLE}
|
|
|
|
ARGS ${_abs_FILE} -qm ${qm}
|
|
|
|
DEPENDS ${_abs_FILE}
|
|
|
|
)
|
|
|
|
SET(${_qm_files} ${${_qm_files}} ${qm})
|
|
|
|
ENDFOREACH (_current_FILE)
|
|
|
|
ENDMACRO(QT4_ADD_TRANSLATION)
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-09-12 13:00:55 +00:00
|
|
|
|
|
|
|
|
|
|
|
######################################
|
|
|
|
#
|
2006-01-09 17:45:37 +00:00
|
|
|
# decide if Qt got found
|
2005-09-12 13:00:55 +00:00
|
|
|
#
|
|
|
|
######################################
|
2006-04-27 19:07:23 +00:00
|
|
|
|
2005-09-12 13:00:55 +00:00
|
|
|
# if the includes,libraries,moc,uic and rcc are found then we have it
|
|
|
|
IF( QT_LIBRARY_DIR AND QT_INCLUDE_DIR AND QT_MOC_EXECUTABLE AND QT_UIC_EXECUTABLE AND QT_RCC_EXECUTABLE)
|
|
|
|
SET( QT4_FOUND "YES" )
|
2008-03-17 15:10:42 +00:00
|
|
|
INCLUDE(FindPackageMessage)
|
|
|
|
FIND_PACKAGE_MESSAGE(Qt4 "Found Qt-Version ${QTVERSION}"
|
|
|
|
"[${QT_LIBRARY_DIR}][${QT_INCLUDE_DIR}][${QT_MOC_EXECUTABLE}][${QT_UIC_EXECUTABLE}][${QT_RCC_EXECUTABLE}]")
|
2005-09-12 13:00:55 +00:00
|
|
|
ELSE( QT_LIBRARY_DIR AND QT_INCLUDE_DIR AND QT_MOC_EXECUTABLE AND QT_UIC_EXECUTABLE AND QT_RCC_EXECUTABLE)
|
|
|
|
SET( QT4_FOUND "NO")
|
2007-01-04 22:29:01 +00:00
|
|
|
SET(QT_QMAKE_EXECUTABLE "${QT_QMAKE_EXECUTABLE}-NOTFOUND" CACHE FILEPATH "Invalid qmake found" FORCE)
|
2006-01-09 17:45:37 +00:00
|
|
|
IF( Qt4_FIND_REQUIRED)
|
2006-01-25 17:16:49 +00:00
|
|
|
MESSAGE( FATAL_ERROR "Qt libraries, includes, moc, uic or/and rcc NOT found!")
|
2006-01-09 17:45:37 +00:00
|
|
|
ENDIF( Qt4_FIND_REQUIRED)
|
2005-09-12 13:00:55 +00:00
|
|
|
ENDIF( QT_LIBRARY_DIR AND QT_INCLUDE_DIR AND QT_MOC_EXECUTABLE AND QT_UIC_EXECUTABLE AND QT_RCC_EXECUTABLE)
|
|
|
|
SET(QT_FOUND ${QT4_FOUND})
|
2007-01-04 22:29:01 +00:00
|
|
|
|
|
|
|
|
2005-09-12 13:00:55 +00:00
|
|
|
#######################################
|
|
|
|
#
|
2006-09-06 12:31:50 +00:00
|
|
|
# Qt configuration
|
2005-09-12 13:00:55 +00:00
|
|
|
#
|
|
|
|
#######################################
|
2006-09-06 12:31:50 +00:00
|
|
|
IF(EXISTS "${QT_MKSPECS_DIR}/qconfig.pri")
|
|
|
|
FILE(READ ${QT_MKSPECS_DIR}/qconfig.pri _qconfig_FILE_contents)
|
|
|
|
STRING(REGEX MATCH "QT_CONFIG[^\n]+" QT_QCONFIG ${_qconfig_FILE_contents})
|
|
|
|
STRING(REGEX MATCH "CONFIG[^\n]+" QT_CONFIG ${_qconfig_FILE_contents})
|
2007-09-27 00:53:29 +00:00
|
|
|
STRING(REGEX MATCH "EDITION[^\n]+" QT_EDITION ${_qconfig_FILE_contents})
|
2006-09-06 12:31:50 +00:00
|
|
|
ENDIF(EXISTS "${QT_MKSPECS_DIR}/qconfig.pri")
|
2007-09-27 18:20:27 +00:00
|
|
|
IF("${QT_EDITION}" MATCHES "DesktopLight")
|
|
|
|
SET(QT_EDITION_DESKTOPLIGHT 1)
|
|
|
|
ENDIF("${QT_EDITION}" MATCHES "DesktopLight")
|
2006-09-06 12:31:50 +00:00
|
|
|
|
2007-09-27 00:53:29 +00:00
|
|
|
|
2006-09-06 12:31:50 +00:00
|
|
|
###############################################
|
|
|
|
#
|
|
|
|
# configuration/system dependent settings
|
|
|
|
#
|
|
|
|
###############################################
|
|
|
|
|
2008-03-14 17:16:58 +00:00
|
|
|
SET(QT_QTGUI_LIB_DEPENDENCIES "")
|
|
|
|
SET(QT_QTCORE_LIB_DEPENDENCIES "")
|
2008-03-14 17:29:16 +00:00
|
|
|
SET(QT_QTNETWORK_LIB_DEPENDENCIES "")
|
|
|
|
SET(QT_QTOPENGL_LIB_DEPENDENCIES "")
|
2008-03-18 20:30:14 +00:00
|
|
|
SET(QT_QTDBUS_LIB_DEPENDENCIES "")
|
2008-03-14 17:16:58 +00:00
|
|
|
SET(QT_QTHELP_LIB_DEPENDENCIES ${QT_QTCLUCENE_LIBRARY})
|
2006-09-06 12:31:50 +00:00
|
|
|
|
2007-12-18 19:50:18 +00:00
|
|
|
# build using shared Qt needs -DQT_DLL
|
2006-09-06 12:31:50 +00:00
|
|
|
IF(NOT QT_CONFIG MATCHES "static")
|
|
|
|
# warning currently only qconfig.pri on Windows potentially contains "static"
|
2007-12-18 19:50:18 +00:00
|
|
|
# so QT_DLL might not get defined properly on other platforms.
|
|
|
|
SET(QT_DEFINITIONS ${QT_DEFINITIONS} -DQT_DLL)
|
2006-09-06 12:31:50 +00:00
|
|
|
ENDIF(NOT QT_CONFIG MATCHES "static")
|
|
|
|
|
2008-03-14 17:29:16 +00:00
|
|
|
# QtOpenGL dependencies
|
|
|
|
QT_QUERY_QMAKE(QMAKE_LIBS_OPENGL "QMAKE_LIBS_OPENGL")
|
|
|
|
SET (QT_QTOPENGL_LIB_DEPENDENCIES ${QT_QTOPENGL_LIB_DEPENDENCIES} ${QMAKE_LIBS_OPENGL})
|
|
|
|
|
2006-09-06 12:31:50 +00:00
|
|
|
## system png
|
|
|
|
IF(QT_QCONFIG MATCHES "system-png")
|
|
|
|
FIND_LIBRARY(QT_PNG_LIBRARY NAMES png)
|
2008-03-14 17:16:58 +00:00
|
|
|
SET(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${QT_PNG_LIBRARY})
|
2006-09-06 12:31:50 +00:00
|
|
|
MARK_AS_ADVANCED(QT_PNG_LIBRARY)
|
|
|
|
ENDIF(QT_QCONFIG MATCHES "system-png")
|
2006-10-04 14:33:10 +00:00
|
|
|
|
2006-09-06 12:31:50 +00:00
|
|
|
# for X11, get X11 library directory
|
|
|
|
IF(Q_WS_X11)
|
|
|
|
QT_QUERY_QMAKE(QMAKE_LIBDIR_X11 "QMAKE_LIBDIR_X11")
|
|
|
|
ENDIF(Q_WS_X11)
|
|
|
|
|
|
|
|
## X11 SM
|
|
|
|
IF(QT_QCONFIG MATCHES "x11sm")
|
|
|
|
# ask qmake where the x11 libs are
|
|
|
|
FIND_LIBRARY(QT_X11_SM_LIBRARY NAMES SM PATHS ${QMAKE_LIBDIR_X11})
|
|
|
|
FIND_LIBRARY(QT_X11_ICE_LIBRARY NAMES ICE PATHS ${QMAKE_LIBDIR_X11})
|
2008-03-14 17:16:58 +00:00
|
|
|
SET(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${QT_X11_SM_LIBRARY} ${QT_X11_ICE_LIBRARY})
|
2006-09-06 12:31:50 +00:00
|
|
|
MARK_AS_ADVANCED(QT_X11_SM_LIBRARY)
|
|
|
|
MARK_AS_ADVANCED(QT_X11_ICE_LIBRARY)
|
|
|
|
ENDIF(QT_QCONFIG MATCHES "x11sm")
|
|
|
|
|
|
|
|
## Xi
|
|
|
|
IF(QT_QCONFIG MATCHES "tablet")
|
|
|
|
FIND_LIBRARY(QT_XI_LIBRARY NAMES Xi PATHS ${QMAKE_LIBDIR_X11})
|
2008-03-14 17:16:58 +00:00
|
|
|
SET(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${QT_XI_LIBRARY})
|
2006-09-06 12:31:50 +00:00
|
|
|
MARK_AS_ADVANCED(QT_XI_LIBRARY)
|
|
|
|
ENDIF(QT_QCONFIG MATCHES "tablet")
|
|
|
|
|
|
|
|
## Xrender
|
|
|
|
IF(QT_QCONFIG MATCHES "xrender")
|
|
|
|
FIND_LIBRARY(QT_XRENDER_LIBRARY NAMES Xrender PATHS ${QMAKE_LIBDIR_X11})
|
2008-03-14 17:16:58 +00:00
|
|
|
SET(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${QT_XRENDER_LIBRARY})
|
2006-09-06 12:31:50 +00:00
|
|
|
MARK_AS_ADVANCED(QT_XRENDER_LIBRARY)
|
|
|
|
ENDIF(QT_QCONFIG MATCHES "xrender")
|
|
|
|
|
|
|
|
## Xrandr
|
|
|
|
IF(QT_QCONFIG MATCHES "xrandr")
|
|
|
|
FIND_LIBRARY(QT_XRANDR_LIBRARY NAMES Xrandr PATHS ${QMAKE_LIBDIR_X11})
|
2008-03-14 17:16:58 +00:00
|
|
|
SET(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${QT_XRANDR_LIBRARY})
|
2006-09-06 12:31:50 +00:00
|
|
|
MARK_AS_ADVANCED(QT_XRANDR_LIBRARY)
|
|
|
|
ENDIF(QT_QCONFIG MATCHES "xrandr")
|
|
|
|
|
|
|
|
## Xcursor
|
|
|
|
IF(QT_QCONFIG MATCHES "xcursor")
|
|
|
|
FIND_LIBRARY(QT_XCURSOR_LIBRARY NAMES Xcursor PATHS ${QMAKE_LIBDIR_X11})
|
2008-03-14 17:16:58 +00:00
|
|
|
SET(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${QT_XCURSOR_LIBRARY})
|
2006-09-06 12:31:50 +00:00
|
|
|
MARK_AS_ADVANCED(QT_XCURSOR_LIBRARY)
|
|
|
|
ENDIF(QT_QCONFIG MATCHES "xcursor")
|
|
|
|
|
|
|
|
## Xinerama
|
|
|
|
IF(QT_QCONFIG MATCHES "xinerama")
|
|
|
|
FIND_LIBRARY(QT_XINERAMA_LIBRARY NAMES Xinerama PATHS ${QMAKE_LIBDIR_X11})
|
2008-03-14 17:16:58 +00:00
|
|
|
SET(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${QT_XINERAMA_LIBRARY})
|
2006-09-06 12:31:50 +00:00
|
|
|
MARK_AS_ADVANCED(QT_XINERAMA_LIBRARY)
|
|
|
|
ENDIF(QT_QCONFIG MATCHES "xinerama")
|
|
|
|
|
2007-11-08 15:56:13 +00:00
|
|
|
## Xfixes
|
|
|
|
IF(QT_QCONFIG MATCHES "xfixes")
|
|
|
|
FIND_LIBRARY(QT_XFIXES_LIBRARY NAMES Xfixes PATHS ${QMAKE_LIBDIR_X11})
|
2008-03-14 17:16:58 +00:00
|
|
|
SET(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${QT_XFIXES_LIBRARY})
|
2007-11-08 15:56:13 +00:00
|
|
|
MARK_AS_ADVANCED(QT_XFIXES_LIBRARY)
|
|
|
|
ENDIF(QT_QCONFIG MATCHES "xfixes")
|
|
|
|
|
2006-09-06 12:31:50 +00:00
|
|
|
## system-freetype
|
|
|
|
IF(QT_QCONFIG MATCHES "system-freetype")
|
|
|
|
FIND_LIBRARY(QT_FREETYPE_LIBRARY NAMES freetype)
|
2008-03-14 17:16:58 +00:00
|
|
|
SET(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${QT_FREETYPE_LIBRARY})
|
2006-09-06 12:31:50 +00:00
|
|
|
MARK_AS_ADVANCED(QT_FREETYPE_LIBRARY)
|
|
|
|
ENDIF(QT_QCONFIG MATCHES "system-freetype")
|
|
|
|
|
|
|
|
## fontconfig
|
|
|
|
IF(QT_QCONFIG MATCHES "fontconfig")
|
|
|
|
FIND_LIBRARY(QT_FONTCONFIG_LIBRARY NAMES fontconfig)
|
2008-03-14 17:16:58 +00:00
|
|
|
SET(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${QT_FONTCONFIG_LIBRARY})
|
2006-09-06 12:31:50 +00:00
|
|
|
MARK_AS_ADVANCED(QT_FONTCONFIG_LIBRARY)
|
|
|
|
ENDIF(QT_QCONFIG MATCHES "fontconfig")
|
|
|
|
|
|
|
|
## system-zlib
|
|
|
|
IF(QT_QCONFIG MATCHES "system-zlib")
|
|
|
|
FIND_LIBRARY(QT_ZLIB_LIBRARY NAMES z)
|
2008-03-14 17:16:58 +00:00
|
|
|
SET(QT_QTCORE_LIB_DEPENDENCIES ${QT_QTCORE_LIB_DEPENDENCIES} ${QT_ZLIB_LIBRARY})
|
2006-09-06 12:31:50 +00:00
|
|
|
MARK_AS_ADVANCED(QT_ZLIB_LIBRARY)
|
|
|
|
ENDIF(QT_QCONFIG MATCHES "system-zlib")
|
2008-03-14 17:29:16 +00:00
|
|
|
|
|
|
|
## openssl
|
2008-03-18 20:30:14 +00:00
|
|
|
IF(QT_QCONFIG MATCHES "openssl" AND NOT Q_WS_WIN)
|
2008-03-14 17:29:16 +00:00
|
|
|
FIND_PACKAGE(OpenSSL)
|
|
|
|
SET(QT_QTNETWORK_LIB_DEPENDENCIES ${QT_QTNETWORK_LIB_DEPENDENCIES} ${OPENSSL_LIBRARIES})
|
2008-03-18 20:30:14 +00:00
|
|
|
ENDIF(QT_QCONFIG MATCHES "openssl" AND NOT Q_WS_WIN)
|
|
|
|
|
|
|
|
## qdbus
|
|
|
|
IF(QT_QCONFIG MATCHES "qdbus")
|
|
|
|
|
2008-03-19 20:14:06 +00:00
|
|
|
# if the dbus library isn't found, we'll assume its not required to build
|
|
|
|
# shared Qt on Linux doesn't require it
|
2008-03-18 20:30:14 +00:00
|
|
|
IF(NOT QT_DBUS_LIBRARY)
|
2008-03-19 20:14:06 +00:00
|
|
|
EXECUTE_PROCESS(COMMAND pkg-config --libs-only-L dbus-1
|
|
|
|
OUTPUT_VARIABLE _dbus_query_output
|
|
|
|
RESULT_VARIABLE _dbus_result
|
|
|
|
ERROR_VARIABLE _dbus_query_output )
|
|
|
|
|
|
|
|
IF(_dbus_result MATCHES 0)
|
|
|
|
STRING(REPLACE "-L" "" _dbus_query_output "${_dbus_query_output}")
|
|
|
|
SEPARATE_ARGUMENTS(_dbus_query_output)
|
|
|
|
ELSE(_dbus_result MATCHES 0)
|
|
|
|
SET(_dbus_query_output)
|
|
|
|
ENDIF(_dbus_result MATCHES 0)
|
|
|
|
|
|
|
|
FIND_LIBRARY(QT_DBUS_LIBRARY NAMES dbus-1 PATHS ${_dbus_query_output} )
|
|
|
|
|
|
|
|
IF(QT_DBUS_LIBRARY)
|
|
|
|
SET(QT_QTDBUS_LIB_DEPENDENCIES ${QT_QTDBUS_LIB_DEPENDENCIES} ${QT_DBUS_LIBRARY})
|
|
|
|
ENDIF(QT_DBUS_LIBRARY)
|
|
|
|
|
|
|
|
MARK_AS_ADVANCED(QT_DBUS_LIBRARY)
|
2008-03-18 20:30:14 +00:00
|
|
|
ENDIF(NOT QT_DBUS_LIBRARY)
|
|
|
|
|
|
|
|
ENDIF(QT_QCONFIG MATCHES "qdbus")
|
2007-11-08 15:56:13 +00:00
|
|
|
|
2007-02-20 21:35:45 +00:00
|
|
|
## glib
|
|
|
|
IF(QT_QCONFIG MATCHES "glib")
|
2008-03-19 20:14:06 +00:00
|
|
|
|
|
|
|
# if the glib libraries aren't found, we'll assume its not required to build
|
|
|
|
# shared Qt on Linux doesn't require it
|
2008-01-29 00:20:00 +00:00
|
|
|
|
2008-03-19 20:14:06 +00:00
|
|
|
# Qt 4.2.0+ uses glib-2.0
|
2008-01-29 00:20:00 +00:00
|
|
|
IF(NOT QT_GLIB_LIBRARY OR NOT QT_GTHREAD_LIBRARY)
|
2008-03-19 20:14:06 +00:00
|
|
|
EXECUTE_PROCESS(COMMAND pkg-config --libs-only-L glib-2.0 gthread-2.0
|
|
|
|
OUTPUT_VARIABLE _glib_query_output
|
|
|
|
RESULT_VARIABLE _glib_result
|
|
|
|
ERROR_VARIABLE _glib_query_output )
|
|
|
|
|
|
|
|
IF(_glib_result MATCHES 0)
|
|
|
|
STRING(REPLACE "-L" "" _glib_query_output "${_glib_query_output}")
|
|
|
|
SEPARATE_ARGUMENTS(_glib_query_output)
|
|
|
|
ELSE(_glib_result MATCHES 0)
|
|
|
|
SET(_glib_query_output)
|
|
|
|
ENDIF(_glib_result MATCHES 0)
|
|
|
|
|
|
|
|
FIND_LIBRARY(QT_GLIB_LIBRARY NAMES glib-2.0 PATHS ${_glib_query_output} )
|
|
|
|
FIND_LIBRARY(QT_GTHREAD_LIBRARY NAMES gthread-2.0 PATHS ${_glib_query_output} )
|
|
|
|
|
|
|
|
IF(QT_GLIB_LIBRARY AND QT_GTHREAD_LIBRARY)
|
|
|
|
SET(QT_QTCORE_LIB_DEPENDENCIES ${QT_QTCORE_LIB_DEPENDENCIES}
|
|
|
|
${QT_GTHREAD_LIBRARY} ${QT_GLIB_LIBRARY})
|
|
|
|
ENDIF(QT_GLIB_LIBRARY AND QT_GTHREAD_LIBRARY)
|
|
|
|
|
|
|
|
MARK_AS_ADVANCED(QT_GLIB_LIBRARY)
|
|
|
|
MARK_AS_ADVANCED(QT_GTHREAD_LIBRARY)
|
2008-01-29 00:20:00 +00:00
|
|
|
ENDIF(NOT QT_GLIB_LIBRARY OR NOT QT_GTHREAD_LIBRARY)
|
2007-02-20 21:35:45 +00:00
|
|
|
ENDIF(QT_QCONFIG MATCHES "glib")
|
2007-11-08 15:56:13 +00:00
|
|
|
|
|
|
|
## clock-monotonic, just see if we need to link with rt
|
|
|
|
IF(QT_QCONFIG MATCHES "clock-monotonic")
|
|
|
|
SET(CMAKE_REQUIRED_LIBRARIES_SAVE ${CMAKE_REQUIRED_LIBRARIES})
|
|
|
|
SET(CMAKE_REQUIRED_LIBRARIES rt)
|
|
|
|
CHECK_SYMBOL_EXISTS(_POSIX_TIMERS "unistd.h;time.h" QT_POSIX_TIMERS)
|
|
|
|
SET(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES_SAVE})
|
|
|
|
IF(QT_POSIX_TIMERS)
|
|
|
|
FIND_LIBRARY(QT_RT_LIBRARY NAMES rt)
|
2008-03-14 17:16:58 +00:00
|
|
|
SET(QT_QTCORE_LIB_DEPENDENCIES ${QT_QTCORE_LIB_DEPENDENCIES} ${QT_RT_LIBRARY})
|
2007-11-08 15:56:13 +00:00
|
|
|
MARK_AS_ADVANCED(QT_RT_LIBRARY)
|
|
|
|
ENDIF(QT_POSIX_TIMERS)
|
|
|
|
ENDIF(QT_QCONFIG MATCHES "clock-monotonic")
|
2008-03-14 17:29:16 +00:00
|
|
|
|
2006-09-06 12:31:50 +00:00
|
|
|
IF(Q_WS_X11)
|
|
|
|
# X11 libraries Qt absolutely depends on
|
|
|
|
QT_QUERY_QMAKE(QT_LIBS_X11 "QMAKE_LIBS_X11")
|
|
|
|
SEPARATE_ARGUMENTS(QT_LIBS_X11)
|
|
|
|
FOREACH(QT_X11_LIB ${QT_LIBS_X11})
|
|
|
|
STRING(REGEX REPLACE "-l" "" QT_X11_LIB "${QT_X11_LIB}")
|
|
|
|
SET(QT_TMP_STR "QT_X11_${QT_X11_LIB}_LIBRARY")
|
|
|
|
FIND_LIBRARY(${QT_TMP_STR} NAMES "${QT_X11_LIB}" PATHS ${QMAKE_LIBDIR_X11})
|
2008-03-14 17:16:58 +00:00
|
|
|
SET(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${${QT_TMP_STR}})
|
2007-01-03 22:50:16 +00:00
|
|
|
MARK_AS_ADVANCED(${QT_TMP_STR})
|
2006-09-06 12:31:50 +00:00
|
|
|
ENDFOREACH(QT_X11_LIB)
|
|
|
|
|
|
|
|
QT_QUERY_QMAKE(QT_LIBS_THREAD "QMAKE_LIBS_THREAD")
|
2008-03-14 17:16:58 +00:00
|
|
|
SET(QT_QTCORE_LIB_DEPENDENCIES ${QT_QTCORE_LIB_DEPENDENCIES} ${QT_LIBS_THREAD})
|
2006-09-06 12:31:50 +00:00
|
|
|
|
|
|
|
QT_QUERY_QMAKE(QMAKE_LIBS_DYNLOAD "QMAKE_LIBS_DYNLOAD")
|
2008-03-14 17:16:58 +00:00
|
|
|
SET (QT_QTCORE_LIB_DEPENDENCIES ${QT_QTCORE_LIB_DEPENDENCIES} ${QMAKE_LIBS_DYNLOAD})
|
2006-09-06 12:31:50 +00:00
|
|
|
|
|
|
|
ENDIF(Q_WS_X11)
|
|
|
|
|
|
|
|
IF(Q_WS_WIN)
|
2008-03-14 17:16:58 +00:00
|
|
|
SET(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} imm32 winmm)
|
|
|
|
SET(QT_QTCORE_LIB_DEPENDENCIES ${QT_QTCORE_LIB_DEPENDENCIES} ws2_32)
|
2006-09-06 12:31:50 +00:00
|
|
|
ENDIF(Q_WS_WIN)
|
|
|
|
|
|
|
|
IF(Q_WS_MAC)
|
2008-03-17 18:53:02 +00:00
|
|
|
SET(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} "-framework Carbon")
|
|
|
|
|
|
|
|
# Qt 4.0, 4.1, 4.2 use QuickTime
|
|
|
|
IF(found_qt_minor_vers LESS 3)
|
|
|
|
SET(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} "-framework QuickTime")
|
|
|
|
ENDIF(found_qt_minor_vers LESS 3)
|
|
|
|
|
|
|
|
# Qt 4.2+ use AppKit
|
|
|
|
IF(found_qt_minor_vers GREATER 1)
|
|
|
|
SET(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} "-framework AppKit")
|
|
|
|
ENDIF(found_qt_minor_vers LESS 1)
|
|
|
|
|
2008-03-14 17:16:58 +00:00
|
|
|
SET(QT_QTCORE_LIB_DEPENDENCIES ${QT_QTCORE_LIB_DEPENDENCIES} "-framework ApplicationServices")
|
2006-09-06 12:31:50 +00:00
|
|
|
ENDIF(Q_WS_MAC)
|
2005-09-12 13:00:55 +00:00
|
|
|
|
|
|
|
#######################################
|
|
|
|
#
|
2006-05-19 20:57:49 +00:00
|
|
|
# compatibility settings
|
2005-09-12 13:00:55 +00:00
|
|
|
#
|
|
|
|
#######################################
|
|
|
|
# Backwards compatibility for CMake1.4 and 1.2
|
|
|
|
SET (QT_MOC_EXE ${QT_MOC_EXECUTABLE} )
|
|
|
|
SET (QT_UIC_EXE ${QT_UIC_EXECUTABLE} )
|
|
|
|
|
|
|
|
SET( QT_QT_LIBRARY "")
|
2006-04-27 19:07:23 +00:00
|
|
|
|
2005-09-12 13:00:55 +00:00
|
|
|
ELSE(QT4_QMAKE_FOUND)
|
2007-01-04 22:29:01 +00:00
|
|
|
|
|
|
|
SET(QT_QMAKE_EXECUTABLE "${QT_QMAKE_EXECUTABLE}-NOTFOUND" CACHE FILEPATH "Invalid qmake found" FORCE)
|
|
|
|
IF(Qt4_FIND_REQUIRED)
|
|
|
|
IF(QT4_INSTALLED_VERSION_TOO_OLD)
|
|
|
|
MESSAGE(FATAL_ERROR "The installed Qt version ${QTVERSION} is too old, at least version ${QT_MIN_VERSION} is required")
|
|
|
|
ELSE(QT4_INSTALLED_VERSION_TOO_OLD)
|
|
|
|
MESSAGE( FATAL_ERROR "Qt qmake not found!")
|
|
|
|
ENDIF(QT4_INSTALLED_VERSION_TOO_OLD)
|
|
|
|
ELSE(Qt4_FIND_REQUIRED)
|
|
|
|
IF(QT4_INSTALLED_VERSION_TOO_OLD AND NOT Qt4_FIND_QUIETLY)
|
|
|
|
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)
|
|
|
|
|
2006-04-27 19:07:23 +00:00
|
|
|
ENDIF (QT4_QMAKE_FOUND)
|
|
|
|
|