diff --git a/src/kit-manager.ts b/src/kit-manager.ts index eae859f..4299c18 100644 --- a/src/kit-manager.ts +++ b/src/kit-manager.ts @@ -468,16 +468,24 @@ export class KitManager { qtFolder: string, qtInstallations: string[] ) { - const loadedCMakeKits = await KitManager.loadCMakeKitsFileJSON(); + const allCMakeKits = await KitManager.loadCMakeKitsFileJSON(); logger.info(`qtFolder: "${qtFolder}"`); - logger.info(`Loaded CMake kits: ${JSON.stringify(loadedCMakeKits)}`); + logger.info(`Loaded CMake kits: ${JSON.stringify(allCMakeKits)}`); + // Filter out kits generated by us, since we only want to use Kits + // that were created by the cmake extension as templates. + const kitsFromCMakeExtension = allCMakeKits.filter( + (kit) => kit.environmentVariables?.VSCODE_QT_FOLDER === undefined + ); + logger.info( + `Kits from CMake extension: ${JSON.stringify(kitsFromCMakeExtension)}` + ); logger.info(`Qt installations: ${JSON.stringify(qtInstallations)}`); const kits = []; for (const installation of qtInstallations) for await (const kit of KitManager.generateCMakeKitsOfQtInstallationPath( qtFolder, installation, - loadedCMakeKits + kitsFromCMakeExtension )) kits.push(kit); return kits;