diff options
| author | Alexander Karatarakis <alkarata@microsoft.com> | 2017-05-02 17:33:59 -0700 |
|---|---|---|
| committer | Alexander Karatarakis <alkarata@microsoft.com> | 2017-05-02 17:33:59 -0700 |
| commit | b6983c36f9ce136f093b3e811d4392450a7bcd2e (patch) | |
| tree | 29a4fa8cd9f6b97e534942d2423dbd522200d32f /toolsrc/src/commands_export.cpp | |
| parent | 84d02232f64034e6b711edfdf060720f351fa137 (diff) | |
| download | vcpkg-b6983c36f9ce136f093b3e811d4392450a7bcd2e.tar.gz vcpkg-b6983c36f9ce136f093b3e811d4392450a7bcd2e.zip | |
`export`: --zip/--7zip/--raw now provides next-step instructions
Diffstat (limited to 'toolsrc/src/commands_export.cpp')
| -rw-r--r-- | toolsrc/src/commands_export.cpp | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/toolsrc/src/commands_export.cpp b/toolsrc/src/commands_export.cpp index b2ea91765..98bf00777 100644 --- a/toolsrc/src/commands_export.cpp +++ b/toolsrc/src/commands_export.cpp @@ -325,10 +325,23 @@ namespace vcpkg::Commands::Export Checks::check_exit(VCPKG_LINE_INFO, !ec); } + auto print_next_step_info = [](const fs::path& prefix) { + const fs::path cmake_toolchain = prefix / "scripts" / "buildsystems" / "vcpkg.cmake"; + const CMakeVariable cmake_variable = + CMakeVariable(L"CMAKE_TOOLCHAIN_FILE", cmake_toolchain.generic_string()); + System::println("\n" + "To use the exported libraries in CMake projects use:" + "\n" + " %s" + "\n", + Strings::utf16_to_utf8(cmake_variable.s)); + }; + if (raw) { System::println( System::Color::success, R"(Files exported at: "%s")", raw_exported_dir_path.generic_string()); + print_next_step_info(export_to_path); } if (nuget) @@ -343,7 +356,8 @@ namespace vcpkg::Commands::Export System::println(R"( With a project open, go to Tools->NuGet Package Manager->Package Manager Console and paste: Install-Package %s -Source "%s" -)", +)" + "\n", nuget_id, output_path.parent_path().u8string()); } @@ -355,6 +369,7 @@ With a project open, go to Tools->NuGet Package Manager->Package Manager Console do_archive_export(paths, raw_exported_dir_path, export_to_path, ArchiveFormatC::ZIP); System::println(System::Color::success, "Creating zip archive... done"); System::println(System::Color::success, "Zip archive exported at: %s", output_path.generic_string()); + print_next_step_info("[...]"); } if (_7zip) @@ -364,6 +379,7 @@ With a project open, go to Tools->NuGet Package Manager->Package Manager Console do_archive_export(paths, raw_exported_dir_path, export_to_path, ArchiveFormatC::_7ZIP); System::println(System::Color::success, "Creating 7zip archive... done"); System::println(System::Color::success, "7zip archive exported at: %s", output_path.generic_string()); + print_next_step_info("[...]"); } if (!raw) |
