2 # This module can be used to find Qt4.
3 # The most important issue is that the Qt4 qmake is available via the system path.
4 # This qmake is then used to detect basically everything else.
5 # This module defines a number of key variables and macros.
6 # The variable QT_USE_FILE is set which is the path to a CMake file that can be included
7 # to compile Qt 4 applications and libraries. It sets up the compilation
8 # environment for include directories, preprocessor defines and populates a
9 # QT_LIBRARIES variable.
11 # Typical usage could be something like:
12 # find_package(Qt4 4.4.3 COMPONENTS QtCore QtGui QtXml REQUIRED )
13 # include(${QT_USE_FILE})
14 # add_executable(myexe main.cpp)
15 # target_link_libraries(myexe ${QT_LIBRARIES})
17 # The minimum required version can be specified using the standard find_package()-syntax
18 # (see example above).
19 # For compatibility with older versions of FindQt4.cmake it is also possible to
20 # set the variable QT_MIN_VERSION to the minimum required version of Qt4 before the
21 # find_package(Qt4) command.
22 # If both are used, the version used in the find_package() command overrides the
23 # one from QT_MIN_VERSION.
25 # When using the components argument, QT_USE_QT* variables are automatically set
26 # for the QT_USE_FILE to pick up. If one wishes to manually set them, the
27 # available ones to set include:
48 # QT_USE_QTASSISTANTCLIENT
51 # QT_USE_QTXMLPATTERNS
53 # QT_USE_QTSCRIPTTOOLS
54 # QT_USE_QTDECLARATIVE
56 # QT_USE_IMPORTED_TARGETS
57 # If this variable is set to TRUE, FindQt4.cmake will create imported
58 # library targets for the various Qt libraries and set the
59 # library variables like QT_QTCORE_LIBRARY to point at these imported
60 # targets instead of the library file on disk. This provides much better
61 # handling of the release and debug versions of the Qt libraries and is
62 # also always backwards compatible, except for the case that dependencies
63 # of libraries are exported, these will then also list the names of the
64 # imported targets as dependency and not the file location on disk. This
65 # is much more flexible, but requires that FindQt4.cmake is executed before
66 # such an exported dependency file is processed.
68 # There are also some files that need processing by some Qt tools such as moc
69 # and uic. Listed below are macros that may be used to process those files.
71 # macro QT4_WRAP_CPP(outfiles inputfile ... OPTIONS ...)
72 # create moc code from a list of files containing Qt class with
73 # the Q_OBJECT declaration. Per-direcotry preprocessor definitions
74 # are also added. Options may be given to moc, such as those found
75 # when executing "moc -help".
77 # macro QT4_WRAP_UI(outfiles inputfile ... OPTIONS ...)
78 # create code from a list of Qt designer ui files.
79 # Options may be given to uic, such as those found
80 # when executing "uic -help"
82 # macro QT4_ADD_RESOURCES(outfiles inputfile ... OPTIONS ...)
83 # create code from a list of Qt resource files.
84 # Options may be given to rcc, such as those found
85 # when executing "rcc -help"
87 # macro QT4_GENERATE_MOC(inputfile outputfile )
88 # creates a rule to run moc on infile and create outfile.
89 # Use this if for some reason QT4_WRAP_CPP() isn't appropriate, e.g.
90 # because you need a custom filename for the moc file or something similar.
92 # macro QT4_AUTOMOC(sourcefile1 sourcefile2 ... )
93 # This macro is still experimental.
94 # It can be used to have moc automatically handled.
95 # So if you have the files foo.h and foo.cpp, and in foo.h a
96 # a class uses the Q_OBJECT macro, moc has to run on it. If you don't
97 # want to use QT4_WRAP_CPP() (which is reliable and mature), you can insert
99 # in foo.cpp and then give foo.cpp as argument to QT4_AUTOMOC(). This will the
100 # scan all listed files at cmake-time for such included moc files and if it finds
101 # them cause a rule to be generated to run moc at build time on the
102 # accompanying header file foo.h.
103 # If a source file has the SKIP_AUTOMOC property set it will be ignored by this macro.
105 # macro QT4_ADD_DBUS_INTERFACE(outfiles interface basename)
106 # create a the interface header and implementation files with the
107 # given basename from the given interface xml file and add it to
108 # the list of sources
110 # macro QT4_ADD_DBUS_INTERFACES(outfiles inputfile ... )
111 # create the interface header and implementation files
112 # for all listed interface xml files
113 # the name will be automatically determined from the name of the xml file
115 # macro QT4_ADD_DBUS_ADAPTOR(outfiles xmlfile parentheader parentclassname [basename] [classname])
116 # create a dbus adaptor (header and implementation file) from the xml file
117 # describing the interface, and add it to the list of sources. The adaptor
118 # forwards the calls to a parent class, defined in parentheader and named
119 # parentclassname. The name of the generated files will be
120 # <basename>adaptor.{cpp,h} where basename defaults to the basename of the xml file.
121 # If <classname> is provided, then it will be used as the classname of the
124 # macro QT4_GENERATE_DBUS_INTERFACE( header [interfacename] OPTIONS ...)
125 # generate the xml interface file from the given header.
126 # If the optional argument interfacename is omitted, the name of the
127 # interface file is constructed from the basename of the header with
128 # the suffix .xml appended.
129 # Options may be given to qdbuscpp2xml, such as those found when executing "qdbuscpp2xml --help"
131 # macro QT4_CREATE_TRANSLATION( qm_files directories ... sources ...
132 # ts_files ... OPTIONS ...)
134 # in: directories sources ts_files
135 # options: flags to pass to lupdate, such as -extensions to specify
136 # extensions for a directory scan.
137 # generates commands to create .ts (vie lupdate) and .qm
138 # (via lrelease) - files from directories and/or sources. The ts files are
139 # created and/or updated in the source tree (unless given with full paths).
140 # The qm files are generated in the build tree.
141 # Updating the translations can be done by adding the qm_files
142 # to the source list of your library/executable, so they are
143 # always updated, or by adding a custom target to control when
144 # they get updated/generated.
146 # macro QT4_ADD_TRANSLATION( qm_files ts_files ... )
149 # generates commands to create .qm from .ts - files. The generated
150 # filenames can be found in qm_files. The ts_files
151 # must exists and are not updated in any way.
154 # Below is a detailed list of variables that FindQt4.cmake sets.
155 # QT_FOUND If false, don't try to use Qt.
156 # QT4_FOUND If false, don't try to use Qt 4.
158 # QT_VERSION_MAJOR The major version of Qt found.
159 # QT_VERSION_MINOR The minor version of Qt found.
160 # QT_VERSION_PATCH The patch version of Qt found.
162 # QT_EDITION Set to the edition of Qt (i.e. DesktopLight)
163 # QT_EDITION_DESKTOPLIGHT True if QT_EDITION == DesktopLight
164 # QT_QTCORE_FOUND True if QtCore was found.
165 # QT_QTGUI_FOUND True if QtGui was found.
166 # QT_QT3SUPPORT_FOUND True if Qt3Support was found.
167 # QT_QTASSISTANT_FOUND True if QtAssistant was found.
168 # QT_QTASSISTANTCLIENT_FOUND True if QtAssistantClient was found.
169 # QT_QAXCONTAINER_FOUND True if QAxContainer was found (Windows only).
170 # QT_QAXSERVER_FOUND True if QAxServer was found (Windows only).
171 # QT_QTDBUS_FOUND True if QtDBus was found.
172 # QT_QTDESIGNER_FOUND True if QtDesigner was found.
173 # QT_QTDESIGNERCOMPONENTS True if QtDesignerComponents was found.
174 # QT_QTHELP_FOUND True if QtHelp was found.
175 # QT_QTMOTIF_FOUND True if QtMotif was found.
176 # QT_QTMULTIMEDIA_FOUND True if QtMultimedia was found (since Qt 4.6.0).
177 # QT_QTNETWORK_FOUND True if QtNetwork was found.
178 # QT_QTNSPLUGIN_FOUND True if QtNsPlugin was found.
179 # QT_QTOPENGL_FOUND True if QtOpenGL was found.
180 # QT_QTSQL_FOUND True if QtSql was found.
181 # QT_QTSVG_FOUND True if QtSvg was found.
182 # QT_QTSCRIPT_FOUND True if QtScript was found.
183 # QT_QTSCRIPTTOOLS_FOUND True if QtScriptTools was found.
184 # QT_QTTEST_FOUND True if QtTest was found.
185 # QT_QTUITOOLS_FOUND True if QtUiTools was found.
186 # QT_QTWEBKIT_FOUND True if QtWebKit was found.
187 # QT_QTXML_FOUND True if QtXml was found.
188 # QT_QTXMLPATTERNS_FOUND True if QtXmlPatterns was found.
189 # QT_PHONON_FOUND True if phonon was found.
190 # QT_QTDECLARATIVE_FOUND True if QtDeclarative was found.
192 # QT_MAC_USE_COCOA For Mac OS X, its whether Cocoa or Carbon is used.
193 # In general, this should not be used, but its useful
194 # when having platform specific code.
196 # QT_DEFINITIONS Definitions to use when compiling code that uses Qt.
197 # You do not need to use this if you include QT_USE_FILE.
198 # The QT_USE_FILE will also define QT_DEBUG and QT_NO_DEBUG
199 # to fit your current build type. Those are not contained
202 # QT_INCLUDES List of paths to all include directories of
203 # Qt4 QT_INCLUDE_DIR and QT_QTCORE_INCLUDE_DIR are
204 # always in this variable even if NOTFOUND,
205 # all other INCLUDE_DIRS are
206 # only added if they are found.
207 # You do not need to use this if you include QT_USE_FILE.
210 # Include directories for the Qt modules are listed here.
211 # You do not need to use these variables if you include QT_USE_FILE.
213 # QT_INCLUDE_DIR Path to "include" of Qt4
214 # QT_QT3SUPPORT_INCLUDE_DIR Path to "include/Qt3Support"
215 # QT_QTASSISTANT_INCLUDE_DIR Path to "include/QtAssistant"
216 # QT_QTASSISTANTCLIENT_INCLUDE_DIR Path to "include/QtAssistant"
217 # QT_QAXCONTAINER_INCLUDE_DIR Path to "include/ActiveQt" (Windows only)
218 # QT_QAXSERVER_INCLUDE_DIR Path to "include/ActiveQt" (Windows only)
219 # QT_QTCORE_INCLUDE_DIR Path to "include/QtCore"
220 # QT_QTDBUS_INCLUDE_DIR Path to "include/QtDBus"
221 # QT_QTDESIGNER_INCLUDE_DIR Path to "include/QtDesigner"
222 # QT_QTDESIGNERCOMPONENTS_INCLUDE_DIR Path to "include/QtDesigner"
223 # QT_QTGUI_INCLUDE_DIR Path to "include/QtGui"
224 # QT_QTHELP_INCLUDE_DIR Path to "include/QtHelp"
225 # QT_QTMOTIF_INCLUDE_DIR Path to "include/QtMotif"
226 # QT_QTMULTIMEDIA_INCLUDE_DIR Path to "include/QtMultimedia"
227 # QT_QTNETWORK_INCLUDE_DIR Path to "include/QtNetwork"
228 # QT_QTNSPLUGIN_INCLUDE_DIR Path to "include/QtNsPlugin"
229 # QT_QTOPENGL_INCLUDE_DIR Path to "include/QtOpenGL"
230 # QT_QTSCRIPT_INCLUDE_DIR Path to "include/QtScript"
231 # QT_QTSQL_INCLUDE_DIR Path to "include/QtSql"
232 # QT_QTSVG_INCLUDE_DIR Path to "include/QtSvg"
233 # QT_QTTEST_INCLUDE_DIR Path to "include/QtTest"
234 # QT_QTWEBKIT_INCLUDE_DIR Path to "include/QtWebKit"
235 # QT_QTXML_INCLUDE_DIR Path to "include/QtXml"
236 # QT_QTXMLPATTERNS_INCLUDE_DIR Path to "include/QtXmlPatterns"
237 # QT_PHONON_INCLUDE_DIR Path to "include/phonon"
238 # QT_QTSCRIPTTOOLS_INCLUDE_DIR Path to "include/QtScriptTools"
239 # QT_QTDECLARATIVE_INCLUDE_DIR Path to "include/QtDeclarative"
241 # QT_BINARY_DIR Path to "bin" of Qt4
242 # QT_LIBRARY_DIR Path to "lib" of Qt4
243 # QT_PLUGINS_DIR Path to "plugins" for Qt4
244 # QT_TRANSLATIONS_DIR Path to "translations" of Qt4
245 # QT_IMPORTS_DIR Path to "imports" of Qt4
246 # QT_DOC_DIR Path to "doc" of Qt4
247 # QT_MKSPECS_DIR Path to "mkspecs" of Qt4
250 # The Qt toolkit may contain both debug and release libraries.
251 # In that case, the following library variables will contain both.
252 # You do not need to use these variables if you include QT_USE_FILE,
253 # and use QT_LIBRARIES.
255 # QT_QT3SUPPORT_LIBRARY The Qt3Support library
256 # QT_QTASSISTANT_LIBRARY The QtAssistant library
257 # QT_QTASSISTANTCLIENT_LIBRARY The QtAssistantClient library
258 # QT_QAXCONTAINER_LIBRARY The QAxContainer library (Windows only)
259 # QT_QAXSERVER_LIBRARY The QAxServer library (Windows only)
260 # QT_QTCORE_LIBRARY The QtCore library
261 # QT_QTDBUS_LIBRARY The QtDBus library
262 # QT_QTDESIGNER_LIBRARY The QtDesigner library
263 # QT_QTDESIGNERCOMPONENTS_LIBRARY The QtDesignerComponents library
264 # QT_QTGUI_LIBRARY The QtGui library
265 # QT_QTHELP_LIBRARY The QtHelp library
266 # QT_QTMOTIF_LIBRARY The QtMotif library
267 # QT_QTMULTIMEDIA_LIBRARY The QtMultimedia library
268 # QT_QTNETWORK_LIBRARY The QtNetwork library
269 # QT_QTNSPLUGIN_LIBRARY The QtNsPLugin library
270 # QT_QTOPENGL_LIBRARY The QtOpenGL library
271 # QT_QTSCRIPT_LIBRARY The QtScript library
272 # QT_QTSQL_LIBRARY The QtSql library
273 # QT_QTSVG_LIBRARY The QtSvg library
274 # QT_QTTEST_LIBRARY The QtTest library
275 # QT_QTUITOOLS_LIBRARY The QtUiTools library
276 # QT_QTWEBKIT_LIBRARY The QtWebKit library
277 # QT_QTXML_LIBRARY The QtXml library
278 # QT_QTXMLPATTERNS_LIBRARY The QtXmlPatterns library
279 # QT_QTMAIN_LIBRARY The qtmain library for Windows
280 # QT_PHONON_LIBRARY The phonon library
281 # QT_QTSCRIPTTOOLS_LIBRARY The QtScriptTools library
283 # The QtDeclarative library: QT_QTDECLARATIVE_LIBRARY
285 # also defined, but NOT for general use are
286 # QT_MOC_EXECUTABLE Where to find the moc tool.
287 # QT_UIC_EXECUTABLE Where to find the uic tool.
288 # QT_UIC3_EXECUTABLE Where to find the uic3 tool.
289 # QT_RCC_EXECUTABLE Where to find the rcc tool
290 # QT_DBUSCPP2XML_EXECUTABLE Where to find the qdbuscpp2xml tool.
291 # QT_DBUSXML2CPP_EXECUTABLE Where to find the qdbusxml2cpp tool.
292 # QT_LUPDATE_EXECUTABLE Where to find the lupdate tool.
293 # QT_LRELEASE_EXECUTABLE Where to find the lrelease tool.
294 # QT_QCOLLECTIONGENERATOR_EXECUTABLE Where to find the qcollectiongenerator tool.
295 # QT_DESIGNER_EXECUTABLE Where to find the Qt designer tool.
296 # QT_LINGUIST_EXECUTABLE Where to find the Qt linguist tool.
299 # These are around for backwards compatibility
301 # QT_WRAP_CPP Set true if QT_MOC_EXECUTABLE is found
302 # QT_WRAP_UI Set true if QT_UIC_EXECUTABLE is found
304 # These variables do _NOT_ have any effect anymore (compared to FindQt.cmake)
305 # QT_MT_REQUIRED Qt4 is now always multithreaded
307 # These variables are set to "" Because Qt structure changed
308 # (They make no sense in Qt4)
309 # QT_QT_LIBRARY Qt-Library is now split
311 #=============================================================================
312 # Copyright 2005-2009 Kitware, Inc.
314 # Distributed under the OSI-approved BSD License (the "License");
315 # see accompanying file Copyright.txt for details.
317 # This software is distributed WITHOUT ANY WARRANTY; without even the
318 # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
319 # See the License for more information.
320 #=============================================================================
321 # (To distribute this file outside of CMake, substitute the full
322 # License text for the above reference.)
324 # Use FIND_PACKAGE( Qt4 COMPONENTS ... ) to enable modules
325 IF( Qt4_FIND_COMPONENTS )
326 FOREACH( component ${Qt4_FIND_COMPONENTS} )
327 STRING( TOUPPER ${component} _COMPONENT )
328 SET( QT_USE_${_COMPONENT} 1 )
329 ENDFOREACH( component )
331 # To make sure we don't use QtCore or QtGui when not in COMPONENTS
332 IF(NOT QT_USE_QTCORE)
333 SET( QT_DONT_USE_QTCORE 1 )
334 ENDIF(NOT QT_USE_QTCORE)
337 SET( QT_DONT_USE_QTGUI 1 )
338 ENDIF(NOT QT_USE_QTGUI)
340 ENDIF( Qt4_FIND_COMPONENTS )
342 # If Qt3 has already been found, fail.
344 IF(Qt4_FIND_REQUIRED)
345 MESSAGE( FATAL_ERROR "Qt3 and Qt4 cannot be used together in one project. If switching to Qt4, the CMakeCache.txt needs to be cleaned.")
346 ELSE(Qt4_FIND_REQUIRED)
347 IF(NOT Qt4_FIND_QUIETLY)
348 MESSAGE( STATUS "Qt3 and Qt4 cannot be used together in one project. If switching to Qt4, the CMakeCache.txt needs to be cleaned.")
349 ENDIF(NOT Qt4_FIND_QUIETLY)
351 ENDIF(Qt4_FIND_REQUIRED)
355 INCLUDE(CheckSymbolExists)
356 INCLUDE(MacroAddFileDependencies)
358 SET(QT_USE_FILE ${CMAKE_ROOT}/Modules/UseQt4.cmake)
360 SET( QT_DEFINITIONS "")
362 # convenience macro for dealing with debug/release library names
363 MACRO (_QT4_ADJUST_LIB_VARS _camelCaseBasename)
365 STRING(TOUPPER "${_camelCaseBasename}" basename)
367 # The name of the imported targets, i.e. the prefix "Qt4::" must not change,
368 # since it is stored in EXPORT-files as name of a required library. If the name would change
369 # here, this would lead to the imported Qt4-library targets not being resolved by cmake anymore.
370 IF (QT_${basename}_LIBRARY_RELEASE OR QT_${basename}_LIBRARY_DEBUG)
372 IF(NOT TARGET Qt4::${_camelCaseBasename})
373 ADD_LIBRARY(Qt4::${_camelCaseBasename} UNKNOWN IMPORTED )
375 IF (QT_${basename}_LIBRARY_RELEASE)
376 SET_PROPERTY(TARGET Qt4::${_camelCaseBasename} APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
377 SET_PROPERTY(TARGET Qt4::${_camelCaseBasename} PROPERTY IMPORTED_LOCATION_RELEASE "${QT_${basename}_LIBRARY_RELEASE}" )
378 ENDIF (QT_${basename}_LIBRARY_RELEASE)
380 IF (QT_${basename}_LIBRARY_DEBUG)
381 SET_PROPERTY(TARGET Qt4::${_camelCaseBasename} APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG)
382 SET_PROPERTY(TARGET Qt4::${_camelCaseBasename} PROPERTY IMPORTED_LOCATION_DEBUG "${QT_${basename}_LIBRARY_DEBUG}" )
383 ENDIF (QT_${basename}_LIBRARY_DEBUG)
384 ENDIF(NOT TARGET Qt4::${_camelCaseBasename})
386 # If QT_USE_IMPORTED_TARGETS is enabled, the QT_QTFOO_LIBRARY variables are set to point at these
387 # imported targets. This works better in general, and is also in almost all cases fully
388 # backward compatible. The only issue is when a project A which had this enabled then exports its
389 # libraries via export or EXPORT_LIBRARY_DEPENDENCIES(). In this case the libraries from project
390 # A will depend on the imported Qt targets, and the names of these imported targets will be stored
391 # in the dependency files on disk. This means when a project B then uses project A, these imported
392 # targets must be created again, otherwise e.g. "Qt4__QtCore" will be interpreted as name of a
393 # library file on disk, and not as a target, and linking will fail:
394 IF(QT_USE_IMPORTED_TARGETS)
395 SET(QT_${basename}_LIBRARY Qt4::${_camelCaseBasename} )
396 SET(QT_${basename}_LIBRARIES Qt4::${_camelCaseBasename} )
397 ELSE(QT_USE_IMPORTED_TARGETS)
399 # if the release- as well as the debug-version of the library have been found:
400 IF (QT_${basename}_LIBRARY_DEBUG AND QT_${basename}_LIBRARY_RELEASE)
401 # if the generator supports configuration types then set
402 # optimized and debug libraries, or if the CMAKE_BUILD_TYPE has a value
403 IF (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
404 SET(QT_${basename}_LIBRARY optimized ${QT_${basename}_LIBRARY_RELEASE} debug ${QT_${basename}_LIBRARY_DEBUG})
405 ELSE(CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
406 # if there are no configuration types and CMAKE_BUILD_TYPE has no value
407 # then just use the release libraries
408 SET(QT_${basename}_LIBRARY ${QT_${basename}_LIBRARY_RELEASE} )
409 ENDIF(CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
410 SET(QT_${basename}_LIBRARIES optimized ${QT_${basename}_LIBRARY_RELEASE} debug ${QT_${basename}_LIBRARY_DEBUG})
411 ENDIF (QT_${basename}_LIBRARY_DEBUG AND QT_${basename}_LIBRARY_RELEASE)
413 # if only the release version was found, set the debug variable also to the release version
414 IF (QT_${basename}_LIBRARY_RELEASE AND NOT QT_${basename}_LIBRARY_DEBUG)
415 SET(QT_${basename}_LIBRARY_DEBUG ${QT_${basename}_LIBRARY_RELEASE})
416 SET(QT_${basename}_LIBRARY ${QT_${basename}_LIBRARY_RELEASE})
417 SET(QT_${basename}_LIBRARIES ${QT_${basename}_LIBRARY_RELEASE})
418 ENDIF (QT_${basename}_LIBRARY_RELEASE AND NOT QT_${basename}_LIBRARY_DEBUG)
420 # if only the debug version was found, set the release variable also to the debug version
421 IF (QT_${basename}_LIBRARY_DEBUG AND NOT QT_${basename}_LIBRARY_RELEASE)
422 SET(QT_${basename}_LIBRARY_RELEASE ${QT_${basename}_LIBRARY_DEBUG})
423 SET(QT_${basename}_LIBRARY ${QT_${basename}_LIBRARY_DEBUG})
424 SET(QT_${basename}_LIBRARIES ${QT_${basename}_LIBRARY_DEBUG})
425 ENDIF (QT_${basename}_LIBRARY_DEBUG AND NOT QT_${basename}_LIBRARY_RELEASE)
427 # put the value in the cache:
428 SET(QT_${basename}_LIBRARY ${QT_${basename}_LIBRARY} CACHE STRING "The Qt ${basename} library" FORCE)
430 ENDIF(QT_USE_IMPORTED_TARGETS)
432 SET(QT_${basename}_FOUND 1)
434 ELSE (QT_${basename}_LIBRARY_RELEASE OR QT_${basename}_LIBRARY_DEBUG)
436 SET(QT_${basename}_LIBRARY "" CACHE STRING "The Qt ${basename} library" FORCE)
438 ENDIF (QT_${basename}_LIBRARY_RELEASE OR QT_${basename}_LIBRARY_DEBUG)
440 IF (QT_${basename}_INCLUDE_DIR)
441 #add the include directory to QT_INCLUDES
442 SET(QT_INCLUDES "${QT_${basename}_INCLUDE_DIR}" ${QT_INCLUDES})
443 ENDIF (QT_${basename}_INCLUDE_DIR)
445 # Make variables changeble to the advanced user
446 MARK_AS_ADVANCED(QT_${basename}_LIBRARY QT_${basename}_LIBRARY_RELEASE QT_${basename}_LIBRARY_DEBUG QT_${basename}_INCLUDE_DIR)
447 ENDMACRO (_QT4_ADJUST_LIB_VARS)
449 function(_QT4_QUERY_QMAKE VAR RESULT)
450 execute_process(COMMAND "${QT_QMAKE_EXECUTABLE}" -query ${VAR}
451 RESULT_VARIABLE return_code
452 OUTPUT_VARIABLE output ERROR_VARIABLE output
453 OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_STRIP_TRAILING_WHITESPACE)
455 file(TO_CMAKE_PATH "${output}" output)
456 set(${RESULT} ${output} PARENT_SCOPE)
457 endif(NOT return_code)
458 endfunction(_QT4_QUERY_QMAKE)
461 SET(QT4_INSTALLED_VERSION_TOO_OLD FALSE)
463 GET_FILENAME_COMPONENT(qt_install_version "[HKEY_CURRENT_USER\\Software\\trolltech\\Versions;DefaultQtVersion]" NAME)
465 # Debian uses qmake-qt4
466 # macports' Qt uses qmake-mac
467 FIND_PROGRAM(QT_QMAKE_EXECUTABLE NAMES qmake qmake4 qmake-qt4 qmake-mac PATHS
468 "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\4.0.0;InstallDir]/bin"
469 "[HKEY_CURRENT_USER\\Software\\Trolltech\\Versions\\4.0.0;InstallDir]/bin"
470 "[HKEY_CURRENT_USER\\Software\\Trolltech\\Versions\\${qt_install_version};InstallDir]/bin"
472 DOC "The qmake executable for the Qt installation to use"
475 IF (QT_QMAKE_EXECUTABLE)
477 IF(QT_QMAKE_EXECUTABLE_LAST)
478 STRING(COMPARE NOTEQUAL "${QT_QMAKE_EXECUTABLE_LAST}" "${QT_QMAKE_EXECUTABLE}" QT_QMAKE_CHANGED)
479 ENDIF(QT_QMAKE_EXECUTABLE_LAST)
481 SET(QT_QMAKE_EXECUTABLE_LAST "${QT_QMAKE_EXECUTABLE}" CACHE INTERNAL "" FORCE)
483 SET(QT4_QMAKE_FOUND FALSE)
485 _qt4_query_qmake(QT_VERSION QTVERSION)
487 # check for qt3 qmake and then try and find qmake4 or qmake-qt4 in the path
489 SET(QT_QMAKE_EXECUTABLE NOTFOUND CACHE FILEPATH "" FORCE)
490 FIND_PROGRAM(QT_QMAKE_EXECUTABLE NAMES qmake4 qmake-qt4 PATHS
491 "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\4.0.0;InstallDir]/bin"
492 "[HKEY_CURRENT_USER\\Software\\Trolltech\\Versions\\4.0.0;InstallDir]/bin"
494 DOC "The qmake executable for the Qt installation to use"
496 IF(QT_QMAKE_EXECUTABLE)
497 _qt4_query_qmake(QT_VERSION QTVERSION)
498 ENDIF(QT_QMAKE_EXECUTABLE)
501 # check that we found the Qt4 qmake, Qt3 qmake output won't match here
502 STRING(REGEX MATCH "^[0-9]+\\.[0-9]+\\.[0-9]+" qt_version_tmp "${QTVERSION}")
505 # we need at least version 4.0.0
506 IF (NOT QT_MIN_VERSION)
507 SET(QT_MIN_VERSION "4.0.0")
508 ENDIF (NOT QT_MIN_VERSION)
510 #now parse the parts of the user given version string into variables
511 STRING(REGEX MATCH "^[0-9]+\\.[0-9]+\\.[0-9]+" req_qt_major_vers "${QT_MIN_VERSION}")
512 IF (NOT req_qt_major_vers)
513 MESSAGE( FATAL_ERROR "Invalid Qt version string given: \"${QT_MIN_VERSION}\", expected e.g. \"4.0.1\"")
514 ENDIF (NOT req_qt_major_vers)
516 # now parse the parts of the user given version string into variables
517 STRING(REGEX REPLACE "^([0-9]+)\\.[0-9]+\\.[0-9]+" "\\1" req_qt_major_vers "${QT_MIN_VERSION}")
518 STRING(REGEX REPLACE "^[0-9]+\\.([0-9])+\\.[0-9]+" "\\1" req_qt_minor_vers "${QT_MIN_VERSION}")
519 STRING(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+)" "\\1" req_qt_patch_vers "${QT_MIN_VERSION}")
521 # Suppport finding at least a particular version, for instance FIND_PACKAGE( Qt4 4.4.3 )
522 # This implementation is a hack to avoid duplicating code and make sure we stay
523 # source-compatible with CMake 2.6.x
524 IF( Qt4_FIND_VERSION )
525 SET( QT_MIN_VERSION ${Qt4_FIND_VERSION} )
526 SET( req_qt_major_vers ${Qt4_FIND_VERSION_MAJOR} )
527 SET( req_qt_minor_vers ${Qt4_FIND_VERSION_MINOR} )
528 SET( req_qt_patch_vers ${Qt4_FIND_VERSION_PATCH} )
529 ENDIF( Qt4_FIND_VERSION )
531 IF (NOT req_qt_major_vers EQUAL 4)
532 MESSAGE( FATAL_ERROR "Invalid Qt version string given: \"${QT_MIN_VERSION}\", major version 4 is required, e.g. \"4.0.1\"")
533 ENDIF (NOT req_qt_major_vers EQUAL 4)
535 # and now the version string given by qmake
536 STRING(REGEX REPLACE "^([0-9]+)\\.[0-9]+\\.[0-9]+.*" "\\1" QT_VERSION_MAJOR "${QTVERSION}")
537 STRING(REGEX REPLACE "^[0-9]+\\.([0-9])+\\.[0-9]+.*" "\\1" QT_VERSION_MINOR "${QTVERSION}")
538 STRING(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" QT_VERSION_PATCH "${QTVERSION}")
540 # compute an overall version number which can be compared at once
541 MATH(EXPR req_vers "${req_qt_major_vers}*10000 + ${req_qt_minor_vers}*100 + ${req_qt_patch_vers}")
542 MATH(EXPR found_vers "${QT_VERSION_MAJOR}*10000 + ${QT_VERSION_MINOR}*100 + ${QT_VERSION_PATCH}")
544 # Support finding *exactly* a particular version, for instance FIND_PACKAGE( Qt4 4.4.3 EXACT )
545 IF( Qt4_FIND_VERSION_EXACT )
546 IF(found_vers EQUAL req_vers)
547 SET( QT4_QMAKE_FOUND TRUE )
548 ELSE(found_vers EQUAL req_vers)
549 SET( QT4_QMAKE_FOUND FALSE )
550 IF (found_vers LESS req_vers)
551 SET(QT4_INSTALLED_VERSION_TOO_OLD TRUE)
552 ELSE (found_vers LESS req_vers)
553 SET(QT4_INSTALLED_VERSION_TOO_NEW TRUE)
554 ENDIF (found_vers LESS req_vers)
555 ENDIF(found_vers EQUAL req_vers)
556 ELSE( Qt4_FIND_VERSION_EXACT )
557 IF (found_vers LESS req_vers)
558 SET(QT4_QMAKE_FOUND FALSE)
559 SET(QT4_INSTALLED_VERSION_TOO_OLD TRUE)
560 ELSE (found_vers LESS req_vers)
561 SET(QT4_QMAKE_FOUND TRUE)
562 ENDIF (found_vers LESS req_vers)
563 ENDIF( Qt4_FIND_VERSION_EXACT )
564 ENDIF (qt_version_tmp)
566 ENDIF (QT_QMAKE_EXECUTABLE)
570 # ask qmake for the mkspecs directory
571 # we do this first because QT_LIBINFIX might be set
572 IF (NOT QT_MKSPECS_DIR OR QT_QMAKE_CHANGED)
573 _qt4_query_qmake(QMAKE_MKSPECS qt_mkspecs_dirs)
574 # do not replace : on windows as it might be a drive letter
575 # and windows should already use ; as a separator
577 STRING(REPLACE ":" ";" qt_mkspecs_dirs "${qt_mkspecs_dirs}")
580 foreach(qt_cross_path ${CMAKE_FIND_ROOT_PATH})
581 set(qt_cross_paths ${qt_cross_paths} "${qt_cross_path}/mkspecs")
582 endforeach(qt_cross_path)
583 SET(QT_MKSPECS_DIR NOTFOUND)
584 FIND_PATH(QT_MKSPECS_DIR NAMES qconfig.pri
585 HINTS ${qt_cross_paths} ${qt_mkspecs_dirs}
586 DOC "The location of the Qt mkspecs containing qconfig.pri")
589 IF(EXISTS "${QT_MKSPECS_DIR}/qconfig.pri")
590 FILE(READ ${QT_MKSPECS_DIR}/qconfig.pri _qconfig_FILE_contents)
591 STRING(REGEX MATCH "QT_CONFIG[^\n]+" QT_QCONFIG "${_qconfig_FILE_contents}")
592 STRING(REGEX MATCH "CONFIG[^\n]+" QT_CONFIG "${_qconfig_FILE_contents}")
593 STRING(REGEX MATCH "EDITION[^\n]+" QT_EDITION "${_qconfig_FILE_contents}")
594 STRING(REGEX MATCH "QT_LIBINFIX[^\n]+" _qconfig_qt_libinfix "${_qconfig_FILE_contents}")
595 STRING(REGEX REPLACE "QT_LIBINFIX *= *([^\n]*)" "\\1" QT_LIBINFIX "${_qconfig_qt_libinfix}")
596 ENDIF(EXISTS "${QT_MKSPECS_DIR}/qconfig.pri")
597 IF("${QT_EDITION}" MATCHES "DesktopLight")
598 SET(QT_EDITION_DESKTOPLIGHT 1)
599 ENDIF("${QT_EDITION}" MATCHES "DesktopLight")
601 # ask qmake for the library dir as a hint, then search for QtCore library and use that as a reference for finding the
602 # others and for setting QT_LIBRARY_DIR
603 IF (NOT QT_QTCORE_LIBRARY OR QT_QMAKE_CHANGED)
604 _qt4_query_qmake(QT_INSTALL_LIBS QT_LIBRARY_DIR_TMP)
605 SET(QT_QTCORE_LIBRARY_RELEASE NOTFOUND)
606 SET(QT_QTCORE_LIBRARY_DEBUG NOTFOUND)
607 FIND_LIBRARY(QT_QTCORE_LIBRARY_RELEASE
608 NAMES QtCore${QT_LIBINFIX} QtCore${QT_LIBINFIX}4
609 HINTS ${QT_LIBRARY_DIR_TMP}
610 NO_CMAKE_PATH NO_CMAKE_ENVIRONMENT_PATH NO_SYSTEM_ENVIRONMENT_PATH
612 FIND_LIBRARY(QT_QTCORE_LIBRARY_DEBUG
613 NAMES QtCore${QT_LIBINFIX}_debug QtCore${QT_LIBINFIX}d QtCore${QT_LIBINFIX}d4
614 HINTS ${QT_LIBRARY_DIR_TMP}
615 NO_CMAKE_PATH NO_CMAKE_ENVIRONMENT_PATH NO_SYSTEM_ENVIRONMENT_PATH
618 # try dropping a hint if trying to use Visual Studio with Qt built by mingw
619 IF(NOT QT_QTCORE_LIBRARY_RELEASE AND MSVC)
620 IF(EXISTS ${QT_LIBRARY_DIR_TMP}/libqtmain.a)
621 MESSAGE( FATAL_ERROR "It appears you're trying to use Visual Studio with Qt built by mingw. Those compilers do not produce code compatible with each other.")
622 ENDIF(EXISTS ${QT_LIBRARY_DIR_TMP}/libqtmain.a)
623 ENDIF(NOT QT_QTCORE_LIBRARY_RELEASE AND MSVC)
625 ENDIF (NOT QT_QTCORE_LIBRARY OR QT_QMAKE_CHANGED)
627 _QT4_ADJUST_LIB_VARS(QtCore)
629 # set QT_LIBRARY_DIR based on location of QtCore found.
630 IF(QT_QTCORE_LIBRARY_RELEASE)
631 GET_FILENAME_COMPONENT(QT_LIBRARY_DIR_TMP "${QT_QTCORE_LIBRARY_RELEASE}" PATH)
632 SET(QT_LIBRARY_DIR ${QT_LIBRARY_DIR_TMP} CACHE INTERNAL "Qt library dir" FORCE)
633 SET(QT_QTCORE_FOUND 1)
634 ELSEIF(QT_QTCORE_LIBRARY_DEBUG)
635 GET_FILENAME_COMPONENT(QT_LIBRARY_DIR_TMP "${QT_QTCORE_LIBRARY_DEBUG}" PATH)
636 SET(QT_LIBRARY_DIR ${QT_LIBRARY_DIR_TMP} CACHE INTERNAL "Qt library dir" FORCE)
637 SET(QT_QTCORE_FOUND 1)
639 MESSAGE("Warning: QT_QMAKE_EXECUTABLE reported QT_INSTALL_LIBS as ${QT_LIBRARY_DIR_TMP}")
640 MESSAGE("Warning: But QtCore couldn't be found. Qt must NOT be installed correctly, or it wasn't found for cross compiling.")
641 IF(Qt4_FIND_REQUIRED)
642 MESSAGE( FATAL_ERROR "Could NOT find QtCore. Check ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log for more details.")
643 ENDIF(Qt4_FIND_REQUIRED)
647 IF (EXISTS ${QT_LIBRARY_DIR}/QtCore.framework)
648 SET(QT_USE_FRAMEWORKS ON CACHE INTERNAL "" FORCE)
649 ELSE (EXISTS ${QT_LIBRARY_DIR}/QtCore.framework)
650 SET(QT_USE_FRAMEWORKS OFF CACHE INTERNAL "" FORCE)
651 ENDIF (EXISTS ${QT_LIBRARY_DIR}/QtCore.framework)
652 MARK_AS_ADVANCED(QT_USE_FRAMEWORKS)
655 # ask qmake for the binary dir
656 IF (NOT QT_BINARY_DIR OR QT_QMAKE_CHANGED)
657 _qt4_query_qmake(QT_INSTALL_BINS qt_bins)
658 SET(QT_BINARY_DIR ${qt_bins} CACHE INTERNAL "" FORCE)
659 ENDIF (NOT QT_BINARY_DIR OR QT_QMAKE_CHANGED)
661 # ask qmake for the include dir
662 IF (QT_LIBRARY_DIR AND (NOT QT_QTCORE_INCLUDE_DIR OR NOT QT_HEADERS_DIR OR QT_QMAKE_CHANGED))
663 _qt4_query_qmake(QT_INSTALL_HEADERS qt_headers)
664 SET(QT_QTCORE_INCLUDE_DIR NOTFOUND)
665 FIND_PATH(QT_QTCORE_INCLUDE_DIR QtCore
667 ${QT_LIBRARY_DIR}/QtCore.framework/Headers
671 # Set QT_HEADERS_DIR based on finding QtCore header
672 IF(QT_QTCORE_INCLUDE_DIR)
673 IF(QT_USE_FRAMEWORKS)
674 SET(QT_HEADERS_DIR "${qt_headers}" CACHE INTERNAL "" FORCE)
675 ELSE(QT_USE_FRAMEWORKS)
676 GET_FILENAME_COMPONENT(qt_headers "${QT_QTCORE_INCLUDE_DIR}/../" ABSOLUTE)
677 SET(QT_HEADERS_DIR "${qt_headers}" CACHE INTERNAL "" FORCE)
678 ENDIF(QT_USE_FRAMEWORKS)
680 MESSAGE("Warning: QT_QMAKE_EXECUTABLE reported QT_INSTALL_HEADERS as ${qt_headers}")
681 MESSAGE("Warning: But QtCore couldn't be found. Qt must NOT be installed correctly.")
685 # Set QT_INCLUDE_DIR based on QT_HEADERS_DIR
687 IF(QT_USE_FRAMEWORKS)
688 # Qt/Mac frameworks has two include dirs.
689 # One is the framework include for which CMake will add a -F flag
690 # and the other is an include dir for non-framework Qt modules
691 SET(QT_INCLUDE_DIR ${QT_HEADERS_DIR} ${QT_QTCORE_LIBRARY} )
692 ELSE(QT_USE_FRAMEWORKS)
693 SET(QT_INCLUDE_DIR ${QT_HEADERS_DIR})
694 ENDIF(QT_USE_FRAMEWORKS)
695 ENDIF(QT_HEADERS_DIR)
698 SET( QT_INCLUDES ${QT_MKSPECS_DIR}/default ${QT_INCLUDE_DIR} ${QT_QTCORE_INCLUDE_DIR})
701 # ask qmake for the documentation directory
702 IF (QT_LIBRARY_DIR AND NOT QT_DOC_DIR OR QT_QMAKE_CHANGED)
703 _qt4_query_qmake(QT_INSTALL_DOCS qt_doc_dir)
704 SET(QT_DOC_DIR ${qt_doc_dir} CACHE PATH "The location of the Qt docs" FORCE)
705 ENDIF (QT_LIBRARY_DIR AND NOT QT_DOC_DIR OR QT_QMAKE_CHANGED)
708 # ask qmake for the plugins directory
709 IF (QT_LIBRARY_DIR AND NOT QT_PLUGINS_DIR OR QT_QMAKE_CHANGED)
710 _qt4_query_qmake(QT_INSTALL_PLUGINS qt_plugins_dir)
711 SET(QT_PLUGINS_DIR NOTFOUND)
712 foreach(qt_cross_path ${CMAKE_FIND_ROOT_PATH})
713 set(qt_cross_paths ${qt_cross_paths} "${qt_cross_path}/plugins")
714 endforeach(qt_cross_path)
715 FIND_PATH(QT_PLUGINS_DIR NAMES accessible imageformats sqldrivers codecs designer
716 HINTS ${qt_cross_paths} ${qt_plugins_dir}
717 DOC "The location of the Qt plugins")
718 ENDIF (QT_LIBRARY_DIR AND NOT QT_PLUGINS_DIR OR QT_QMAKE_CHANGED)
720 # ask qmake for the translations directory
721 IF (QT_LIBRARY_DIR AND NOT QT_TRANSLATIONS_DIR OR QT_QMAKE_CHANGED)
722 _qt4_query_qmake(QT_INSTALL_TRANSLATIONS qt_translations_dir)
723 SET(QT_TRANSLATIONS_DIR ${qt_translations_dir} CACHE PATH "The location of the Qt translations" FORCE)
724 ENDIF (QT_LIBRARY_DIR AND NOT QT_TRANSLATIONS_DIR OR QT_QMAKE_CHANGED)
726 # ask qmake for the imports directory
727 IF (QT_LIBRARY_DIR AND NOT QT_IMPORTS_DIR OR QT_QMAKE_CHANGED)
728 _qt4_query_qmake(QT_INSTALL_IMPORTS qt_imports_dir)
730 SET(QT_IMPORTS_DIR NOTFOUND)
731 foreach(qt_cross_path ${CMAKE_FIND_ROOT_PATH})
732 set(qt_cross_paths ${qt_cross_paths} "${qt_cross_path}/imports")
733 endforeach(qt_cross_path)
734 FIND_PATH(QT_IMPORTS_DIR NAMES Qt
735 HINTS ${qt_cross_paths} ${qt_imports_dir}
736 DOC "The location of the Qt imports"
737 NO_CMAKE_PATH NO_CMAKE_ENVIRONMENT_PATH NO_SYSTEM_ENVIRONMENT_PATH
738 NO_CMAKE_SYSTEM_PATH)
739 mark_as_advanced(QT_IMPORTS_DIR)
740 endif(qt_imports_dir)
741 ENDIF (QT_LIBRARY_DIR AND NOT QT_IMPORTS_DIR OR QT_QMAKE_CHANGED)
743 # Make variables changeble to the advanced user
744 MARK_AS_ADVANCED( QT_LIBRARY_DIR QT_DOC_DIR QT_MKSPECS_DIR
745 QT_PLUGINS_DIR QT_TRANSLATIONS_DIR)
750 #############################################
752 # Find out what window system we're using
754 #############################################
755 # Save required variable
756 SET(CMAKE_REQUIRED_INCLUDES_SAVE ${CMAKE_REQUIRED_INCLUDES})
757 SET(CMAKE_REQUIRED_FLAGS_SAVE ${CMAKE_REQUIRED_FLAGS})
758 # Add QT_INCLUDE_DIR to CMAKE_REQUIRED_INCLUDES
759 SET(CMAKE_REQUIRED_INCLUDES "${CMAKE_REQUIRED_INCLUDES};${QT_INCLUDE_DIR}")
760 # Check for Window system symbols (note: only one should end up being set)
761 CHECK_SYMBOL_EXISTS(Q_WS_X11 "QtCore/qglobal.h" Q_WS_X11)
762 CHECK_SYMBOL_EXISTS(Q_WS_WIN "QtCore/qglobal.h" Q_WS_WIN)
763 CHECK_SYMBOL_EXISTS(Q_WS_QWS "QtCore/qglobal.h" Q_WS_QWS)
764 CHECK_SYMBOL_EXISTS(Q_WS_MAC "QtCore/qglobal.h" Q_WS_MAC)
767 UNSET(QT_MAC_USE_COCOA CACHE)
768 ENDIF(QT_QMAKE_CHANGED)
769 CHECK_SYMBOL_EXISTS(QT_MAC_USE_COCOA "QtCore/qconfig.h" QT_MAC_USE_COCOA)
772 IF (QT_QTCOPY_REQUIRED)
773 CHECK_SYMBOL_EXISTS(QT_IS_QTCOPY "QtCore/qglobal.h" QT_KDE_QT_COPY)
774 IF (NOT QT_IS_QTCOPY)
775 MESSAGE(FATAL_ERROR "qt-copy is required, but hasn't been found")
776 ENDIF (NOT QT_IS_QTCOPY)
777 ENDIF (QT_QTCOPY_REQUIRED)
779 # Restore CMAKE_REQUIRED_INCLUDES and CMAKE_REQUIRED_FLAGS variables
780 SET(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES_SAVE})
781 SET(CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS_SAVE})
783 #############################################
787 ########################################
789 # Setting the INCLUDE-Variables
791 ########################################
793 SET(QT_MODULES QtGui Qt3Support QtSvg QtScript QtTest QtUiTools
794 QtHelp QtWebKit QtXmlPatterns phonon QtNetwork QtMultimedia
795 QtNsPlugin QtOpenGL QtSql QtXml QtDesigner QtDBus QtScriptTools
799 SET(QT_MODULES ${QT_MODULES} QtMotif)
803 FOREACH(QT_MODULE ${QT_MODULES})
804 STRING(TOUPPER ${QT_MODULE} _upper_qt_module)
805 SET(QT_${_upper_qt_module}_INCLUDE_DIR NOTFOUND)
806 SET(QT_${_upper_qt_module}_LIBRARY_RELEASE NOTFOUND)
807 SET(QT_${_upper_qt_module}_LIBRARY_DEBUG NOTFOUND)
808 ENDFOREACH(QT_MODULE)
809 SET(QT_QTDESIGNERCOMPONENTS_INCLUDE_DIR NOTFOUND)
810 SET(QT_QTDESIGNERCOMPONENTS_LIBRARY_RELEASE NOTFOUND)
811 SET(QT_QTDESIGNERCOMPONENTS_LIBRARY_DEBUG NOTFOUND)
812 SET(QT_QTASSISTANTCLIENT_INCLUDE_DIR NOTFOUND)
813 SET(QT_QTASSISTANTCLIENT_LIBRARY_RELEASE NOTFOUND)
814 SET(QT_QTASSISTANTCLIENT_LIBRARY_DEBUG NOTFOUND)
815 SET(QT_QTASSISTANT_INCLUDE_DIR NOTFOUND)
816 SET(QT_QTASSISTANT_LIBRARY_RELEASE NOTFOUND)
817 SET(QT_QTASSISTANT_LIBRARY_DEBUG NOTFOUND)
818 SET(QT_QTCLUCENE_LIBRARY_RELEASE NOTFOUND)
819 SET(QT_QTCLUCENE_LIBRARY_DEBUG NOTFOUND)
820 SET(QT_QAXCONTAINER_INCLUDE_DIR NOTFOUND)
821 SET(QT_QAXCONTAINER_LIBRARY_RELEASE NOTFOUND)
822 SET(QT_QAXCONTAINER_LIBRARY_DEBUG NOTFOUND)
823 SET(QT_QAXSERVER_INCLUDE_DIR NOTFOUND)
824 SET(QT_QAXSERVER_LIBRARY_RELEASE NOTFOUND)
825 SET(QT_QAXSERVER_LIBRARY_DEBUG NOTFOUND)
827 SET(QT_QTMAIN_LIBRARY_DEBUG NOTFOUND)
828 SET(QT_QTMAIN_LIBRARY_RELEASE NOTFOUND)
830 ENDIF(QT_QMAKE_CHANGED)
832 FOREACH(QT_MODULE ${QT_MODULES})
833 STRING(TOUPPER ${QT_MODULE} _upper_qt_module)
834 FIND_PATH(QT_${_upper_qt_module}_INCLUDE_DIR ${QT_MODULE}
836 ${QT_HEADERS_DIR}/${QT_MODULE}
837 ${QT_LIBRARY_DIR}/${QT_MODULE}.framework/Headers
838 NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
840 # phonon doesn't seem consistent, let's try phonondefs.h for some
842 IF(${QT_MODULE} STREQUAL "phonon")
843 FIND_PATH(QT_${_upper_qt_module}_INCLUDE_DIR phonondefs.h
845 ${QT_HEADERS_DIR}/${QT_MODULE}
846 ${QT_LIBRARY_DIR}/${QT_MODULE}.framework/Headers
847 NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
849 ENDIF(${QT_MODULE} STREQUAL "phonon")
850 ENDFOREACH(QT_MODULE)
853 SET(QT_MODULES ${QT_MODULES} QAxContainer QAxServer)
854 # Set QT_AXCONTAINER_INCLUDE_DIR and QT_AXSERVER_INCLUDE_DIR
855 FIND_PATH(QT_QAXCONTAINER_INCLUDE_DIR ActiveQt
856 PATHS ${QT_HEADERS_DIR}/ActiveQt
857 NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
859 FIND_PATH(QT_QAXSERVER_INCLUDE_DIR ActiveQt
860 PATHS ${QT_HEADERS_DIR}/ActiveQt
861 NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
865 # Set QT_QTDESIGNERCOMPONENTS_INCLUDE_DIR
866 FIND_PATH(QT_QTDESIGNERCOMPONENTS_INCLUDE_DIR QDesignerComponents
868 ${QT_HEADERS_DIR}/QtDesigner
869 ${QT_LIBRARY_DIR}/QtDesigner.framework/Headers
870 NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
873 # Set QT_QTASSISTANT_INCLUDE_DIR
874 FIND_PATH(QT_QTASSISTANT_INCLUDE_DIR QtAssistant
876 ${QT_HEADERS_DIR}/QtAssistant
877 ${QT_LIBRARY_DIR}/QtAssistant.framework/Headers
878 NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
881 # Set QT_QTASSISTANTCLIENT_INCLUDE_DIR
882 FIND_PATH(QT_QTASSISTANTCLIENT_INCLUDE_DIR QAssistantClient
884 ${QT_HEADERS_DIR}/QtAssistant
885 ${QT_LIBRARY_DIR}/QtAssistant.framework/Headers
886 NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
889 ########################################
891 # Setting the LIBRARY-Variables
893 ########################################
896 FOREACH(QT_MODULE ${QT_MODULES})
897 STRING(TOUPPER ${QT_MODULE} _upper_qt_module)
898 FIND_LIBRARY(QT_${_upper_qt_module}_LIBRARY_RELEASE
899 NAMES ${QT_MODULE}${QT_LIBINFIX} ${QT_MODULE}${QT_LIBINFIX}4
900 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
902 FIND_LIBRARY(QT_${_upper_qt_module}_LIBRARY_DEBUG
903 NAMES ${QT_MODULE}${QT_LIBINFIX}_debug ${QT_MODULE}${QT_LIBINFIX}d ${QT_MODULE}${QT_LIBINFIX}d4
904 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
906 ENDFOREACH(QT_MODULE)
908 # QtUiTools not with other frameworks with binary installation (in /usr/lib)
909 IF(Q_WS_MAC AND QT_QTCORE_LIBRARY_RELEASE AND NOT QT_QTUITOOLS_LIBRARY_RELEASE)
910 FIND_LIBRARY(QT_QTUITOOLS_LIBRARY_RELEASE NAMES QtUiTools${QT_LIBINFIX} PATHS ${QT_LIBRARY_DIR})
911 ENDIF(Q_WS_MAC AND QT_QTCORE_LIBRARY_RELEASE AND NOT QT_QTUITOOLS_LIBRARY_RELEASE)
913 # Set QT_QTDESIGNERCOMPONENTS_LIBRARY
914 FIND_LIBRARY(QT_QTDESIGNERCOMPONENTS_LIBRARY_RELEASE NAMES QtDesignerComponents${QT_LIBINFIX} QtDesignerComponents${QT_LIBINFIX}4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
915 FIND_LIBRARY(QT_QTDESIGNERCOMPONENTS_LIBRARY_DEBUG NAMES QtDesignerComponents${QT_LIBINFIX}_debug QtDesignerComponents${QT_LIBINFIX}d QtDesignerComponents${QT_LIBINFIX}d4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
917 # Set QT_QTMAIN_LIBRARY
919 FIND_LIBRARY(QT_QTMAIN_LIBRARY_RELEASE NAMES qtmain${QT_LIBINFIX} PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
920 FIND_LIBRARY(QT_QTMAIN_LIBRARY_DEBUG NAMES qtmain${QT_LIBINFIX}d PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
923 # Set QT_QTASSISTANTCLIENT_LIBRARY
924 FIND_LIBRARY(QT_QTASSISTANTCLIENT_LIBRARY_RELEASE NAMES QtAssistantClient${QT_LIBINFIX} QtAssistantClient${QT_LIBINFIX}4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
925 FIND_LIBRARY(QT_QTASSISTANTCLIENT_LIBRARY_DEBUG NAMES QtAssistantClient${QT_LIBINFIX}_debug QtAssistantClient${QT_LIBINFIX}d QtAssistantClient${QT_LIBINFIX}d4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
927 # Set QT_QTASSISTANT_LIBRARY
928 FIND_LIBRARY(QT_QTASSISTANT_LIBRARY_RELEASE NAMES QtAssistantClient${QT_LIBINFIX} QtAssistantClient${QT_LIBINFIX}4 QtAssistant${QT_LIBINFIX} QtAssistant${QT_LIBINFIX}4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
929 FIND_LIBRARY(QT_QTASSISTANT_LIBRARY_DEBUG NAMES QtAssistantClient${QT_LIBINFIX}_debug QtAssistantClient${QT_LIBINFIX}d QtAssistantClient${QT_LIBINFIX}d4 QtAssistant${QT_LIBINFIX}_debug QtAssistant${QT_LIBINFIX}d4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
931 # Set QT_QTHELP_LIBRARY
932 FIND_LIBRARY(QT_QTCLUCENE_LIBRARY_RELEASE NAMES QtCLucene${QT_LIBINFIX} QtCLucene${QT_LIBINFIX}4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
933 FIND_LIBRARY(QT_QTCLUCENE_LIBRARY_DEBUG NAMES QtCLucene${QT_LIBINFIX}_debug QtCLucene${QT_LIBINFIX}d QtCLucene${QT_LIBINFIX}d4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
934 IF(Q_WS_MAC AND QT_QTCORE_LIBRARY_RELEASE AND NOT QT_QTCLUCENE_LIBRARY_RELEASE)
935 FIND_LIBRARY(QT_QTCLUCENE_LIBRARY_RELEASE NAMES QtCLucene${QT_LIBINFIX} PATHS ${QT_LIBRARY_DIR})
936 ENDIF(Q_WS_MAC AND QT_QTCORE_LIBRARY_RELEASE AND NOT QT_QTCLUCENE_LIBRARY_RELEASE)
939 ############################################
941 # Check the existence of the libraries.
943 ############################################
945 # On OSX when Qt is found as framework, never use the imported targets for now, since
946 # in this case the handling of the framework directory currently does not work correctly.
947 IF(QT_USE_FRAMEWORKS)
948 SET(QT_USE_IMPORTED_TARGETS FALSE)
949 ENDIF(QT_USE_FRAMEWORKS)
952 # Set QT_xyz_LIBRARY variable and add
953 # library include path to QT_INCLUDES
954 FOREACH(QT_MODULE ${QT_MODULES})
955 _QT4_ADJUST_LIB_VARS(${QT_MODULE})
956 ENDFOREACH(QT_MODULE)
958 _QT4_ADJUST_LIB_VARS(QtAssistant)
959 _QT4_ADJUST_LIB_VARS(QtAssistantClient)
960 _QT4_ADJUST_LIB_VARS(QtCLucene)
961 _QT4_ADJUST_LIB_VARS(QtDesignerComponents)
963 # platform dependent libraries
965 _QT4_ADJUST_LIB_VARS(qtmain)
966 _QT4_ADJUST_LIB_VARS(QAxServer)
967 _QT4_ADJUST_LIB_VARS(QAxContainer)
971 #######################################
973 # Check the executables of Qt
976 #######################################
980 SET(QT_UIC_EXECUTABLE NOTFOUND)
981 SET(QT_MOC_EXECUTABLE NOTFOUND)
982 SET(QT_UIC3_EXECUTABLE NOTFOUND)
983 SET(QT_RCC_EXECUTABLE NOTFOUND)
984 SET(QT_DBUSCPP2XML_EXECUTABLE NOTFOUND)
985 SET(QT_DBUSXML2CPP_EXECUTABLE NOTFOUND)
986 SET(QT_LUPDATE_EXECUTABLE NOTFOUND)
987 SET(QT_LRELEASE_EXECUTABLE NOTFOUND)
988 SET(QT_QCOLLECTIONGENERATOR_EXECUTABLE NOTFOUND)
989 SET(QT_DESIGNER_EXECUTABLE NOTFOUND)
990 SET(QT_LINGUIST_EXECUTABLE NOTFOUND)
991 ENDIF(QT_QMAKE_CHANGED)
993 FIND_PROGRAM(QT_MOC_EXECUTABLE
995 PATHS ${QT_BINARY_DIR}
996 NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
999 FIND_PROGRAM(QT_UIC_EXECUTABLE
1001 PATHS ${QT_BINARY_DIR}
1002 NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
1005 FIND_PROGRAM(QT_UIC3_EXECUTABLE
1007 PATHS ${QT_BINARY_DIR}
1008 NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
1011 FIND_PROGRAM(QT_RCC_EXECUTABLE
1013 PATHS ${QT_BINARY_DIR}
1014 NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
1017 FIND_PROGRAM(QT_DBUSCPP2XML_EXECUTABLE
1019 PATHS ${QT_BINARY_DIR}
1020 NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
1023 FIND_PROGRAM(QT_DBUSXML2CPP_EXECUTABLE
1025 PATHS ${QT_BINARY_DIR}
1026 NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
1029 FIND_PROGRAM(QT_LUPDATE_EXECUTABLE
1030 NAMES lupdate-qt4 lupdate
1031 PATHS ${QT_BINARY_DIR}
1032 NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
1035 FIND_PROGRAM(QT_LRELEASE_EXECUTABLE
1036 NAMES lrelease-qt4 lrelease
1037 PATHS ${QT_BINARY_DIR}
1038 NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
1041 FIND_PROGRAM(QT_QCOLLECTIONGENERATOR_EXECUTABLE
1042 NAMES qcollectiongenerator-qt4 qcollectiongenerator
1043 PATHS ${QT_BINARY_DIR}
1044 NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
1047 FIND_PROGRAM(QT_DESIGNER_EXECUTABLE
1048 NAMES designer-qt4 designer
1049 PATHS ${QT_BINARY_DIR}
1050 NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
1053 FIND_PROGRAM(QT_LINGUIST_EXECUTABLE
1054 NAMES linguist-qt4 linguist
1055 PATHS ${QT_BINARY_DIR}
1056 NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
1059 IF (QT_MOC_EXECUTABLE)
1060 SET(QT_WRAP_CPP "YES")
1061 ENDIF (QT_MOC_EXECUTABLE)
1063 IF (QT_UIC_EXECUTABLE)
1064 SET(QT_WRAP_UI "YES")
1065 ENDIF (QT_UIC_EXECUTABLE)
1069 MARK_AS_ADVANCED( QT_UIC_EXECUTABLE QT_UIC3_EXECUTABLE QT_MOC_EXECUTABLE
1070 QT_RCC_EXECUTABLE QT_DBUSXML2CPP_EXECUTABLE QT_DBUSCPP2XML_EXECUTABLE
1071 QT_LUPDATE_EXECUTABLE QT_LRELEASE_EXECUTABLE QT_QCOLLECTIONGENERATOR_EXECUTABLE
1072 QT_DESIGNER_EXECUTABLE QT_LINGUIST_EXECUTABLE)
1075 # get the directory of the current file, used later on in the file
1076 GET_FILENAME_COMPONENT( _qt4_current_dir "${CMAKE_CURRENT_LIST_FILE}" PATH)
1078 ######################################
1080 # decide if Qt got found
1082 ######################################
1084 # if the includes,libraries,moc,uic and rcc are found then we have it
1085 IF( QT_LIBRARY_DIR AND QT_INCLUDE_DIR AND QT_MOC_EXECUTABLE AND
1086 QT_UIC_EXECUTABLE AND QT_RCC_EXECUTABLE AND QT_QTCORE_LIBRARY)
1087 SET( QT4_FOUND "YES" )
1088 INCLUDE(FindPackageMessage)
1089 FIND_PACKAGE_MESSAGE(Qt4 "Found Qt-Version ${QTVERSION} (using ${QT_QMAKE_EXECUTABLE})"
1090 "[${QT_LIBRARY_DIR}][${QT_INCLUDE_DIR}][${QT_MOC_EXECUTABLE}][${QT_UIC_EXECUTABLE}][${QT_RCC_EXECUTABLE}]")
1091 ELSE( QT_LIBRARY_DIR AND QT_INCLUDE_DIR AND QT_MOC_EXECUTABLE AND
1092 QT_UIC_EXECUTABLE AND QT_RCC_EXECUTABLE AND QT_QTCORE_LIBRARY)
1093 SET( QT4_FOUND "NO")
1094 SET(QT_QMAKE_EXECUTABLE "${QT_QMAKE_EXECUTABLE}-NOTFOUND" CACHE FILEPATH "Invalid qmake found" FORCE)
1095 IF( Qt4_FIND_REQUIRED)
1096 MESSAGE( FATAL_ERROR "Qt libraries, includes, moc, uic or/and rcc NOT found!")
1097 ENDIF( Qt4_FIND_REQUIRED)
1098 ENDIF( QT_LIBRARY_DIR AND QT_INCLUDE_DIR AND QT_MOC_EXECUTABLE AND
1099 QT_UIC_EXECUTABLE AND QT_RCC_EXECUTABLE AND QT_QTCORE_LIBRARY)
1101 SET(QT_FOUND ${QT4_FOUND})
1104 ###############################################
1106 # configuration/system dependent settings
1108 ###############################################
1110 INCLUDE("${_qt4_current_dir}/Qt4ConfigDependentSettings.cmake")
1113 #######################################
1115 # Check the plugins of Qt
1117 #######################################
1119 SET( QT_PLUGIN_TYPES accessible bearer codecs decorations designer gfxdrivers graphicssystems iconengines imageformats inputmethods mousedrivers phonon_backend script sqldrivers )
1121 SET( QT_ACCESSIBLE_PLUGINS qtaccessiblecompatwidgets qtaccessiblewidgets )
1122 SET( QT_BEARER_PLUGINS qcorewlanbearer qgenericbearer )
1123 SET( QT_CODECS_PLUGINS qcncodecs qjpcodecs qkrcodecs qtwcodecs )
1124 SET( QT_DECORATIONS_PLUGINS qdecorationdefault qdecorationwindows )
1125 SET( QT_DESIGNER_PLUGINS arthurplugin containerextension customwidgetplugin phononwidgets qdeclarativeview qt3supportwidgets qwebview taskmenuextension worldtimeclockplugin )
1126 SET( QT_GRAPHICSDRIVERS_PLUGINS qgfxtransformed qgfxvnc qscreenvfb )
1127 SET( QT_GRAPHICSSYSTEMS_PLUGINS qglgraphicssystem qtracegraphicssystem )
1128 SET( QT_ICONENGINES_PLUGINS qsvgicon )
1129 SET( QT_IMAGEFORMATS_PLUGINS qgif qjpeg qmng qico qsvg qtiff )
1130 SET( QT_INPUTMETHODS_PLUGINS qimsw_multi )
1131 SET( QT_MOUSEDRIVERS_PLUGINS qwstslibmousehandler )
1132 SET( QT_PHONON_BACKEND_PLUGINS phonon_qt7 )
1133 SET( QT_SCRIPT_PLUGINS qtscriptdbus )
1134 SET( QT_SQLDRIVERS_PLUGINS qsqldb2 qsqlibase qsqlite qsqlite2 qsqlmysql qsqloci qsqlodbc qsqlpsql qsqltds )
1136 IF(QT_QMAKE_CHANGED)
1137 FOREACH(QT_PLUGIN_TYPE ${QT_PLUGIN_TYPES})
1138 STRING(TOUPPER ${QT_PLUGIN_TYPE} _upper_qt_plugin_type)
1139 SET(QT_${_upper_qt_plugin_type}_PLUGINS_DIR ${QT_PLUGINS_DIR}/${QT_PLUGIN_TYPE})
1140 FOREACH(QT_PLUGIN ${QT_${_upper_qt_plugin_type}_PLUGINS})
1141 STRING(TOUPPER ${QT_PLUGIN} _upper_qt_plugin)
1142 UNSET(QT_${_upper_qt_plugin}_LIBRARY_RELEASE CACHE)
1143 UNSET(QT_${_upper_qt_plugin}_LIBRARY_DEBUG CACHE)
1144 UNSET(QT_${_upper_qt_plugin}_LIBRARY CACHE)
1145 UNSET(QT_${_upper_qt_plugin}_PLUGIN_RELEASE CACHE)
1146 UNSET(QT_${_upper_qt_plugin}_PLUGIN_DEBUG CACHE)
1147 UNSET(QT_${_upper_qt_plugin}_PLUGIN CACHE)
1148 ENDFOREACH(QT_PLUGIN)
1149 ENDFOREACH(QT_PLUGIN_TYPE)
1150 ENDIF(QT_QMAKE_CHANGED)
1152 # find_library works better than find_file but we need to set prefixes to only match plugins
1153 FOREACH(QT_PLUGIN_TYPE ${QT_PLUGIN_TYPES})
1154 STRING(TOUPPER ${QT_PLUGIN_TYPE} _upper_qt_plugin_type)
1155 SET(QT_${_upper_qt_plugin_type}_PLUGINS_DIR ${QT_PLUGINS_DIR}/${QT_PLUGIN_TYPE})
1156 FOREACH(QT_PLUGIN ${QT_${_upper_qt_plugin_type}_PLUGINS})
1157 STRING(TOUPPER ${QT_PLUGIN} _upper_qt_plugin)
1159 FIND_LIBRARY(QT_${_upper_qt_plugin}_LIBRARY_RELEASE
1160 NAMES ${QT_PLUGIN}${QT_LIBINFIX} ${QT_PLUGIN}${QT_LIBINFIX}4
1161 PATHS ${QT_${_upper_qt_plugin_type}_PLUGINS_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
1163 FIND_LIBRARY(QT_${_upper_qt_plugin}_LIBRARY_DEBUG
1164 NAMES ${QT_PLUGIN}${QT_LIBINFIX}_debug ${QT_PLUGIN}${QT_LIBINFIX}d ${QT_PLUGIN}${QT_LIBINFIX}d4
1165 PATHS ${QT_${_upper_qt_plugin_type}_PLUGINS_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
1167 _QT4_ADJUST_LIB_VARS(${QT_PLUGIN})
1169 # find_library works easier/better than find_file but we need to set suffixes to only match plugins
1170 SET(CMAKE_FIND_LIBRARY_SUFFIXES_DEFAULT ${CMAKE_FIND_LIBRARY_SUFFIXES})
1171 SET(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_SHARED_MODULE_SUFFIX} ${CMAKE_SHARED_LIBRARY_SUFFIX})
1172 FIND_LIBRARY(QT_${_upper_qt_plugin}_PLUGIN_RELEASE
1173 NAMES ${QT_PLUGIN}${QT_LIBINFIX} ${QT_PLUGIN}${QT_LIBINFIX}4
1174 PATHS ${QT_${_upper_qt_plugin_type}_PLUGINS_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
1176 FIND_LIBRARY(QT_${_upper_qt_plugin}_PLUGIN_DEBUG
1177 NAMES ${QT_PLUGIN}${QT_LIBINFIX}_debug ${QT_PLUGIN}${QT_LIBINFIX}d ${QT_PLUGIN}${QT_LIBINFIX}d4
1178 PATHS ${QT_${_upper_qt_plugin_type}_PLUGINS_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
1180 MARK_AS_ADVANCED(QT_${_upper_qt_plugin}_PLUGIN_RELEASE QT_${_upper_qt_plugin}_PLUGIN_DEBUG)
1181 SET(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_DEFAULT})
1183 ENDFOREACH(QT_PLUGIN)
1184 ENDFOREACH(QT_PLUGIN_TYPE)
1187 ######################################
1189 # Macros for building Qt files
1191 ######################################
1193 INCLUDE("${_qt4_current_dir}/Qt4Macros.cmake")
1196 #######################################
1198 # compatibility settings
1200 #######################################
1201 # Backwards compatibility for CMake1.4 and 1.2
1202 SET (QT_MOC_EXE ${QT_MOC_EXECUTABLE} )
1203 SET (QT_UIC_EXE ${QT_UIC_EXECUTABLE} )
1205 SET( QT_QT_LIBRARY "")
1207 ELSE(QT4_QMAKE_FOUND)
1209 SET(QT_QMAKE_EXECUTABLE "${QT_QMAKE_EXECUTABLE}-NOTFOUND" CACHE FILEPATH "Invalid qmake found" FORCE)
1211 # The code below is overly complex to make sure we do not break compatibility with CMake 2.6.x
1212 # For CMake 2.8, it should be simplified by getting rid of QT4_INSTALLED_VERSION_TOO_OLD and
1213 # QT4_INSTALLED_VERSION_TOO_NEW
1214 IF(Qt4_FIND_REQUIRED)
1215 IF(QT4_INSTALLED_VERSION_TOO_OLD)
1216 IF( Qt4_FIND_VERSION_EXACT )
1217 MESSAGE(FATAL_ERROR "The installed Qt version ${QTVERSION} is too old, version ${QT_MIN_VERSION} is required")
1218 ELSE( Qt4_FIND_VERSION_EXACT )
1219 MESSAGE(FATAL_ERROR "The installed Qt version ${QTVERSION} is too old, at least version ${QT_MIN_VERSION} is required")
1220 ENDIF( Qt4_FIND_VERSION_EXACT )
1221 ELSE(QT4_INSTALLED_VERSION_TOO_OLD)
1222 IF( Qt4_FIND_VERSION_EXACT AND QT4_INSTALLED_VERSION_TOO_NEW )
1223 MESSAGE(FATAL_ERROR "The installed Qt version ${QTVERSION} is too new, version ${QT_MIN_VERSION} is required")
1224 ELSE( Qt4_FIND_VERSION_EXACT AND QT4_INSTALLED_VERSION_TOO_NEW )
1225 MESSAGE( FATAL_ERROR "Qt qmake not found!")
1226 ENDIF( Qt4_FIND_VERSION_EXACT AND QT4_INSTALLED_VERSION_TOO_NEW )
1227 ENDIF(QT4_INSTALLED_VERSION_TOO_OLD)
1228 ELSE(Qt4_FIND_REQUIRED)
1229 IF(QT4_INSTALLED_VERSION_TOO_OLD AND NOT Qt4_FIND_QUIETLY)
1230 MESSAGE(STATUS "The installed Qt version ${QTVERSION} is too old, at least version ${QT_MIN_VERSION} is required")
1231 ENDIF(QT4_INSTALLED_VERSION_TOO_OLD AND NOT Qt4_FIND_QUIETLY)
1232 ENDIF(Qt4_FIND_REQUIRED)
1234 ENDIF (QT4_QMAKE_FOUND)