Improve component support and output indentation.

This commit is contained in:
Mike McQuaid 2011-12-16 16:41:19 +00:00 committed by Clinton Stimpson
parent 4e9274e954
commit 3aa5432315
1 changed files with 13 additions and 9 deletions

View File

@ -56,11 +56,12 @@
# (or <plugins_dir>) relative to <executable> and store the result in # (or <plugins_dir>) relative to <executable> and store the result in
# <installed_plugin_path_var>. See documentation of INSTALL_QT4_PLUGIN_PATH. # <installed_plugin_path_var>. See documentation of INSTALL_QT4_PLUGIN_PATH.
# #
# INSTALL_QT4_EXECUTABLE(<executable> [<qtplugins> <libs> <dirs> <plugins_dir> <request_qt_conf>]) # INSTALL_QT4_EXECUTABLE(<executable> [<qtplugins> <libs> <dirs> <plugins_dir> <request_qt_conf> <component>])
# Installs Qt plugins, writes a Qt configuration file (if needed) and fixes up # Installs Qt plugins, writes a Qt configuration file (if needed) and fixes up
# a Qt4 executable using BundleUtilities so it is standalone and can be # a Qt4 executable using BundleUtilities so it is standalone and can be
# drag-and-drop copied to another machine as long as all of the system # drag-and-drop copied to another machine as long as all of the system
# libraries are compatible. The executable will be fixed-up at install time. # libraries are compatible. The executable will be fixed-up at install time.
# <component> is the COMPONENT used for bundle fixup and plugin installation.
# See documentation of FIXUP_QT4_BUNDLE. # See documentation of FIXUP_QT4_BUNDLE.
#============================================================================= #=============================================================================
@ -207,9 +208,6 @@ function(install_qt4_plugin_path plugin executable copy installed_plugin_path_va
else() else()
unset(configurations) unset(configurations)
endif() endif()
if(component)
set(component COMPONENT ${component})
endif()
install(FILES "${plugin}" DESTINATION "${plugins_path}" ${configurations} ${component}) install(FILES "${plugin}" DESTINATION "${plugins_path}" ${configurations} ${component})
endif() endif()
set(${installed_plugin_path_var} ${${installed_path_var}} "${plugins_path}/${plugin_name}" PARENT_SCOPE) set(${installed_plugin_path_var} ${${installed_path_var}} "${plugins_path}/${plugin_name}" PARENT_SCOPE)
@ -246,10 +244,15 @@ function(install_qt4_executable executable)
set(dirs ${ARGV3}) set(dirs ${ARGV3})
set(plugins_dir ${ARGV4}) set(plugins_dir ${ARGV4})
set(request_qt_conf ${ARGV5}) set(request_qt_conf ${ARGV5})
set(plugin_component ${ARGV6}) set(component ${ARGV6})
if(QT_LIBRARY_DIR) if(QT_LIBRARY_DIR)
list(APPEND dirs "${QT_LIBRARY_DIR}") list(APPEND dirs "${QT_LIBRARY_DIR}")
endif() endif()
if(component)
set(component COMPONENT ${component})
else()
unset(component)
endif()
get_filename_component(executable_absolute "${executable}" ABSOLUTE) get_filename_component(executable_absolute "${executable}" ABSOLUTE)
if(EXISTS "${QT_QTCORE_LIBRARY_RELEASE}") if(EXISTS "${QT_QTCORE_LIBRARY_RELEASE}")
@ -267,15 +270,16 @@ function(install_qt4_executable executable)
foreach(plugin ${qtplugins}) foreach(plugin ${qtplugins})
set(installed_plugin_paths "") set(installed_plugin_paths "")
install_qt4_plugin("${plugin}" "${executable}" 0 installed_plugin_paths "${plugins_dir}" "${plugin_component}") install_qt4_plugin("${plugin}" "${executable}" 0 installed_plugin_paths "${plugins_dir}" "${component}")
list(APPEND libs ${installed_plugin_paths}) list(APPEND libs ${installed_plugin_paths})
endforeach() endforeach()
resolve_qt4_paths(libs) resolve_qt4_paths(libs)
install(CODE install(CODE
" INCLUDE( \"${DeployQt4_cmake_dir}/DeployQt4.cmake\" ) "INCLUDE(\"${DeployQt4_cmake_dir}/DeployQt4.cmake\")
SET( BU_CHMOD_BUNDLE_ITEMS TRUE ) SET(BU_CHMOD_BUNDLE_ITEMS TRUE)
FIXUP_QT4_EXECUTABLE( \"\${CMAKE_INSTALL_PREFIX}/${executable}\" \"\" \"${libs}\" \"${dirs}\" \"${plugins_dir}\" \"${request_qt_conf}\" ) " FIXUP_QT4_EXECUTABLE(\"\${CMAKE_INSTALL_PREFIX}/${executable}\" \"\" \"${libs}\" \"${dirs}\" \"${plugins_dir}\" \"${request_qt_conf}\")"
${component}
) )
endfunction() endfunction()