diff options
-rw-r--r-- | Modules/BundleUtilities.cmake | 3 | ||||
-rw-r--r-- | Source/cmVSSetupHelper.cxx | 9 |
2 files changed, 12 insertions, 0 deletions
diff --git a/Modules/BundleUtilities.cmake b/Modules/BundleUtilities.cmake index 613ba1a..89ca918 100644 --- a/Modules/BundleUtilities.cmake +++ b/Modules/BundleUtilities.cmake @@ -720,6 +720,9 @@ function(link_resolved_item_into_bundle resolved_item resolved_embedded_item) else() get_filename_component(target_dir "${resolved_embedded_item}" DIRECTORY) file(RELATIVE_PATH symlink_target "${target_dir}" "${resolved_item}") + if (NOT EXISTS "${target_dir}") + file(MAKE_DIRECTORY "${target_dir}") + endif() execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink "${symlink_target}" "${resolved_embedded_item}") endif() endfunction() diff --git a/Source/cmVSSetupHelper.cxx b/Source/cmVSSetupHelper.cxx index 22fe007..19c96b3 100644 --- a/Source/cmVSSetupHelper.cxx +++ b/Source/cmVSSetupHelper.cxx @@ -295,6 +295,9 @@ bool cmVSSetupAPIHelper::EnumerateAndChooseVSInstance() return false; } + // FIXME: Add a way for caller to specify other versions. + std::wstring wantVersion = std::to_wstring(15) + L'.'; + SmartCOMPtr<ISetupInstance> instance; while (SUCCEEDED(enumInstances->Next(1, &instance, NULL)) && instance) { SmartCOMPtr<ISetupInstance2> instance2 = NULL; @@ -310,6 +313,12 @@ bool cmVSSetupAPIHelper::EnumerateAndChooseVSInstance() instance = instance2 = NULL; if (isInstalled) { + // We are looking for a specific major version. + if (instanceInfo.Version.size() < wantVersion.size() || + instanceInfo.Version.substr(0, wantVersion.size()) != wantVersion) { + continue; + } + if (!this->SpecifiedVSInstallLocation.empty()) { // We are looking for a specific instance. std::string currentVSLocation = instanceInfo.GetInstallLocation(); |