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.
<!--e57a25ab6845829454e8d69fc972939a-->
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
<!--006a51241073e994b41acfe9ec718e94-->
For detailed information about the code coverage, see the test coverage report.
<!--021abf342d371248e50ceaed478a90ca-->
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.
<!--174a7506f384e20aa4161008e828411d-->
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.
<!--9cd9c72976c961c55c7acef8f6ba82cd-->
| File | commit 0c4ff18ee9ec91b424ad26d2643e42566aa45e40<br>(master) | commit 6972687ebcfc61a221abae353a9413ae05ab3de3<br>(master and this pull) |
|---|---|---|
| SHA256SUMS.part | 79b358d3fd281b65... |
86f6f29ffd363608... |
| *-aarch64-linux-gnu-debug.tar.gz | 4e496d0eb67133bf... |
7f92803ccfe6a1e2... |
| *-aarch64-linux-gnu.tar.gz | 43490ff6ab9a74e2... |
f066709ba9c66da6... |
| *-arm-linux-gnueabihf-debug.tar.gz | 38c68631f041e4d8... |
395049696fc5d551... |
| *-arm-linux-gnueabihf.tar.gz | a80c39716b285df7... |
674a86bfd56a0615... |
| *-arm64-apple-darwin-unsigned.tar.gz | 59dce49b541dff6d... |
39dba97c3baa0773... |
| *-arm64-apple-darwin-unsigned.zip | acb355306dcbd43c... |
3a074d5d053ce375... |
| *-arm64-apple-darwin.tar.gz | b6fa18bedb7fe497... |
72d0bc011537528d... |
| *-powerpc64-linux-gnu-debug.tar.gz | ab07199c08dcbf3d... |
0fbb1334d6c6bfc9... |
| *-powerpc64-linux-gnu.tar.gz | c93841f69a8a21f2... |
e056685d63380755... |
| *-riscv64-linux-gnu-debug.tar.gz | fa11806d89e9abd7... |
1774f714543645ee... |
| *-riscv64-linux-gnu.tar.gz | 379cad9361252115... |
624cd436a31ea27d... |
| *-x86_64-apple-darwin-unsigned.tar.gz | 03fd8b75278b79c7... |
802749a8076d8e00... |
| *-x86_64-apple-darwin-unsigned.zip | e7f5613fc474ffdb... |
efb528f448453e85... |
| *-x86_64-apple-darwin.tar.gz | 9c1621a91eba759d... |
71d899e39b6db5f2... |
| *-x86_64-linux-gnu-debug.tar.gz | 0aaee8826bab2f2b... |
64dc98411cb72edd... |
| *-x86_64-linux-gnu.tar.gz | 163cb7ffd9eec265... |
9fb277b01f156259... |
| *.tar.gz | 73ef39f7a7c8ccd9... |
4ea166af67ce27af... |
| guix_build.log | 2c42f4ee42e6a171... |
1aad3f2e5974088a... |
| guix_build.log.diff | 204f122ba10d1b04... |
Concept ACK - Tested this (rebased) branch on Alpine, which ships pkg-config files and CMake config files for ZeroMQ.
cmake -B build -DWITH_ZMQ=ON
-- Found ZeroMQ: /usr/lib/cmake/ZeroMQ (found suitable version "4.3.5", minimum required is "4.0.0")
# hide cmake config file
mv /usr/lib/cmake/ZeroMQ/ZeroMQConfig.cmake /usr/lib/cmake/ZeroMQ/ZeroMQConfig.cmake.bk
# cmake -B build -DWITH_ZMQ=ON
-- Found PkgConfig: /usr/bin/pkg-config (found version "2.2.0")
-- 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
Doubtful it matters here, but external libs after internal libs please.
Sure. Reordered.
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.
<!--9cd9c72976c961c55c7acef8f6ba82cd-->
| File | commit 25dacae9c7feb31308271e2fd5a127c1fc230c2f<br>(master) | commit 9f8780af2787fa04343a7e030fb1f2c7b30a3f14<br>(master and this pull) |
|---|---|---|
| SHA256SUMS.part | 6041997bbc9648cf... |
37d8900ea3418636... |
| *-aarch64-linux-gnu-debug.tar.gz | 7304b9aa230d76fe... |
01a97d270c7f4cf1... |
| *-aarch64-linux-gnu.tar.gz | 1918e330fc2d1bde... |
d27c5a489be26bf3... |
| *-arm-linux-gnueabihf-debug.tar.gz | 703cb83d8df6a45a... |
ca0f1336451fcc00... |
| *-arm-linux-gnueabihf.tar.gz | 4697e9c98ee32036... |
e5df353b5e237b1e... |
| *-arm64-apple-darwin-unsigned.tar.gz | 36eba73d508d5052... |
e3de5183c0638bda... |
| *-arm64-apple-darwin-unsigned.zip | 4b6977270075d6f3... |
7026c310657018cc... |
| *-arm64-apple-darwin.tar.gz | c8d152b6de64036b... |
615336fba31e7b3d... |
| *-powerpc64-linux-gnu-debug.tar.gz | b3c4d8dbd5eab86d... |
40b41ac42e183fab... |
| *-powerpc64-linux-gnu.tar.gz | 0f92af123f402198... |
088dea17c7c703ea... |
| *-riscv64-linux-gnu-debug.tar.gz | 29f88d233e6db541... |
e47c1d79c10cec4a... |
| *-riscv64-linux-gnu.tar.gz | a020e875e3930e6a... |
b18599297833a6e1... |
| *-x86_64-apple-darwin-unsigned.tar.gz | 3d52ceb1df3686da... |
ab8854c5106900ff... |
| *-x86_64-apple-darwin-unsigned.zip | 36e470475b1465ea... |
4b01d38bcdd4ec53... |
| *-x86_64-apple-darwin.tar.gz | 570ece0be9bd8b6e... |
0ca586cf54e77c91... |
| *-x86_64-linux-gnu-debug.tar.gz | b9f81a134e954eef... |
a3ed0455b5923298... |
| *-x86_64-linux-gnu.tar.gz | b84dfd15bf8ff367... |
7d2f1e0453b97e58... |
| *.tar.gz | c201dd8c4d071178... |
4f410fbf85609449... |
| guix_build.log | 7eb2873f5063c0f7... |
9820f4256088bcbe... |
| guix_build.log.diff | 70cd71a9b2d340d1... |
My Guix build:
aarch64
fba7e542bc6a35c65a179f9c8cd3ae2b0f8b12cd5895fa255a2d344d576d0215 guix-build-915640e191b6/output/aarch64-linux-gnu/SHA256SUMS.part
c9c1d47120de9a45aa5da1c17cc8f4860f2268bfe413d38e1b6f67ea96bd4f09 guix-build-915640e191b6/output/aarch64-linux-gnu/bitcoin-915640e191b6-aarch64-linux-gnu-debug.tar.gz
c1775debe30e5a28d981720582c5e6f36ea33939169a429edc48c4bb8ebc3688 guix-build-915640e191b6/output/aarch64-linux-gnu/bitcoin-915640e191b6-aarch64-linux-gnu.tar.gz
870a9d4f46ec2906a7d22d904eb53a8d372ce06fe727983a9aadcfe1dbdcc321 guix-build-915640e191b6/output/arm-linux-gnueabihf/SHA256SUMS.part
fb49bbbb404986f23ad231033c07588e2e612960da7da7dcdfcde9b21e3fb7b0 guix-build-915640e191b6/output/arm-linux-gnueabihf/bitcoin-915640e191b6-arm-linux-gnueabihf-debug.tar.gz
07e03402e62f4b9684342563ce40508342c429c546aeecd805a2a1bf645af7a2 guix-build-915640e191b6/output/arm-linux-gnueabihf/bitcoin-915640e191b6-arm-linux-gnueabihf.tar.gz
bddeb0bbd99b437406092f4af1fa630740e20d5e6277982a7858fa22fd245c0a guix-build-915640e191b6/output/arm64-apple-darwin/SHA256SUMS.part
8ddb3b97ff42eecbe27339b1cd8b048273638958f2b68fea4dddff8d28755cd3 guix-build-915640e191b6/output/arm64-apple-darwin/bitcoin-915640e191b6-arm64-apple-darwin-unsigned.tar.gz
78768d58a16d254b27921c4712ef810254bbc206eab72393e9f96661408bdd72 guix-build-915640e191b6/output/arm64-apple-darwin/bitcoin-915640e191b6-arm64-apple-darwin-unsigned.zip
8849c895be879bc199f4f6a3a355e7fdddc67a58e7382c6e930efffb55a43bf8 guix-build-915640e191b6/output/arm64-apple-darwin/bitcoin-915640e191b6-arm64-apple-darwin.tar.gz
24f2fc6a1e2bea8f0ac8e0fe8d566432e7b45d2e26f7367c57ae4230f8fa50e5 guix-build-915640e191b6/output/dist-archive/bitcoin-915640e191b6.tar.gz
067b2cd3e9aaca53592fa87aff972b776d9cf86264cf0ed2dfa40b0fc79492ac guix-build-915640e191b6/output/powerpc64-linux-gnu/SHA256SUMS.part
7fb4f4b24affe6983da95c679ec457ba672e2761757e746eb62aa86dc11ba544 guix-build-915640e191b6/output/powerpc64-linux-gnu/bitcoin-915640e191b6-powerpc64-linux-gnu-debug.tar.gz
3e18c073306b06706496ea61ef7d000b2d6ad4afdfb5d07f33420a68a1d32bf0 guix-build-915640e191b6/output/powerpc64-linux-gnu/bitcoin-915640e191b6-powerpc64-linux-gnu.tar.gz
1fc9c8ce2be07a5a5fed9eaab77af34b4871ee9b89cb89736eea6c16298a1a94 guix-build-915640e191b6/output/riscv64-linux-gnu/SHA256SUMS.part
cf0cb19fe25db0f4112f3d101978fb300f6c81246e7478d42dd16f7dd40d1c88 guix-build-915640e191b6/output/riscv64-linux-gnu/bitcoin-915640e191b6-riscv64-linux-gnu-debug.tar.gz
df415b13cebe01cef4e103e3e2f61616857dcdd377e6e66cb869738e4ea4b564 guix-build-915640e191b6/output/riscv64-linux-gnu/bitcoin-915640e191b6-riscv64-linux-gnu.tar.gz
150cc9e7045b195a8c98de46ba4df3e58e6e2f50dbd1a5d20fc7177d31a3937f guix-build-915640e191b6/output/x86_64-apple-darwin/SHA256SUMS.part
9a788f205cb4dc7eb3dd2063e6370ff3a23eee6b5dfa6a7746d4440784346c2d guix-build-915640e191b6/output/x86_64-apple-darwin/bitcoin-915640e191b6-x86_64-apple-darwin-unsigned.tar.gz
835cd0aba82e6da750e5fb57fb709af179837dd76d8a0e068c3f3138633ba028 guix-build-915640e191b6/output/x86_64-apple-darwin/bitcoin-915640e191b6-x86_64-apple-darwin-unsigned.zip
78d6df9a60ba2472550643b60bcb0195079c12c462311465f5de9705402007aa guix-build-915640e191b6/output/x86_64-apple-darwin/bitcoin-915640e191b6-x86_64-apple-darwin.tar.gz
ab26fbea09dcb24903a477172df90f5ead8a86360d2f6a7cbe63c07e9d021c57 guix-build-915640e191b6/output/x86_64-linux-gnu/SHA256SUMS.part
4b02520278258b4d5bc247e331b5c017dc50608bff99e34bde3436d46309bbb1 guix-build-915640e191b6/output/x86_64-linux-gnu/bitcoin-915640e191b6-x86_64-linux-gnu-debug.tar.gz
151fa5af3c41a3f96e229c8b6bfc040b231e0c88032187eb0ba0a35bb4333536 guix-build-915640e191b6/output/x86_64-linux-gnu/bitcoin-915640e191b6-x86_64-linux-gnu.tar.gz
9e53b6427898c855ed0d62bbb0b183fc06aa2c93620a200dd972010b12343d2c guix-build-915640e191b6/output/x86_64-w64-mingw32/SHA256SUMS.part
9cc6b97058995039799bc7bd9b88418eecc7afc524f23c0595a80030456cb24c guix-build-915640e191b6/output/x86_64-w64-mingw32/bitcoin-915640e191b6-win64-debug.zip
19aade43f2cace1c694f1116124c5b6ec99402d6ed2ac6f30d54dfe90722f85f guix-build-915640e191b6/output/x86_64-w64-mingw32/bitcoin-915640e191b6-win64-setup-unsigned.exe
7dd59a44e17ddf55b7006efc07c82934b5ff3c6ab0b51d451e2407e1e90e0172 guix-build-915640e191b6/output/x86_64-w64-mingw32/bitcoin-915640e191b6-win64-unsigned.tar.gz
e2335ee787414f0331ddd553aafa10107cea7abfb7a4450d396393596624a67e guix-build-915640e191b6/output/x86_64-w64-mingw32/bitcoin-915640e191b6-win64.zip
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.
ACK 915640e191b6a17a245f0502bc399d82a6502ccf
Post-merge ACK 915640e191b6a17a245f0502bc399d82a6502ccf
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.