Fix QT_ADDITIONAL_(HOST_)PACKAGES_PREFIX_PATH environment variables

Except on Windows, the values in CMake environment variables that
contain path lists are separated by colons, not semicolons.  See
documentation of CMAKE_PREFIX_PATH.

This is necessary for conan's virtualenv generator which sets these
environment variables with native list separators.

This amends commit e044c94a61f0cd2bdea1e89be4ec3c68007f7a5c.

Pick-to: 6.2 6.3
Task-number: QTBUG-94524
Change-Id: I7f3d140a8462347b181f1d9601fd11cc1ba449db
Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This commit is contained in:
Joerg Bornemann 2022-02-22 14:14:26 +01:00
parent 56abd7e4e0
commit 71d011d35a
2 changed files with 12 additions and 2 deletions

View File

@ -69,7 +69,11 @@ function(__qt_internal_collect_additional_prefix_paths out_var prefixes_var)
endif()
if(DEFINED ENV{${prefixes_var}}
AND NOT "$ENV{${prefixes_var}}" STREQUAL "")
list(APPEND additional_packages_prefixes $ENV{${prefixes_var}})
set(prefixes_from_env "$ENV{${prefixes_var}}")
if(NOT CMAKE_HOST_WIN32)
string(REPLACE ":" ";" prefixes_from_env "${prefixes_from_env}")
endif()
list(APPEND additional_packages_prefixes ${prefixes_from_env})
endif()
foreach(additional_path IN LISTS additional_packages_prefixes)

View File

@ -96,8 +96,14 @@ if(QT_ADDITIONAL_PACKAGES_PREFIX_PATH)
endif()
if(DEFINED ENV{QT_ADDITIONAL_PACKAGES_PREFIX_PATH}
AND NOT "$ENV{QT_ADDITIONAL_PACKAGES_PREFIX_PATH}" STREQUAL "")
set(__qt_env_additional_packages_prefixes $ENV{QT_ADDITIONAL_PACKAGES_PREFIX_PATH})
if(NOT CMAKE_HOST_WIN32)
string(REPLACE ":" ";" __qt_env_additional_packages_prefixes
"${__qt_env_additional_packages_prefixes}")
endif()
list(APPEND __qt_toolchain_additional_packages_prefixes
$ENV{QT_ADDITIONAL_PACKAGES_PREFIX_PATH})
${__qt_env_additional_packages_prefixes})
unset(__qt_env_additional_packages_prefixes)
endif()
if(__qt_toolchain_additional_packages_prefixes)