-
Notifications
You must be signed in to change notification settings - Fork 269
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge bitcoin/bitcoin#30903: cmake: Add
FindZeroMQ
module
915640e depends: zeromq: don't install .pc files and remove patches for them (Cory Fields) 6b8a744 cmake: Add `FindZeroMQ` module (Hennadii Stepanov) Pull request description: 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 bitcoin/bitcoin#30876 for the ZeroMQ package. ACKs for top commit: fanquake: ACK 915640e Tree-SHA512: 2f17bae21be5d3f280a13425d22f5d1b2e23837a8aaf5ec89c433767509de030a42d598b261e102bdb5b860d8ede98013c124c3d25e081e956d4ee3a81b2584f
- Loading branch information
Showing
6 changed files
with
47 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# Copyright (c) 2024-present The Bitcoin Core developers | ||
# Distributed under the MIT software license, see the accompanying | ||
# file COPYING or https://opensource.org/license/mit/. | ||
|
||
#[=======================================================================[ | ||
FindZeroMQ | ||
---------- | ||
Finds the ZeroMQ headers and library. | ||
This is a wrapper around find_package()/pkg_check_modules() commands that: | ||
- facilitates searching in various build environments | ||
- prints a standard log message | ||
#]=======================================================================] | ||
|
||
include(FindPackageHandleStandardArgs) | ||
find_package(ZeroMQ ${ZeroMQ_FIND_VERSION} NO_MODULE QUIET) | ||
if(ZeroMQ_FOUND) | ||
find_package_handle_standard_args(ZeroMQ | ||
REQUIRED_VARS ZeroMQ_DIR | ||
VERSION_VAR ZeroMQ_VERSION | ||
) | ||
if(TARGET libzmq) | ||
add_library(zeromq ALIAS libzmq) | ||
elseif(TARGET libzmq-static) | ||
add_library(zeromq ALIAS libzmq-static) | ||
endif() | ||
mark_as_advanced(ZeroMQ_DIR) | ||
else() | ||
find_package(PkgConfig REQUIRED) | ||
pkg_check_modules(libzmq QUIET | ||
IMPORTED_TARGET | ||
libzmq>=${ZeroMQ_FIND_VERSION} | ||
) | ||
find_package_handle_standard_args(ZeroMQ | ||
REQUIRED_VARS libzmq_LIBRARY_DIRS | ||
VERSION_VAR libzmq_VERSION | ||
) | ||
add_library(zeromq ALIAS PkgConfig::libzmq) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters