From d66d82e7f6fa31bea456893b897b8e04366c7e90 Mon Sep 17 00:00:00 2001 From: Cristian Adam Date: Fri, 31 Jan 2020 17:15:47 +0100 Subject: [PATCH] CMake Build: Fix MinGW libstdc++ dependency installation Change-Id: I8957991a86f1b5dc537e7da0b5cc47f645dd4511 Reviewed-by: Alessandro Portale --- src/QtCreatorDeployment.cmake | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/QtCreatorDeployment.cmake b/src/QtCreatorDeployment.cmake index 8eacedb8c39..47cf3c8fa94 100644 --- a/src/QtCreatorDeployment.cmake +++ b/src/QtCreatorDeployment.cmake @@ -147,9 +147,14 @@ if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.16) list(APPEND unresolved_deps libEGL.dll libGLESv2.dll) endif() - get_filename_component(compiler_dir \"${CMAKE_CXX_COMPILER}\" DIRECTORY) file(TO_CMAKE_PATH \"${CMAKE_PREFIX_PATH}\" prefix_path) - list(APPEND prefix_path \"\${compiler_dir}\") + + # Add parent link directory paths. Needed for e.g. MinGW choco libstdc++-6.dll + foreach(path \"${CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES}\") + get_filename_component(parent_path \"\${path}\" DIRECTORY) + list(APPEND prefix_path \"\${parent_path}\") + endforeach() + foreach(so IN LISTS unresolved_deps) string(REPLACE \"@rpath/\" \"\" so \"\${so}\") get_filename_component(so_dir \"\${so}\" DIRECTORY)