diff options
| author | Robert Schumacher <roschuma@microsoft.com> | 2017-11-16 23:54:55 -0800 |
|---|---|---|
| committer | Robert Schumacher <roschuma@microsoft.com> | 2017-11-16 23:54:55 -0800 |
| commit | 1b2f75be941e9eed5986c10eb99fd6049490daec (patch) | |
| tree | c782bfff26daa96f0aba34ec39e74513330e6cc0 /toolsrc/src | |
| parent | 468e9e70e644eb26258434c9e27e34935eb3e06d (diff) | |
| download | vcpkg-1b2f75be941e9eed5986c10eb99fd6049490daec.tar.gz vcpkg-1b2f75be941e9eed5986c10eb99fd6049490daec.zip | |
[vcpkg] Support \share\<port>\usage to handle libraries which are found through built-in Find Modules.
Diffstat (limited to 'toolsrc/src')
| -rw-r--r-- | toolsrc/src/vcpkg/install.cpp | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/toolsrc/src/vcpkg/install.cpp b/toolsrc/src/vcpkg/install.cpp index cc006811b..f48b04d68 100644 --- a/toolsrc/src/vcpkg/install.cpp +++ b/toolsrc/src/vcpkg/install.cpp @@ -565,6 +565,17 @@ namespace vcpkg::Install auto& fs = paths.get_filesystem(); + auto usage_file = paths.installed / bpgh.spec.triplet().canonical_name() / "share" / bpgh.spec.name() / "usage"; + if (fs.exists(usage_file)) + { + auto maybe_contents = fs.read_contents(usage_file); + if (auto p_contents = maybe_contents.get()) + { + System::println(*p_contents); + } + return; + } + auto files = fs.read_lines(paths.listfile_path(bpgh)); if (auto p_lines = files.get()) { @@ -595,10 +606,10 @@ namespace vcpkg::Install } else if (library_targets.size() <= 4) { - System::println("\nThe package %s provides CMake targets:\n" + System::println("The package %s provides CMake targets:\n" "\n" " find_package(%s REQUIRED)\n" - " target_link_libraries(main PRIVATE %s)", + " target_link_libraries(main PRIVATE %s)\n", bpgh.spec, path.parent_path().filename().u8string(), Strings::join(" ", library_targets)); @@ -607,11 +618,11 @@ namespace vcpkg::Install { auto omitted = library_targets.size() - 4; library_targets.erase(library_targets.begin() + 4, library_targets.end()); - System::println("\nThe package %s provides CMake targets:\n" + System::println("The package %s provides CMake targets:\n" "\n" " find_package(%s REQUIRED)\n" " # Note: %d targets were omitted\n" - " target_link_libraries(main PRIVATE %s)", + " target_link_libraries(main PRIVATE %s)\n", bpgh.spec, path.parent_path().filename().u8string(), omitted, @@ -712,7 +723,7 @@ namespace vcpkg::Install const InstallSummary summary = perform(action_plan, keep_going, paths, status_db); - System::println("\nTotal elapsed time: %s", summary.total_elapsed_time); + System::println("\nTotal elapsed time: %s\n", summary.total_elapsed_time); if (keep_going == KeepGoing::YES) { |
