diff --git a/azure-pipelines/e2e-ports/overlays/vcpkg-header-only/portfile.cmake b/azure-pipelines/e2e-ports/overlays/vcpkg-header-only/portfile.cmake new file mode 100644 index 0000000000..b6c2c65494 --- /dev/null +++ b/azure-pipelines/e2e-ports/overlays/vcpkg-header-only/portfile.cmake @@ -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") diff --git a/azure-pipelines/e2e-ports/overlays/vcpkg-header-only/vcpkg.json b/azure-pipelines/e2e-ports/overlays/vcpkg-header-only/vcpkg.json new file mode 100644 index 0000000000..44fa328c81 --- /dev/null +++ b/azure-pipelines/e2e-ports/overlays/vcpkg-header-only/vcpkg.json @@ -0,0 +1,4 @@ +{ + "name": "vcpkg-header-only", + "version": "1" +} diff --git a/azure-pipelines/end-to-end-tests-dir/usage.ps1 b/azure-pipelines/end-to-end-tests-dir/usage.ps1 index 428bb0e356..4b6e5e7507 100644 --- a/azure-pipelines/end-to-end-tests-dir/usage.ps1 +++ b/azure-pipelines/end-to-end-tests-dir/usage.ps1 @@ -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]' diff --git a/src/vcpkg/commands.install.cpp b/src/vcpkg/commands.install.cpp index 4e800b5b0c..c512a701cb 100644 --- a/src/vcpkg/commands.install.cpp +++ b/src/vcpkg/commands.install.cpp @@ -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()