| 32 | |
| 33 | #if defined(_WIN32) |
| 34 | static void AddVisualStudioPath(std::vector<std::string>& paths, |
| 35 | std::string const& prefix, |
| 36 | unsigned int version, cmGlobalGenerator* gg) |
| 37 | { |
| 38 | // If generating for the VS IDE, use the same instance. |
| 39 | std::string vsloc; |
| 40 | bool found = false; |
| 41 | # ifndef CMAKE_BOOTSTRAP |
| 42 | if (cmHasPrefix(gg->GetName(), prefix)) { |
| 43 | cmGlobalVisualStudioVersionedGenerator* vsgen = |
| 44 | static_cast<cmGlobalVisualStudioVersionedGenerator*>(gg); |
| 45 | if (vsgen->GetVSInstance(vsloc)) { |
| 46 | found = true; |
| 47 | } |
| 48 | } |
| 49 | # endif |
| 50 | |
| 51 | // Otherwise, find a VS instance ourselves. |
| 52 | if (!found) { |
| 53 | cmVSSetupAPIHelper vsSetupAPIHelper(version); |
| 54 | if (vsSetupAPIHelper.GetVSInstanceInfo(vsloc)) { |
| 55 | cmSystemTools::ConvertToUnixSlashes(vsloc); |
| 56 | found = true; |
| 57 | } |
| 58 | } |
| 59 | |
| 60 | if (found) { |
| 61 | cmsys::Glob glob; |
| 62 | glob.SetListDirs(true); |
| 63 | glob.FindFiles(vsloc + "/VC/Tools/MSVC/*"); |
| 64 | for (auto const& vcdir : glob.GetFiles()) { |
| 65 | paths.push_back(vcdir + "/bin/Hostx64/x64"); |
| 66 | paths.push_back(vcdir + "/bin/Hostx86/x64"); |
| 67 | paths.push_back(vcdir + "/bin/Hostx64/x86"); |
| 68 | paths.push_back(vcdir + "/bin/Hostx86/x86"); |
| 69 | } |
| 70 | } |
| 71 | } |
| 72 | |
| 73 | static void AddRegistryPath(std::vector<std::string>& paths, |
| 74 | std::string const& path, cmMakefile* mf) |
no test coverage detected
searching dependent graphs…