[Cmake-commits] CMake branch, next, updated. v2.8.3-1136-ge44ca0b
Clinton Stimpson
clinton at elemtech.com
Sat Jan 1 20:13:05 EST 2011
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".
The branch, next has been updated
via e44ca0b4fd97637a604f2c8786793e1e805f88c1 (commit)
via 637daf6314d0d0f4185002ed8912c0f90d163fcd (commit)
from b5a1233319423c8d392a29462665befe5f0342fb (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e44ca0b4fd97637a604f2c8786793e1e805f88c1
commit e44ca0b4fd97637a604f2c8786793e1e805f88c1
Merge: b5a1233 637daf6
Author: Clinton Stimpson <clinton at elemtech.com>
AuthorDate: Sat Jan 1 20:12:48 2011 -0500
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Sat Jan 1 20:12:48 2011 -0500
Merge topic 'qt4-deploy-plugins' into next
637daf6 Add function to deploy qt plugins.
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=637daf6314d0d0f4185002ed8912c0f90d163fcd
commit 637daf6314d0d0f4185002ed8912c0f90d163fcd
Author: Clinton Stimpson <clinton at elemtech.com>
AuthorDate: Sat Jan 1 18:13:34 2011 -0700
Commit: Clinton Stimpson <clinton at elemtech.com>
CommitDate: Sat Jan 1 18:13:34 2011 -0700
Add function to deploy qt plugins.
diff --git a/Modules/FindQt4.cmake b/Modules/FindQt4.cmake
index d9d6ea7..a518a7a 100644
--- a/Modules/FindQt4.cmake
+++ b/Modules/FindQt4.cmake
@@ -150,6 +150,23 @@
# filenames can be found in qm_files. The ts_files
# must exists and are not updated in any way.
#
+# macro QT4_DEPLOY_DEFAULT_PLUGINS( install_prefix )
+# in: install_prefix
+# Invokes install() commands for installing the default set of Qt plugins needed by an application.
+# This can typically be called as qt4_deploy_default_plugins(bin/plugins)
+# The QT_USE_* variables can control whether plugins for Qt modules are deployed.
+#
+# macro QT4_DEPLOY_PLUGIN_GROUP( install_prefix group )
+# in: install_prefix
+# in: name of group of plugins (e.g. imageformats)
+# Invokes install() commands for installing a group of Qt plugins.
+#
+# macro QT4_DEPLOY_PLUGIN( install_prefix group plugin)
+# in: install_prefix
+# in: name of group of plugins (e.g. imageformats)
+# in: name of plugin to deploy (e.g. qgif)
+# Invokes install() commands for installing a single Qt plugin.
+#
#
# Below is a detailed list of variables that FindQt4.cmake sets.
# QT_FOUND If false, don't try to use Qt.
@@ -1113,7 +1130,7 @@ IF (QT4_QMAKE_FOUND)
#
#######################################
- SET( QT_PLUGIN_TYPES accessible bearer codecs decorations designer gfxdrivers graphicssystems iconengines imageformats inputmethods mousedrivers phonon_backend script sqldrivers )
+ SET( QT_PLUGIN_GROUPS 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 )
@@ -1131,35 +1148,34 @@ IF (QT4_QMAKE_FOUND)
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})
+ FOREACH(QT_PLUGIN_GROUP ${QT_PLUGIN_GROUPS})
+ STRING(TOUPPER ${QT_PLUGIN_GROUP} _upper_qt_plugin_group)
+ SET(QT_${_upper_qt_plugin_group}_PLUGINS_DIR ${QT_PLUGINS_DIR}/${QT_PLUGIN_GROUP})
+ FOREACH(QT_PLUGIN ${QT_${_upper_qt_plugin_group}_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)
+ ENDFOREACH(QT_PLUGIN_GROUP)
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})
+ FOREACH(QT_PLUGIN_GROUP ${QT_PLUGIN_GROUPS})
+ STRING(TOUPPER ${QT_PLUGIN_GROUP} _upper_qt_plugin_group)
+ SET(QT_${_upper_qt_plugin_group}_PLUGINS_DIR ${QT_PLUGINS_DIR}/${QT_PLUGIN_GROUP})
+ FOREACH(QT_PLUGIN ${QT_${_upper_qt_plugin_group}_PLUGINS})
STRING(TOUPPER ${QT_PLUGIN} _upper_qt_plugin)
IF(QT_IS_STATIC)
+ # find static Qt plugins that user can link with if necessary
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
+ PATHS ${QT_${_upper_qt_plugin_group}_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
+ PATHS ${QT_${_upper_qt_plugin_group}_PLUGINS_DIR} NO_DEFAULT_PATH
)
_QT4_ADJUST_LIB_VARS(${QT_PLUGIN})
ELSE(QT_IS_STATIC)
@@ -1168,17 +1184,17 @@ IF (QT4_QMAKE_FOUND)
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
+ PATHS ${QT_${_upper_qt_plugin_group}_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
+ PATHS ${QT_${_upper_qt_plugin_group}_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)
+ ENDFOREACH(QT_PLUGIN_GROUP)
######################################
diff --git a/Modules/Qt4Macros.cmake b/Modules/Qt4Macros.cmake
index 86a7404..ec7291e 100644
--- a/Modules/Qt4Macros.cmake
+++ b/Modules/Qt4Macros.cmake
@@ -413,3 +413,70 @@ MACRO(QT4_ADD_TRANSLATION _qm_files)
SET(${_qm_files} ${${_qm_files}} ${qm})
ENDFOREACH (_current_FILE)
ENDMACRO(QT4_ADD_TRANSLATION)
+
+
+function(QT4_DEPLOY_PLUGIN install_prefix _group _plugin)
+ string(TOUPPER ${_group} group)
+ string(TOUPPER ${_plugin} plugin)
+
+ set(plugin_file_release "${QT_${plugin}_PLUGIN_RELEASE}")
+ set(plugin_file_debug "${QT_${plugin}_PLUGIN_DEBUG}")
+
+ if(plugin_file_release AND plugin_file_debug)
+ install(FILES ${plugin_file_release} DESTINATION "${install_prefix}/${_group}/" CONFIGURATIONS Release OPTIONAL)
+ install(FILES ${plugin_file_debug} DESTINATION "${install_prefix}/${_group}/" CONFIGURATIONS Debug OPTIONAL)
+ else(plugin_file_release AND plugin_file_debug)
+ if(plugin_file_release)
+ install(FILES ${plugin_file_release} DESTINATION "${install_prefix}/${_group}/" OPTIONAL)
+ endif(plugin_file_release)
+ if(plugin_file_debug)
+ install(FILES ${plugin_file_debug} DESTINATION "${install_prefix}/${_group}/" OPTIONAL)
+ endif(plugin_file_debug)
+ endif(plugin_file_release AND plugin_file_debug)
+endfunction(QT4_DEPLOY_PLUGIN)
+
+
+
+function(QT4_DEPLOY_PLUGIN_GROUP install_prefix _group)
+ string(TOUPPER ${_group} group)
+ foreach(_plugin ${QT_${group}_PLUGINS})
+ qt4_deploy_plugin(${install_prefix} ${_group} ${_plugin})
+ endforeach(_plugin)
+endfunction(QT4_DEPLOY_PLUGIN_GROUP)
+
+
+
+function(QT4_DEPLOY_DEFAULT_PLUGINS install_prefix)
+
+ # always deploy image format plugins
+ qt4_deploy_plugin_group("${install_prefix}" imageformats)
+
+ #sql driver plugins if QtSql
+ if(QT_USE_QTSQL)
+ qt4_deploy_plugin_group("${install_prefix}" sqldrivers)
+ endif(QT_USE_QTSQL)
+
+ #script plugins if QtScript
+ if(QT_USE_QTSCRIPT)
+ qt4_deploy_plugin_group("${install_prefix}" script)
+ endif(QT_USE_QTSCRIPT)
+
+ #phonon backend plugins if phonon
+ if(QT_USE_PHONON)
+ qt4_deploy_plugin_group("${install_prefix}" phonon_backend)
+ endif(QT_USE_PHONON)
+
+ #svg icon plugin if QtSvg
+ if(QT_USE_QTSVG)
+ qt4_deploy_plugin_group("${install_prefix}" iconengines)
+ endif(QT_USE_QTSVG)
+
+ # always deploy accessibility plugins
+ qt4_deploy_plugin("${install_prefix}" accessible qtaccessiblewidgets)
+
+ # acessibility for qt3support if Qt3Support
+ if(QT_USE_QT3SUPPORT)
+ qt4_deploy_plugin("${install_prefix}" accessible qtaccessiblecompatwidgets)
+ endif(QT_USE_QT3SUPPORT)
+
+endfunction(QT4_DEPLOY_DEFAULT_PLUGINS)
-----------------------------------------------------------------------
Summary of changes:
Modules/FindQt4.cmake | 50 +++++++++++++++++++++++------------
Modules/Qt4Macros.cmake | 67 +++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 100 insertions(+), 17 deletions(-)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list