This PR introduces the FindZeroMQ
module, which first attempts to find the libzmq
library using CMake’s find_package()
and falls back to pkg_check_modules()
if unsuccessful.
Addresses #30876 for the ZeroMQ package.
FindZeroMQ
module
#30903
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
For detailed information about the code coverage, see the test coverage report.
See the guideline for information on the review process.
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.
Reviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.
Concept ACK - Tested this (rebased) branch on Alpine, which ships pkg-config files and CMake config files for ZeroMQ.
0cmake -B build -DWITH_ZMQ=ON
1-- Found ZeroMQ: /usr/lib/cmake/ZeroMQ (found suitable version "4.3.5", minimum required is "4.0.0")
2
3# hide cmake config file
4mv /usr/lib/cmake/ZeroMQ/ZeroMQConfig.cmake /usr/lib/cmake/ZeroMQ/ZeroMQConfig.cmake.bk
5
6# cmake -B build -DWITH_ZMQ=ON
7-- Found PkgConfig: /usr/bin/pkg-config (found version "2.2.0")
8-- Found ZeroMQ: /usr/lib (found suitable version "4.3.5", minimum required is "4.0.0")
Concept ACK and quick review ACK.
Tested with depends and verified that the fallback isn’t used: https://github.com/theuni/bitcoin/commit/d98c76c69e01ddacc79974fef6f7fd0f9df5ddcc @hebasto want to pull that in here?
16- $<$<AND:$<PLATFORM_ID:Windows>,$<CXX_COMPILER_ID:GNU>>:ZMQ_STATIC>
17 )
18 target_link_libraries(bitcoin_zmq
19 PRIVATE
20 core_interface
21+ zeromq
Concept ACK and quick review ACK.
Tested with depends and verified that the fallback isn’t used: theuni@d98c76c
@hebasto want to pull that in here?
Thanks! Pulled in.
My Guix build:
0aarch64
1fba7e542bc6a35c65a179f9c8cd3ae2b0f8b12cd5895fa255a2d344d576d0215 guix-build-915640e191b6/output/aarch64-linux-gnu/SHA256SUMS.part
2c9c1d47120de9a45aa5da1c17cc8f4860f2268bfe413d38e1b6f67ea96bd4f09 guix-build-915640e191b6/output/aarch64-linux-gnu/bitcoin-915640e191b6-aarch64-linux-gnu-debug.tar.gz
3c1775debe30e5a28d981720582c5e6f36ea33939169a429edc48c4bb8ebc3688 guix-build-915640e191b6/output/aarch64-linux-gnu/bitcoin-915640e191b6-aarch64-linux-gnu.tar.gz
4870a9d4f46ec2906a7d22d904eb53a8d372ce06fe727983a9aadcfe1dbdcc321 guix-build-915640e191b6/output/arm-linux-gnueabihf/SHA256SUMS.part
5fb49bbbb404986f23ad231033c07588e2e612960da7da7dcdfcde9b21e3fb7b0 guix-build-915640e191b6/output/arm-linux-gnueabihf/bitcoin-915640e191b6-arm-linux-gnueabihf-debug.tar.gz
607e03402e62f4b9684342563ce40508342c429c546aeecd805a2a1bf645af7a2 guix-build-915640e191b6/output/arm-linux-gnueabihf/bitcoin-915640e191b6-arm-linux-gnueabihf.tar.gz
7bddeb0bbd99b437406092f4af1fa630740e20d5e6277982a7858fa22fd245c0a guix-build-915640e191b6/output/arm64-apple-darwin/SHA256SUMS.part
88ddb3b97ff42eecbe27339b1cd8b048273638958f2b68fea4dddff8d28755cd3 guix-build-915640e191b6/output/arm64-apple-darwin/bitcoin-915640e191b6-arm64-apple-darwin-unsigned.tar.gz
978768d58a16d254b27921c4712ef810254bbc206eab72393e9f96661408bdd72 guix-build-915640e191b6/output/arm64-apple-darwin/bitcoin-915640e191b6-arm64-apple-darwin-unsigned.zip
108849c895be879bc199f4f6a3a355e7fdddc67a58e7382c6e930efffb55a43bf8 guix-build-915640e191b6/output/arm64-apple-darwin/bitcoin-915640e191b6-arm64-apple-darwin.tar.gz
1124f2fc6a1e2bea8f0ac8e0fe8d566432e7b45d2e26f7367c57ae4230f8fa50e5 guix-build-915640e191b6/output/dist-archive/bitcoin-915640e191b6.tar.gz
12067b2cd3e9aaca53592fa87aff972b776d9cf86264cf0ed2dfa40b0fc79492ac guix-build-915640e191b6/output/powerpc64-linux-gnu/SHA256SUMS.part
137fb4f4b24affe6983da95c679ec457ba672e2761757e746eb62aa86dc11ba544 guix-build-915640e191b6/output/powerpc64-linux-gnu/bitcoin-915640e191b6-powerpc64-linux-gnu-debug.tar.gz
143e18c073306b06706496ea61ef7d000b2d6ad4afdfb5d07f33420a68a1d32bf0 guix-build-915640e191b6/output/powerpc64-linux-gnu/bitcoin-915640e191b6-powerpc64-linux-gnu.tar.gz
151fc9c8ce2be07a5a5fed9eaab77af34b4871ee9b89cb89736eea6c16298a1a94 guix-build-915640e191b6/output/riscv64-linux-gnu/SHA256SUMS.part
16cf0cb19fe25db0f4112f3d101978fb300f6c81246e7478d42dd16f7dd40d1c88 guix-build-915640e191b6/output/riscv64-linux-gnu/bitcoin-915640e191b6-riscv64-linux-gnu-debug.tar.gz
17df415b13cebe01cef4e103e3e2f61616857dcdd377e6e66cb869738e4ea4b564 guix-build-915640e191b6/output/riscv64-linux-gnu/bitcoin-915640e191b6-riscv64-linux-gnu.tar.gz
18150cc9e7045b195a8c98de46ba4df3e58e6e2f50dbd1a5d20fc7177d31a3937f guix-build-915640e191b6/output/x86_64-apple-darwin/SHA256SUMS.part
199a788f205cb4dc7eb3dd2063e6370ff3a23eee6b5dfa6a7746d4440784346c2d guix-build-915640e191b6/output/x86_64-apple-darwin/bitcoin-915640e191b6-x86_64-apple-darwin-unsigned.tar.gz
20835cd0aba82e6da750e5fb57fb709af179837dd76d8a0e068c3f3138633ba028 guix-build-915640e191b6/output/x86_64-apple-darwin/bitcoin-915640e191b6-x86_64-apple-darwin-unsigned.zip
2178d6df9a60ba2472550643b60bcb0195079c12c462311465f5de9705402007aa guix-build-915640e191b6/output/x86_64-apple-darwin/bitcoin-915640e191b6-x86_64-apple-darwin.tar.gz
22ab26fbea09dcb24903a477172df90f5ead8a86360d2f6a7cbe63c07e9d021c57 guix-build-915640e191b6/output/x86_64-linux-gnu/SHA256SUMS.part
234b02520278258b4d5bc247e331b5c017dc50608bff99e34bde3436d46309bbb1 guix-build-915640e191b6/output/x86_64-linux-gnu/bitcoin-915640e191b6-x86_64-linux-gnu-debug.tar.gz
24151fa5af3c41a3f96e229c8b6bfc040b231e0c88032187eb0ba0a35bb4333536 guix-build-915640e191b6/output/x86_64-linux-gnu/bitcoin-915640e191b6-x86_64-linux-gnu.tar.gz
259e53b6427898c855ed0d62bbb0b183fc06aa2c93620a200dd972010b12343d2c guix-build-915640e191b6/output/x86_64-w64-mingw32/SHA256SUMS.part
269cc6b97058995039799bc7bd9b88418eecc7afc524f23c0595a80030456cb24c guix-build-915640e191b6/output/x86_64-w64-mingw32/bitcoin-915640e191b6-win64-debug.zip
2719aade43f2cace1c694f1116124c5b6ec99402d6ed2ac6f30d54dfe90722f85f guix-build-915640e191b6/output/x86_64-w64-mingw32/bitcoin-915640e191b6-win64-setup-unsigned.exe
287dd59a44e17ddf55b7006efc07c82934b5ff3c6ab0b51d451e2407e1e90e0172 guix-build-915640e191b6/output/x86_64-w64-mingw32/bitcoin-915640e191b6-win64-unsigned.tar.gz
29e2335ee787414f0331ddd553aafa10107cea7abfb7a4450d396393596624a67e guix-build-915640e191b6/output/x86_64-w64-mingw32/bitcoin-915640e191b6-win64.zip
vcpkg
. At that point, we’d likely be able to dump pkg-config for the depends path entirely.
We should also follow up with refactoring the libevent module, to more generically use CMake/pkg-config, rather than restricting the CMake usage to
vcpkg
. At that point, we’d likely be able to dump pkg-config for the depends path entirely.
Done in #31181.