2020-02-05 19:38:18 +01:00
|
|
|
# Deployment of Qt, Clang, C++ Runtime libraries is being done in this script.
|
|
|
|
|
#
|
|
|
|
|
# It should be included as a subdirectory as last because of CMake's
|
|
|
|
|
# cmake_install.cmake script behviour of including subdirectories at the end
|
|
|
|
|
# of the script, not respecting the order of install commands from CMakeLists.txt
|
|
|
|
|
#
|
|
|
|
|
# This way we are sure that all the binaries have been installed before.
|
|
|
|
|
|
2020-02-12 08:24:50 +01:00
|
|
|
if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.16)
|
2020-02-05 19:38:18 +01:00
|
|
|
get_target_property(moc_binary Qt5::moc IMPORTED_LOCATION)
|
|
|
|
|
get_filename_component(moc_dir "${moc_binary}" DIRECTORY)
|
2020-02-06 13:17:20 +01:00
|
|
|
get_filename_component(QT_BASE_DIR "${moc_dir}/../" ABSOLUTE)
|
2020-02-05 19:38:18 +01:00
|
|
|
|
|
|
|
|
if (MSVC AND NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
|
|
|
|
|
set(exclusion_mask PATTERN "*d.dll" EXCLUDE)
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
foreach(plugin
|
2020-02-06 13:17:20 +01:00
|
|
|
assetimporters designer iconengines imageformats platforminputcontexts
|
|
|
|
|
platforms platformthemes printsupport qmltooling sqldrivers styles
|
|
|
|
|
xcbglintegrations)
|
|
|
|
|
if(NOT EXISTS "${QT_BASE_DIR}/plugins/${plugin}")
|
2020-02-05 19:38:18 +01:00
|
|
|
continue()
|
|
|
|
|
endif()
|
|
|
|
|
install(
|
2020-02-06 13:17:20 +01:00
|
|
|
DIRECTORY "${QT_BASE_DIR}/plugins/${plugin}"
|
|
|
|
|
DESTINATION ${QT_DEST_PLUGIN_PATH}
|
2020-02-12 08:24:50 +01:00
|
|
|
COMPONENT Dependencies
|
2020-02-13 12:29:04 +01:00
|
|
|
EXCLUDE_FROM_ALL
|
2020-02-05 19:38:18 +01:00
|
|
|
${exclusion_mask}
|
|
|
|
|
)
|
2020-02-06 13:17:20 +01:00
|
|
|
list(APPEND QT_PLUGIN_DIRECTORIES "${QT_DEST_PLUGIN_PATH}/${plugin}")
|
2020-02-05 19:38:18 +01:00
|
|
|
endforeach()
|
|
|
|
|
|
|
|
|
|
install(
|
2020-02-06 13:17:20 +01:00
|
|
|
DIRECTORY "${QT_BASE_DIR}/qml/"
|
|
|
|
|
DESTINATION ${QT_DEST_QML_PATH}
|
2020-02-12 08:24:50 +01:00
|
|
|
COMPONENT Dependencies
|
2020-02-13 12:29:04 +01:00
|
|
|
EXCLUDE_FROM_ALL
|
2020-02-05 19:38:18 +01:00
|
|
|
PATTERN "qml/*"
|
|
|
|
|
${exclusion_mask}
|
|
|
|
|
)
|
|
|
|
|
|
2020-02-25 19:28:35 +01:00
|
|
|
# QtCreator's "System Information..." needs qtdiag
|
|
|
|
|
set(qtdiag_destination ${IDE_BIN_PATH})
|
|
|
|
|
if (NOT APPLE AND NOT WIN32)
|
|
|
|
|
set(qtdiag_destination ${IDE_LIBRARY_BASE_PATH}/Qt/bin)
|
|
|
|
|
endif()
|
|
|
|
|
install(PROGRAMS
|
|
|
|
|
"${QT_BASE_DIR}/bin/qtdiag${CMAKE_EXECUTABLE_SUFFIX}"
|
|
|
|
|
DESTINATION ${qtdiag_destination}
|
|
|
|
|
COMPONENT Dependencies
|
|
|
|
|
EXCLUDE_FROM_ALL
|
|
|
|
|
)
|
|
|
|
|
|
2020-02-05 19:38:18 +01:00
|
|
|
# Analyze the binaries and install missing dependencies if they are
|
|
|
|
|
# found the CMAKE_PREFIX_PATH e.g. Qt, Clang
|
|
|
|
|
configure_file(InstallDependentSharedObjects.cmake.in InstallDependentSharedObjects.cmake @ONLY)
|
2020-02-12 08:24:50 +01:00
|
|
|
install(
|
|
|
|
|
SCRIPT ${CMAKE_CURRENT_BINARY_DIR}/InstallDependentSharedObjects.cmake
|
|
|
|
|
COMPONENT Dependencies
|
2020-02-13 12:29:04 +01:00
|
|
|
EXCLUDE_FROM_ALL
|
2020-02-12 08:24:50 +01:00
|
|
|
)
|
2020-02-05 19:38:18 +01:00
|
|
|
|
|
|
|
|
if (MSVC)
|
|
|
|
|
set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP ON)
|
|
|
|
|
include(InstallRequiredsystemLibraries)
|
|
|
|
|
|
2020-02-19 15:28:05 +01:00
|
|
|
# For Qt Creator
|
2020-02-05 19:38:18 +01:00
|
|
|
install(PROGRAMS ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS}
|
|
|
|
|
DESTINATION ${IDE_APP_PATH}
|
2020-02-12 08:24:50 +01:00
|
|
|
COMPONENT Dependencies
|
2020-02-13 12:29:04 +01:00
|
|
|
EXCLUDE_FROM_ALL
|
2020-02-05 19:38:18 +01:00
|
|
|
)
|
2020-02-19 15:28:05 +01:00
|
|
|
|
|
|
|
|
# For qtcreatorcdbext
|
|
|
|
|
set(ArchSuffix 32)
|
|
|
|
|
if (CMAKE_SIZEOF_VOID_P EQUAL 8)
|
|
|
|
|
set(ArchSuffix 64)
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
install(PROGRAMS ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS}
|
|
|
|
|
DESTINATION lib/qtcreatorcdbext${ArchSuffix}
|
|
|
|
|
COMPONENT Dependencies
|
|
|
|
|
EXCLUDE_FROM_ALL
|
|
|
|
|
)
|
2020-02-05 19:38:18 +01:00
|
|
|
endif()
|
|
|
|
|
endif()
|