|
|
@@ -106,7 +106,6 @@ and plugin installation. See documentation of FIXUP_QT4_BUNDLE.
|
|
|
# The functions defined in this file depend on the fixup_bundle function
|
|
|
# (and others) found in BundleUtilities.cmake
|
|
|
|
|
|
-include("${CMAKE_CURRENT_LIST_DIR}/BundleUtilities.cmake")
|
|
|
set(DeployQt4_cmake_dir "${CMAKE_CURRENT_LIST_DIR}")
|
|
|
set(DeployQt4_apple_plugins_dir "PlugIns")
|
|
|
|
|
|
@@ -137,80 +136,92 @@ function(resolve_qt4_paths paths_var)
|
|
|
set(${paths_var} ${paths_resolved} PARENT_SCOPE)
|
|
|
endfunction()
|
|
|
|
|
|
-function(fixup_qt4_executable executable)
|
|
|
- unset(qtplugins)
|
|
|
- if(ARGC GREATER 1)
|
|
|
- set(qtplugins ${ARGV1})
|
|
|
- endif()
|
|
|
- unset(libs)
|
|
|
- if(ARGC GREATER 2)
|
|
|
- set(libs ${ARGV2})
|
|
|
- endif()
|
|
|
- unset(dirs)
|
|
|
- if(ARGC GREATER 3)
|
|
|
- set(dirs ${ARGV3})
|
|
|
- endif()
|
|
|
- unset(plugins_dir)
|
|
|
- if(ARGC GREATER 4)
|
|
|
- set(plugins_dir ${ARGV4})
|
|
|
- endif()
|
|
|
- unset(request_qt_conf)
|
|
|
- if(ARGC GREATER 5)
|
|
|
- set(request_qt_conf ${ARGV5})
|
|
|
- endif()
|
|
|
+cmake_policy(GET CMP0080 _cmp0080_value)
|
|
|
+if(NOT DEFINED CMAKE_GENERATOR OR NOT _cmp0080_value STREQUAL "NEW")
|
|
|
+ set(_CMP0080_SUPPRESS_WARNING TRUE)
|
|
|
+ include("${CMAKE_CURRENT_LIST_DIR}/BundleUtilities.cmake")
|
|
|
+ unset(_CMP0080_SUPPRESS_WARNING)
|
|
|
|
|
|
- message(STATUS "fixup_qt4_executable")
|
|
|
- message(STATUS " executable='${executable}'")
|
|
|
- message(STATUS " qtplugins='${qtplugins}'")
|
|
|
- message(STATUS " libs='${libs}'")
|
|
|
- message(STATUS " dirs='${dirs}'")
|
|
|
- message(STATUS " plugins_dir='${plugins_dir}'")
|
|
|
- message(STATUS " request_qt_conf='${request_qt_conf}'")
|
|
|
-
|
|
|
- if(QT_LIBRARY_DIR)
|
|
|
- list(APPEND dirs "${QT_LIBRARY_DIR}")
|
|
|
- endif()
|
|
|
- if(QT_BINARY_DIR)
|
|
|
- list(APPEND dirs "${QT_BINARY_DIR}")
|
|
|
- endif()
|
|
|
+ function(fixup_qt4_executable executable)
|
|
|
+ cmake_policy(GET CMP0080 _cmp0080_value)
|
|
|
+ if(_cmp0080_value STREQUAL "" AND DEFINED CMAKE_GENERATOR)
|
|
|
+ _warn_cmp0080()
|
|
|
+ endif()
|
|
|
|
|
|
- if(APPLE)
|
|
|
- set(qt_conf_dir "${executable}/Contents/Resources")
|
|
|
- set(executable_path "${executable}")
|
|
|
- set(write_qt_conf TRUE)
|
|
|
- if(NOT DEFINED plugins_dir)
|
|
|
- set(plugins_dir "${DeployQt4_apple_plugins_dir}")
|
|
|
+ unset(qtplugins)
|
|
|
+ if(ARGC GREATER 1)
|
|
|
+ set(qtplugins ${ARGV1})
|
|
|
endif()
|
|
|
- else()
|
|
|
- get_filename_component(executable_path "${executable}" PATH)
|
|
|
- if(NOT executable_path)
|
|
|
- set(executable_path ".")
|
|
|
+ unset(libs)
|
|
|
+ if(ARGC GREATER 2)
|
|
|
+ set(libs ${ARGV2})
|
|
|
+ endif()
|
|
|
+ unset(dirs)
|
|
|
+ if(ARGC GREATER 3)
|
|
|
+ set(dirs ${ARGV3})
|
|
|
+ endif()
|
|
|
+ unset(plugins_dir)
|
|
|
+ if(ARGC GREATER 4)
|
|
|
+ set(plugins_dir ${ARGV4})
|
|
|
+ endif()
|
|
|
+ unset(request_qt_conf)
|
|
|
+ if(ARGC GREATER 5)
|
|
|
+ set(request_qt_conf ${ARGV5})
|
|
|
endif()
|
|
|
- set(qt_conf_dir "${executable_path}")
|
|
|
- set(write_qt_conf ${request_qt_conf})
|
|
|
- endif()
|
|
|
|
|
|
- foreach(plugin ${qtplugins})
|
|
|
- set(installed_plugin_path "")
|
|
|
- install_qt4_plugin("${plugin}" "${executable}" 1 installed_plugin_path)
|
|
|
- list(APPEND libs ${installed_plugin_path})
|
|
|
- endforeach()
|
|
|
+ message(STATUS "fixup_qt4_executable")
|
|
|
+ message(STATUS " executable='${executable}'")
|
|
|
+ message(STATUS " qtplugins='${qtplugins}'")
|
|
|
+ message(STATUS " libs='${libs}'")
|
|
|
+ message(STATUS " dirs='${dirs}'")
|
|
|
+ message(STATUS " plugins_dir='${plugins_dir}'")
|
|
|
+ message(STATUS " request_qt_conf='${request_qt_conf}'")
|
|
|
|
|
|
- foreach(lib ${libs})
|
|
|
- if(NOT EXISTS "${lib}")
|
|
|
- message(FATAL_ERROR "Library does not exist: ${lib}")
|
|
|
+ if(QT_LIBRARY_DIR)
|
|
|
+ list(APPEND dirs "${QT_LIBRARY_DIR}")
|
|
|
+ endif()
|
|
|
+ if(QT_BINARY_DIR)
|
|
|
+ list(APPEND dirs "${QT_BINARY_DIR}")
|
|
|
+ endif()
|
|
|
+
|
|
|
+ if(APPLE)
|
|
|
+ set(qt_conf_dir "${executable}/Contents/Resources")
|
|
|
+ set(executable_path "${executable}")
|
|
|
+ set(write_qt_conf TRUE)
|
|
|
+ if(NOT DEFINED plugins_dir)
|
|
|
+ set(plugins_dir "${DeployQt4_apple_plugins_dir}")
|
|
|
+ endif()
|
|
|
+ else()
|
|
|
+ get_filename_component(executable_path "${executable}" PATH)
|
|
|
+ if(NOT executable_path)
|
|
|
+ set(executable_path ".")
|
|
|
+ endif()
|
|
|
+ set(qt_conf_dir "${executable_path}")
|
|
|
+ set(write_qt_conf ${request_qt_conf})
|
|
|
endif()
|
|
|
- endforeach()
|
|
|
|
|
|
- resolve_qt4_paths(libs "${executable_path}")
|
|
|
+ foreach(plugin ${qtplugins})
|
|
|
+ set(installed_plugin_path "")
|
|
|
+ install_qt4_plugin("${plugin}" "${executable}" 1 installed_plugin_path)
|
|
|
+ list(APPEND libs ${installed_plugin_path})
|
|
|
+ endforeach()
|
|
|
|
|
|
- if(write_qt_conf)
|
|
|
- set(qt_conf_contents "[Paths]\nPlugins = ${plugins_dir}")
|
|
|
- write_qt4_conf("${qt_conf_dir}" "${qt_conf_contents}")
|
|
|
- endif()
|
|
|
+ foreach(lib ${libs})
|
|
|
+ if(NOT EXISTS "${lib}")
|
|
|
+ message(FATAL_ERROR "Library does not exist: ${lib}")
|
|
|
+ endif()
|
|
|
+ endforeach()
|
|
|
|
|
|
- fixup_bundle("${executable}" "${libs}" "${dirs}")
|
|
|
-endfunction()
|
|
|
+ resolve_qt4_paths(libs "${executable_path}")
|
|
|
+
|
|
|
+ if(write_qt_conf)
|
|
|
+ set(qt_conf_contents "[Paths]\nPlugins = ${plugins_dir}")
|
|
|
+ write_qt4_conf("${qt_conf_dir}" "${qt_conf_contents}")
|
|
|
+ endif()
|
|
|
+
|
|
|
+ fixup_bundle("${executable}" "${libs}" "${dirs}")
|
|
|
+ endfunction()
|
|
|
+endif()
|
|
|
|
|
|
function(install_qt4_plugin_path plugin executable copy installed_plugin_path_var)
|
|
|
unset(plugins_dir)
|