cmake: Specify Windows plugin path in test_bitcoin-qt property #33865

pull hebasto wants to merge 1 commits into bitcoin:master from hebasto:251112-plugin-path changing 2 files +8 −6
  1. hebasto commented at 7:10 pm on November 12, 2025: member

    This PR simplifies testing on Windows by removing the need to set the QT_PLUGIN_PATH environment variable for different build configurations. For example, the paths might otherwise be:

    • C:/Users/hebasto/dev/bitcoin/build/vcpkg_installed/x64-windows/Qt6/plugins/ for “Release”
    • C:/Users/hebasto/dev/bitcoin/build/vcpkg_installed/x64-windows/debug/Qt6/plugins/ for “Debug”
  2. cmake: Specify Windows plugin path in `test_bitcoin-qt` property 0dd8d5c237
  3. hebasto added the label Windows on Nov 12, 2025
  4. hebasto added the label Build system on Nov 12, 2025
  5. hebasto added the label Tests on Nov 12, 2025
  6. DrahtBot commented at 7:10 pm on November 12, 2025: contributor

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    Code Coverage & Benchmarks

    For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/33865.

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK purpleKarrot

    If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

  7. hebasto commented at 8:14 pm on November 12, 2025: member
    Friendly ping @purpleKarrot :)
  8. in src/qt/test/CMakeLists.txt:43 in 0dd8d5c237
    39@@ -40,11 +40,15 @@ add_test(NAME test_bitcoin-qt
    40   COMMAND test_bitcoin-qt
    41 )
    42 if(WIN32 AND VCPKG_TARGET_TRIPLET)
    43-  # On Windows, vcpkg configures Qt with `-opengl dynamic`, which makes
    44-  # the "minimal" platform plugin unusable due to internal Qt bugs.
    45-  set_tests_properties(test_bitcoin-qt PROPERTIES
    46-    ENVIRONMENT "QT_QPA_PLATFORM=windows"
    47+  set(plugin_path "$<SHELL_PATH:$<PATH:GET_PARENT_PATH,$<PATH:GET_PARENT_PATH,$<TARGET_PROPERTY:Qt6::QWindowsIntegrationPlugin,LOCATION_$<CONFIG>>>>>")
    


    purpleKarrot commented at 8:25 pm on November 12, 2025:

    I think the _$<CONFIG> part is unnecessary, because the value of the LOCATION property is already config dependent.

    $<PATH:GET_*,...> requires CMake version 3.24.


    hebasto commented at 10:12 pm on November 12, 2025:

    I think the _$<CONFIG> part is unnecessary, because the value of the LOCATION property is already config dependent.

    Are you sure about that? I tested your suggestion, and it returns the path to the “Release” plugin when building with --config Debug.

    $<PATH:GET_*,...> requires CMake version 3.24.

    I think it’s safe, as the version of CMake shipped with Visual Studio was updated to 3.24.1 starting from version 17.4. The current minimum required Visual Studio version is 17.13. And this code is reachable only on Windows with vcpkg.


    purpleKarrot commented at 4:06 pm on November 15, 2025:

    it returns the path to the “Release” plugin when building with --config Debug.

    Interesting. I put that in my backlog. Low priority, because your approach is working. I just want to know why the LOCATION property is not set correctly.

  9. Sammie05 commented at 11:36 pm on November 13, 2025: none

    Tested on Windows and the Qt test runs successfully without requiring manual QT_PLUGIN_PATH environment setup.

    Approved

  10. purpleKarrot commented at 4:03 pm on November 15, 2025: contributor
    ACK 0dd8d5c237e2fdb0168d9ca644e7f2f5a8b6ed72
  11. hebasto merged this on Nov 15, 2025
  12. hebasto closed this on Nov 15, 2025

  13. yuvicc referenced this in commit f620a2206b on Nov 16, 2025
  14. hebasto deleted the branch on Nov 20, 2025

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2025-12-06 09:13 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me