diff options
| author | Orkun Tokdemir <orkun.tokdemir@qt.io> | 2024-11-21 13:44:06 +0100 |
|---|---|---|
| committer | Orkun Tokdemir <orkun.tokdemir@qt.io> | 2024-11-21 13:33:08 +0000 |
| commit | 775d7a36e63036c3fd49f1ce572f02b3d5ac7e14 (patch) | |
| tree | 2ef27babee3478ea94fe45b120e03d9552503367 | |
| parent | 436b57b3d76bad2a8de59b67446c3d8171329162 (diff) | |
qt-ui: Add special lookup place to find Designer for vcpkg
On some platforms, Designer is not located in any of the qtpaths keys
directly. We also need to check `tools/qttools/bin` for Designer.
Change-Id: I0a49868262019654d6fd8aebbc9be76fb9f3da20
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
| -rw-r--r-- | qt-ui/src/util.ts | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/qt-ui/src/util.ts b/qt-ui/src/util.ts index c5dc2ea..ded5ed5 100644 --- a/qt-ui/src/util.ts +++ b/qt-ui/src/util.ts @@ -100,10 +100,30 @@ async function searchForDesignerInQtInfo(info: QtInfo) { 'QT_HOST_LIBEXECS', 'QT_INSTALL_LIBEXECS' ]; - for (const key of keysToCheck) { - const value = info.get(key); - if (value) { - const designerExePath = getDesignerExePath(value); + + const paths = keysToCheck + .map((key) => info.get(key)) + .filter((p) => { + return p !== undefined; + }); + + const addVcpkgPaths = (p: string[]) => { + const keys = ['QT_INSTALL_PREFIX', 'QT_HOST_PREFIX']; + for (const key of keys) { + const value = info.get(key); + if (value) { + const vcpkgPath = path.join(value, 'tools', 'qttools', 'bin'); + p.push(vcpkgPath); + } + } + }; + // It is a special case for vcpkg because on some platforms, Designer is + // installed in a different location + addVcpkgPaths(paths); + + for (const p of paths) { + if (p) { + const designerExePath = getDesignerExePath(p); if (await exists(designerExePath)) { return designerExePath; } |
