From e51fa89c2c3cda13804cd9458361efcacb54200a Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 25 Apr 2017 21:07:37 -0700 Subject: `export`: Reorganize export folder to have the same layout as a normal vcpkg enlistment --- toolsrc/src/commands_export.cpp | 39 +++++++++++++++++++++++++-------------- 1 file changed, 25 insertions(+), 14 deletions(-) (limited to 'toolsrc/src/commands_export.cpp') diff --git a/toolsrc/src/commands_export.cpp b/toolsrc/src/commands_export.cpp index 1fff545bf..066565fed 100644 --- a/toolsrc/src/commands_export.cpp +++ b/toolsrc/src/commands_export.cpp @@ -29,10 +29,8 @@ namespace vcpkg::Commands::Export + - - - @@ -280,17 +278,30 @@ namespace vcpkg::Commands::Export } // Copy files needed for integration - fs.copy_file(paths.root / ".vcpkg-root", raw_exported_dir_path / ".vcpkg-root", fs::copy_options::overwrite_existing, ec); - Checks::check_exit(VCPKG_LINE_INFO, !ec); - fs.create_directories(raw_exported_dir_path / "msbuild", ec); - Checks::check_exit(VCPKG_LINE_INFO, !ec); - fs.copy_file(paths.buildsystems / "msbuild" / "applocal.ps1", raw_exported_dir_path / "msbuild" / "applocal.ps1", fs::copy_options::overwrite_existing, ec); - Checks::check_exit(VCPKG_LINE_INFO, !ec); - fs.copy_file(paths.buildsystems / "msbuild" / "vcpkg.targets", raw_exported_dir_path / "msbuild" / "vcpkg.targets", fs::copy_options::overwrite_existing, ec); - Checks::check_exit(VCPKG_LINE_INFO, !ec); - fs.copy_file(paths.buildsystems / "vcpkg.cmake", raw_exported_dir_path / "vcpkg.cmake", fs::copy_options::overwrite_existing, ec); - Checks::check_exit(VCPKG_LINE_INFO, !ec); - const std::string targets_redirect_content = create_targets_redirect("msbuild/vcpkg.targets"); + const std::vector integration_files_relative_to_root = + { + { ".vcpkg-root" }, + { fs::path{ "scripts" } / "buildsystems" / "msbuild" / "applocal.ps1" }, + { fs::path{ "scripts" } / "buildsystems" / "msbuild" / "vcpkg.targets" }, + { fs::path{ "scripts" } / "buildsystems" / "vcpkg.cmake" }, + { fs::path{ "scripts" } / "cmake" / "vcpkg_get_windows_sdk.cmake" }, + { fs::path{ "scripts" } / "cmake" / "vcpkg_get_windows_sdk.cmake" }, + { fs::path{ "scripts" } / "getWindowsSDK.ps1" }, + { fs::path{ "scripts" } / "getProgramFilesPlatformBitness.ps1" }, + }; + + for (const fs::path& file : integration_files_relative_to_root) + { + const fs::path source = paths.root / file; + const fs::path destination = raw_exported_dir_path / file; + fs.create_directories(destination.parent_path(), ec); + Checks::check_exit(VCPKG_LINE_INFO, !ec); + fs.copy_file(source, destination, fs::copy_options::overwrite_existing, ec); + Checks::check_exit(VCPKG_LINE_INFO, !ec); + } + + // This file will be placed in "build\native" in the nuget package. Therefore, go up two dirs. + const std::string targets_redirect_content = create_targets_redirect("../../scripts/buildsystems/msbuild/vcpkg.targets"); const fs::path targets_redirect = raw_exported_dir_path / "vcpkg.targets"; fs.write_contents(targets_redirect, targets_redirect_content); Checks::check_exit(VCPKG_LINE_INFO, !ec); -- cgit v1.2.3