diff options
author | Brad King <brad.king@kitware.com> | 2011-01-11 20:48:44 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2011-01-11 20:48:44 (GMT) |
commit | b8e5d7b49c4c00c80f861456c185daba987284c3 (patch) | |
tree | eee455425f09a5d40dcd57653d0d838fc78a3288 /Modules | |
parent | b524f864ca4928b266a3d5504cb5e62f9ca6038a (diff) | |
parent | e6bb8c7a6e33373a6056b5ae10c275eead57258f (diff) | |
download | CMake-b8e5d7b49c4c00c80f861456c185daba987284c3.zip CMake-b8e5d7b49c4c00c80f861456c185daba987284c3.tar.gz CMake-b8e5d7b49c4c00c80f861456c185daba987284c3.tar.bz2 |
Merge topic 'qt4-find-plugins'
e6bb8c7 Add support for using static/dynamic Qt plugins.
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/FindQt4.cmake | 92 |
1 files changed, 83 insertions, 9 deletions
diff --git a/Modules/FindQt4.cmake b/Modules/FindQt4.cmake index 6129329..d9d6ea7 100644 --- a/Modules/FindQt4.cmake +++ b/Modules/FindQt4.cmake @@ -1074,15 +1074,6 @@ IF (QT4_QMAKE_FOUND) ###################################### # - # Macros for building Qt files - # - ###################################### - - INCLUDE("${_qt4_current_dir}/Qt4Macros.cmake") - - - ###################################### - # # decide if Qt got found # ###################################### @@ -1118,6 +1109,89 @@ IF (QT4_QMAKE_FOUND) ####################################### # + # Check the plugins of Qt + # + ####################################### + + SET( QT_PLUGIN_TYPES accessible bearer codecs decorations designer gfxdrivers graphicssystems iconengines imageformats inputmethods mousedrivers phonon_backend script sqldrivers ) + + SET( QT_ACCESSIBLE_PLUGINS qtaccessiblecompatwidgets qtaccessiblewidgets ) + SET( QT_BEARER_PLUGINS qcorewlanbearer qgenericbearer ) + SET( QT_CODECS_PLUGINS qcncodecs qjpcodecs qkrcodecs qtwcodecs ) + SET( QT_DECORATIONS_PLUGINS qdecorationdefault qdecorationwindows ) + SET( QT_DESIGNER_PLUGINS arthurplugin containerextension customwidgetplugin phononwidgets qdeclarativeview qt3supportwidgets qwebview taskmenuextension worldtimeclockplugin ) + SET( QT_GRAPHICSDRIVERS_PLUGINS qgfxtransformed qgfxvnc qscreenvfb ) + SET( QT_GRAPHICSSYSTEMS_PLUGINS qglgraphicssystem qtracegraphicssystem ) + SET( QT_ICONENGINES_PLUGINS qsvgicon ) + SET( QT_IMAGEFORMATS_PLUGINS qgif qjpeg qmng qico qsvg qtiff ) + SET( QT_INPUTMETHODS_PLUGINS qimsw_multi ) + SET( QT_MOUSEDRIVERS_PLUGINS qwstslibmousehandler ) + SET( QT_PHONON_BACKEND_PLUGINS phonon_qt7 ) + SET( QT_SCRIPT_PLUGINS qtscriptdbus ) + SET( QT_SQLDRIVERS_PLUGINS qsqldb2 qsqlibase qsqlite qsqlite2 qsqlmysql qsqloci qsqlodbc qsqlpsql qsqltds ) + + IF(QT_QMAKE_CHANGED) + FOREACH(QT_PLUGIN_TYPE ${QT_PLUGIN_TYPES}) + STRING(TOUPPER ${QT_PLUGIN_TYPE} _upper_qt_plugin_type) + SET(QT_${_upper_qt_plugin_type}_PLUGINS_DIR ${QT_PLUGINS_DIR}/${QT_PLUGIN_TYPE}) + FOREACH(QT_PLUGIN ${QT_${_upper_qt_plugin_type}_PLUGINS}) + STRING(TOUPPER ${QT_PLUGIN} _upper_qt_plugin) + UNSET(QT_${_upper_qt_plugin}_LIBRARY_RELEASE CACHE) + UNSET(QT_${_upper_qt_plugin}_LIBRARY_DEBUG CACHE) + UNSET(QT_${_upper_qt_plugin}_LIBRARY CACHE) + UNSET(QT_${_upper_qt_plugin}_PLUGIN_RELEASE CACHE) + UNSET(QT_${_upper_qt_plugin}_PLUGIN_DEBUG CACHE) + UNSET(QT_${_upper_qt_plugin}_PLUGIN CACHE) + ENDFOREACH(QT_PLUGIN) + ENDFOREACH(QT_PLUGIN_TYPE) + ENDIF(QT_QMAKE_CHANGED) + + # find_library works better than find_file but we need to set prefixes to only match plugins + FOREACH(QT_PLUGIN_TYPE ${QT_PLUGIN_TYPES}) + STRING(TOUPPER ${QT_PLUGIN_TYPE} _upper_qt_plugin_type) + SET(QT_${_upper_qt_plugin_type}_PLUGINS_DIR ${QT_PLUGINS_DIR}/${QT_PLUGIN_TYPE}) + FOREACH(QT_PLUGIN ${QT_${_upper_qt_plugin_type}_PLUGINS}) + STRING(TOUPPER ${QT_PLUGIN} _upper_qt_plugin) + IF(QT_IS_STATIC) + FIND_LIBRARY(QT_${_upper_qt_plugin}_LIBRARY_RELEASE + NAMES ${QT_PLUGIN}${QT_LIBINFIX} ${QT_PLUGIN}${QT_LIBINFIX}4 + PATHS ${QT_${_upper_qt_plugin_type}_PLUGINS_DIR} NO_DEFAULT_PATH + ) + FIND_LIBRARY(QT_${_upper_qt_plugin}_LIBRARY_DEBUG + NAMES ${QT_PLUGIN}${QT_LIBINFIX}_debug ${QT_PLUGIN}${QT_LIBINFIX}d ${QT_PLUGIN}${QT_LIBINFIX}d4 + PATHS ${QT_${_upper_qt_plugin_type}_PLUGINS_DIR} NO_DEFAULT_PATH + ) + _QT4_ADJUST_LIB_VARS(${QT_PLUGIN}) + ELSE(QT_IS_STATIC) + # find_library works easier/better than find_file but we need to set suffixes to only match plugins + SET(CMAKE_FIND_LIBRARY_SUFFIXES_DEFAULT ${CMAKE_FIND_LIBRARY_SUFFIXES}) + SET(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_SHARED_MODULE_SUFFIX} ${CMAKE_SHARED_LIBRARY_SUFFIX}) + FIND_LIBRARY(QT_${_upper_qt_plugin}_PLUGIN_RELEASE + NAMES ${QT_PLUGIN}${QT_LIBINFIX} ${QT_PLUGIN}${QT_LIBINFIX}4 + PATHS ${QT_${_upper_qt_plugin_type}_PLUGINS_DIR} NO_DEFAULT_PATH + ) + FIND_LIBRARY(QT_${_upper_qt_plugin}_PLUGIN_DEBUG + NAMES ${QT_PLUGIN}${QT_LIBINFIX}_debug ${QT_PLUGIN}${QT_LIBINFIX}d ${QT_PLUGIN}${QT_LIBINFIX}d4 + PATHS ${QT_${_upper_qt_plugin_type}_PLUGINS_DIR} NO_DEFAULT_PATH + ) + MARK_AS_ADVANCED(QT_${_upper_qt_plugin}_PLUGIN_RELEASE QT_${_upper_qt_plugin}_PLUGIN_DEBUG) + SET(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_DEFAULT}) + ENDIF(QT_IS_STATIC) + ENDFOREACH(QT_PLUGIN) + ENDFOREACH(QT_PLUGIN_TYPE) + + + ###################################### + # + # Macros for building Qt files + # + ###################################### + + INCLUDE("${_qt4_current_dir}/Qt4Macros.cmake") + + + ####################################### + # # compatibility settings # ####################################### |