summaryrefslogtreecommitdiffstats
path: root/Modules/DeployQt4.cmake
diff options
context:
space:
mode:
authorMike McQuaid <mike@mikemcquaid.com>2012-02-21 17:11:28 (GMT)
committerMike McQuaid <mike@mikemcquaid.com>2012-02-23 21:01:45 (GMT)
commit4853e1effddd36c37d8e2fb4962f039c0d08af80 (patch)
treeed9bdfbb59ada28f807425d9df58cf4891c5d22e /Modules/DeployQt4.cmake
parent35cbf23c951e545560e11d79074a66988345c9eb (diff)
downloadCMake-4853e1effddd36c37d8e2fb4962f039c0d08af80.zip
CMake-4853e1effddd36c37d8e2fb4962f039c0d08af80.tar.gz
CMake-4853e1effddd36c37d8e2fb4962f039c0d08af80.tar.bz2
Fix plugin installation issues.
Diffstat (limited to 'Modules/DeployQt4.cmake')
-rw-r--r--Modules/DeployQt4.cmake40
1 files changed, 27 insertions, 13 deletions
diff --git a/Modules/DeployQt4.cmake b/Modules/DeployQt4.cmake
index a5051df..8a5e9c5 100644
--- a/Modules/DeployQt4.cmake
+++ b/Modules/DeployQt4.cmake
@@ -220,11 +220,7 @@ function(install_qt4_plugin plugin executable copy installed_plugin_path_var)
if(EXISTS "${plugin}")
install_qt4_plugin_path("${plugin}" "${executable}" "${copy}" "${installed_plugin_path_var}" "${plugins_dir}" "${component}")
else()
- if(QT_IS_STATIC)
- string(TOUPPER "QT_${plugin}_LIBRARY" plugin_var)
- else()
- string(TOUPPER "QT_${plugin}_PLUGIN" plugin_var)
- endif()
+ string(TOUPPER "QT_${plugin}_PLUGIN" plugin_var)
set(plugin_release_var "${plugin_var}_RELEASE")
set(plugin_debug_var "${plugin_var}_DEBUG")
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}")
message(WARNING "Qt plugin \"${plugin}\" not recognized or found.")
endif()
- install_qt4_plugin_path("${plugin_release}" "${executable}" "${copy}" "${installed_plugin_path_var}" "${plugins_dir}" "${component}" "Release|RelWithDebInfo|MinSizeRel")
- install_qt4_plugin_path("${plugin_debug}" "${executable}" "${copy}" "${installed_plugin_path_var}" "${plugins_dir}" "${component}" "Debug")
+ if(NOT EXISTS "${${plugin_debug_var}}")
+ 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()
- set(installed_plugin_paths ${${installed_plugin_path_var}} PARENT_SCOPE)
+ set(${installed_plugin_path_var} ${${installed_plugin_path_var}} PARENT_SCOPE)
endfunction()
function(install_qt4_executable executable)
@@ -264,11 +274,15 @@ function(install_qt4_executable executable)
set(qt_plugins_dir "")
endif()
- foreach(plugin ${qtplugins})
- set(installed_plugin_paths "")
- install_qt4_plugin("${plugin}" "${executable}" 0 installed_plugin_paths "${plugins_dir}" "${component}")
- list(APPEND libs ${installed_plugin_paths})
- endforeach()
+ if(QT_IS_STATIC)
+ message(WARNING "Qt built statically: not installing plugins.")
+ else()
+ foreach(plugin ${qtplugins})
+ 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)