diff --git a/contrib/qt/convert-prl-libs-to-cmake.pl b/contrib/qt/convert-prl-libs-to-cmake.pl --- a/contrib/qt/convert-prl-libs-to-cmake.pl +++ b/contrib/qt/convert-prl-libs-to-cmake.pl @@ -33,6 +33,7 @@ use warnings; my $qt_lib; +my $qt_lib_install_dir; my $component_name; my $out_name; my $compiler; @@ -42,6 +43,12 @@ sub processArgs { GetOptions ( "lib=s" => \$qt_lib, + # The installed Qt library directory might be different from the given + # library location. This is especially the case of the plugins wich are + # located in a separated 'plugin' directory. + # Let the caller set this installation dependent location rather than + # trying to determine it from the given library location. + "qt_lib_install_dir=s" => \$qt_lib_install_dir, "component=s" => \$component_name, "out=s" => \$out_name, "compiler=s" => \$compiler @@ -116,7 +123,7 @@ $lib = "$libs[$i] $libs[$i + 1]"; ++$i; } - $lib =~ s"\$\$\[QT_INSTALL_LIBS\]"$qt_lib_dir"g; + $lib =~ s"\$\$\[QT_INSTALL_LIBS\]"$qt_lib_install_dir"g; if (lc($compiler) eq 'msvc') { # convert backslashes diff --git a/src/qt/CMakeLists.txt b/src/qt/CMakeLists.txt --- a/src/qt/CMakeLists.txt +++ b/src/qt/CMakeLists.txt @@ -32,10 +32,11 @@ if(TARGET Qt5::${_qt_component}) get_target_property(_lib_location Qt5::${_qt_component} LOCATION) execute_process(COMMAND ${PERL_EXECUTABLE} "${CONVERT_PRL_PATH}" - --lib ${_lib_location} - --out ${STATIC_DEPENDENCIES_CMAKE_FILE} - --component ${_qt_component} - --compiler ${CMAKE_CXX_COMPILER_ID} + --lib "${_lib_location}" + --qt_lib_install_dir "${QT5_LIB_DIR}" + --out "${STATIC_DEPENDENCIES_CMAKE_FILE}" + --component "${_qt_component}" + --compiler "${CMAKE_CXX_COMPILER_ID}" ) endif() endmacro()