Skip to content

Commit

Permalink
Fix wrong Header-only usage message (#1403)
Browse files Browse the repository at this point in the history
* Fix wrong Header-only usage message

* Cherry pick tests from #1405

---------

Co-authored-by: Lily Wang <v-lilywang@microsoft.com>
Co-authored-by: Billy Robert O'Neal III <bion@microsoft.com>
  • Loading branch information
3 people authored May 14, 2024
1 parent 03a25db commit cae13bd
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/share/${PORT}")
file(WRITE "${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright" "license text")
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/include")
file(WRITE "${CURRENT_PACKAGES_DIR}/include/vcpkg-header-only.h" "// header only port")
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"name": "vcpkg-header-only",
"version": "1"
}
10 changes: 9 additions & 1 deletion azure-pipelines/end-to-end-tests-dir/usage.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,25 @@ wrong-pkgconfig provides pkg-config modules:
# Test lib
wrong-pkgconfig
"@,
@"
vcpkg-header-only is header-only and can be used from CMake via:
find_path(VCPKG_HEADER_ONLY_INCLUDE_DIRS "vcpkg-header-only.h")
target_include_directories(main PRIVATE `${VCPKG_HEADER_ONLY_INCLUDE_DIRS})
"@
)

[string[]]$prohibitedUsages = @(
'vcpkg-empty-port provides CMake targets'
'vcpkg-empty-port provides CMake targets',
'vcpkg-header-only provides CMake targets'
)

[string]$usage = Run-VcpkgAndCaptureOutput ($commonArgs + @('install',
'vcpkg-cmake-config-many-targets',
'vcpkg-empty-port',
'vcpkg-explicit-usage',
'vcpkg-header-only',
'vcpkg-hello-world-1',
'vcpkg-hello-world-2',
'wrong-pkgconfig[header-only-good]'
Expand Down
2 changes: 1 addition & 1 deletion src/vcpkg/commands.install.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -981,7 +981,7 @@ namespace vcpkg
msg.append_indent()
.append_raw("find_path(")
.append_raw(name)
.append_raw("_INCLUDE_DIRS \")")
.append_raw("_INCLUDE_DIRS \"")
.append_raw(header_path)
.append_raw("\")\n");
msg.append_indent()
Expand Down

0 comments on commit cae13bd

Please sign in to comment.