Beispiel #1
0
 public void ApplyKitEnv(StringDictionary envVars)
 {
     if (!string.IsNullOrEmpty(kitInfo.VSInstanceId) && !string.IsNullOrEmpty(kitInfo.VSArch))
     {
         var vsEnv = CMakeKitsScanner.VarsForVSInstance(kitInfo.VSInstanceId, kitInfo.VSArch);
         foreach (var item in vsEnv)
         {
             envVars[item.Key] = item.Value;
         }
     }
     if (kitInfo.AdditionalPaths != null)
     {
         var pathEnvName       = envVars.ContainsKey("Path") ? "Path" : "PATH";
         var pathSet           = new HashSet <string>(envVars[pathEnvName].Split(PathUtils.PathEnvSeparator));
         var pathsWaitingToAdd = kitInfo.AdditionalPaths.Where(x => !pathSet.Contains(x));
         if (!envVars.ContainsKey(pathEnvName))
         {
             envVars[pathEnvName] = "";
         }
         if (envVars[pathEnvName].EndsWith(PathUtils.PathEnvSeparator.ToString()))
         {
             envVars[pathEnvName] += string.Join("", pathsWaitingToAdd.Select(x => x + PathUtils.PathEnvSeparator));
         }
         else
         {
             envVars[pathEnvName] += string.Join("", pathsWaitingToAdd.Select(x => PathUtils.PathEnvSeparator + x));
         }
     }
 }
Beispiel #2
0
 public static void ScanKits()
 {
     SetKits(CMakeKitsScanner.ScanAllKits());
 }