Fix plugin installation issues.

This commit is contained in:
Mike McQuaid 2012-02-21 17:11:28 +00:00
parent 35cbf23c95
commit 4853e1effd
1 changed files with 27 additions and 13 deletions

View File

@ -220,11 +220,7 @@ function(install_qt4_plugin plugin executable copy installed_plugin_path_var)
if(EXISTS "${plugin}") if(EXISTS "${plugin}")
install_qt4_plugin_path("${plugin}" "${executable}" "${copy}" "${installed_plugin_path_var}" "${plugins_dir}" "${component}") install_qt4_plugin_path("${plugin}" "${executable}" "${copy}" "${installed_plugin_path_var}" "${plugins_dir}" "${component}")
else() else()
if(QT_IS_STATIC) string(TOUPPER "QT_${plugin}_PLUGIN" plugin_var)
string(TOUPPER "QT_${plugin}_LIBRARY" plugin_var)
else()
string(TOUPPER "QT_${plugin}_PLUGIN" plugin_var)
endif()
set(plugin_release_var "${plugin_var}_RELEASE") set(plugin_release_var "${plugin_var}_RELEASE")
set(plugin_debug_var "${plugin_var}_DEBUG") set(plugin_debug_var "${plugin_var}_DEBUG")
set(plugin_release "${${plugin_release_var}}") set(plugin_release "${${plugin_release_var}}")
@ -232,10 +228,24 @@ function(install_qt4_plugin plugin executable copy installed_plugin_path_var)
if(DEFINED "${plugin_release_var}" AND DEFINED "${plugin_debug_var}" AND NOT EXISTS "${plugin_release}" AND NOT EXISTS "${plugin_debug}") if(DEFINED "${plugin_release_var}" AND DEFINED "${plugin_debug_var}" AND NOT EXISTS "${plugin_release}" AND NOT EXISTS "${plugin_debug}")
message(WARNING "Qt plugin \"${plugin}\" not recognized or found.") message(WARNING "Qt plugin \"${plugin}\" not recognized or found.")
endif() endif()
install_qt4_plugin_path("${plugin_release}" "${executable}" "${copy}" "${installed_plugin_path_var}" "${plugins_dir}" "${component}" "Release|RelWithDebInfo|MinSizeRel") if(NOT EXISTS "${${plugin_debug_var}}")
install_qt4_plugin_path("${plugin_debug}" "${executable}" "${copy}" "${installed_plugin_path_var}" "${plugins_dir}" "${component}" "Debug") set(plugin_debug "${plugin_release}")
endif()
if(CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
install_qt4_plugin_path("${plugin_release}" "${executable}" "${copy}" "${installed_plugin_path_var}_release" "${plugins_dir}" "${component}" "Release|RelWithDebInfo|MinSizeRel")
install_qt4_plugin_path("${plugin_debug}" "${executable}" "${copy}" "${installed_plugin_path_var}_debug" "${plugins_dir}" "${component}" "Debug")
if(CMAKE_BUILD_TYPE MATCHES "^Debug$")
set(${installed_plugin_path_var} ${${installed_plugin_path_var}_debug})
else()
set(${installed_plugin_path_var} ${${installed_plugin_path_var}_release})
endif()
else()
install_qt4_plugin_path("${plugin_release}" "${executable}" "${copy}" "${installed_plugin_path_var}" "${plugins_dir}" "${component}")
endif()
endif() endif()
set(installed_plugin_paths ${${installed_plugin_path_var}} PARENT_SCOPE) set(${installed_plugin_path_var} ${${installed_plugin_path_var}} PARENT_SCOPE)
endfunction() endfunction()
function(install_qt4_executable executable) function(install_qt4_executable executable)
@ -264,11 +274,15 @@ function(install_qt4_executable executable)
set(qt_plugins_dir "") set(qt_plugins_dir "")
endif() endif()
foreach(plugin ${qtplugins}) if(QT_IS_STATIC)
set(installed_plugin_paths "") message(WARNING "Qt built statically: not installing plugins.")
install_qt4_plugin("${plugin}" "${executable}" 0 installed_plugin_paths "${plugins_dir}" "${component}") else()
list(APPEND libs ${installed_plugin_paths}) foreach(plugin ${qtplugins})
endforeach() set(installed_plugin_paths "")
install_qt4_plugin("${plugin}" "${executable}" 0 installed_plugin_paths "${plugins_dir}" "${component}")
list(APPEND libs ${installed_plugin_paths})
endforeach()
endif()
resolve_qt4_paths(libs) resolve_qt4_paths(libs)