From 82b6de6db6fe2be3a2c178fb713309da84ca00b6 Mon Sep 17 00:00:00 2001 From: Cristian Adam Date: Tue, 25 Feb 2020 19:28:35 +0100 Subject: [PATCH] CMake Build: Add qtdiag to Dependencies install target Change-Id: If1c56ff6e366ec4d5c4bb97e4a176cf9cf8dc4c5 Reviewed-by: Alessandro Portale --- cmake/CMakeLists.txt | 12 ++++++++++++ cmake/QtCreatorAPI.cmake | 13 ++++++++++++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 47c8c696f0d..a005ce71e8c 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -41,6 +41,18 @@ if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.16) ${exclusion_mask} ) + # 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 + ) + # 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) diff --git a/cmake/QtCreatorAPI.cmake b/cmake/QtCreatorAPI.cmake index bbfb0a214be..751f2d4f6f0 100644 --- a/cmake/QtCreatorAPI.cmake +++ b/cmake/QtCreatorAPI.cmake @@ -1044,7 +1044,18 @@ function(add_qtc_executable name) \"Prefix=\${qt_conf_binaries}\n\" ) endif() - + if (WIN32 OR APPLE) + file(RELATIVE_PATH qt_binaries + \"\${install_prefix}/\${base_dir}\" + \"\${install_prefix}/${IDE_BIN_PATH}\" + ) + if (NOT qt_binaries) + set(qt_binaries .) + endif() + file(APPEND \"\${CMAKE_INSTALL_PREFIX}/\${location}/qt.conf\" + \"# Needed by QtCreator for qtdiag\n\" + \"Binaries=\${qt_binaries}\n\") + endif() endfunction() if(APPLE) create_qt_conf(\"${_EXECUTABLE_PATH}\" \"${IDE_DATA_PATH}/..\")