aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBertrand Jacquin <bertrand@jacquin.bzh>2020-05-03 00:48:24 +0100
committerBertrand Jacquin <bertrand@jacquin.bzh>2020-05-03 00:48:24 +0100
commit4029d621150ffef5352953f6f8647958e628a1d1 (patch)
treec52dc12f94b7b4b8ac2e1e0e2a4a07e2d0784a09
parentMerge pull request #6451 (diff)
downloadmonero-dev/beber/pgm.tar.xz
build: rely on pkg-config to find zmqdev/beber/pgm
if zmq was built with libnorm, libproto or libpgm, pkg-config can inform us directly instead of having to find them.
-rw-r--r--CMakeLists.txt24
-rw-r--r--README.md5
-rw-r--r--contrib/brew/Brewfile1
-rw-r--r--contrib/depends/toolchain.cmake.in1
m---------external/trezor-common0
-rw-r--r--src/daemon/CMakeLists.txt2
-rw-r--r--src/net/CMakeLists.txt2
-rw-r--r--src/rpc/CMakeLists.txt2
-rw-r--r--tests/trezor/CMakeLists.txt2
-rw-r--r--tests/unit_tests/CMakeLists.txt2
10 files changed, 10 insertions, 31 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d9ec866e4..3fa781ba3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -49,6 +49,7 @@ message(STATUS "CMake version ${CMAKE_VERSION}")
project(monero)
include(FindCcache) # Has to be included after the project() macro, to be able to read the CXX variable.
+find_package (PkgConfig REQUIRED)
enable_language(C ASM)
@@ -949,30 +950,13 @@ if(CMAKE_C_COMPILER_ID STREQUAL "Clang" AND ARCH_WIDTH EQUAL "32" AND NOT IOS AN
endif()
find_path(ZMQ_INCLUDE_PATH zmq.h)
-find_library(ZMQ_LIB zmq)
-find_library(PGM_LIBRARY pgm)
-find_library(NORM_LIBRARY norm)
-find_library(PROTOLIB_LIBRARY protolib)
-find_library(SODIUM_LIBRARY sodium)
if(NOT ZMQ_INCLUDE_PATH)
message(FATAL_ERROR "Could not find required header zmq.h")
endif()
-if(NOT ZMQ_LIB)
- message(FATAL_ERROR "Could not find required libzmq")
-endif()
-if(PGM_LIBRARY)
- set(ZMQ_LIB "${ZMQ_LIB};${PGM_LIBRARY}")
-endif()
-if(NORM_LIBRARY)
- set(ZMQ_LIB "${ZMQ_LIB};${NORM_LIBRARY}")
-endif()
-if(PROTOLIB_LIBRARY)
- set(ZMQ_LIB "${ZMQ_LIB};${PROTOLIB_LIBRARY}")
-endif()
-if(SODIUM_LIBRARY)
- set(ZMQ_LIB "${ZMQ_LIB};${SODIUM_LIBRARY}")
-endif()
+
+pkg_check_modules(ZMQ REQUIRED zmq)
+pkg_check_modules(SODIUM REQUIRED sodium)
add_subdirectory(contrib)
add_subdirectory(src)
diff --git a/README.md b/README.md
index ce193a034..b0abfcb84 100644
--- a/README.md
+++ b/README.md
@@ -164,8 +164,6 @@ library archives (`.a`).
| Boost | 1.58 | NO | `libboost-all-dev` | `boost` | `boost-devel` | `boost-devel` | NO | C++ libraries |
| OpenSSL | basically any | NO | `libssl-dev` | `openssl` | `libressl-devel` | `openssl-devel` | NO | sha256 sum |
| libzmq | 3.0.0 | NO | `libzmq3-dev` | `zeromq` | `zeromq-devel` | `zeromq-devel` | NO | ZeroMQ library |
-| OpenPGM | ? | NO | `libpgm-dev` | `libpgm` | | `openpgm-devel` | NO | For ZeroMQ |
-| libnorm[2] | ? | NO | `libnorm-dev` | | | | YES | For ZeroMQ |
| libunbound | 1.4.16 | YES | `libunbound-dev` | `unbound` | `unbound-devel` | `unbound-devel` | NO | DNS resolver |
| libsodium | ? | NO | `libsodium-dev` | `libsodium` | `libsodium-devel` | `libsodium-devel` | NO | cryptography |
| libunwind | any | NO | `libunwind8-dev` | `libunwind` | `libunwind-devel` | `libunwind-devel` | YES | Stack traces |
@@ -185,11 +183,10 @@ library archives (`.a`).
[1] On Debian/Ubuntu `libgtest-dev` only includes sources and headers. You must
build the library binary manually. This can be done with the following command ```sudo apt-get install libgtest-dev && cd /usr/src/gtest && sudo cmake . && sudo make && sudo mv libg* /usr/lib/ ```
-[2] libnorm-dev is needed if your zmq library was built with libnorm, and not needed otherwise
Install all dependencies at once on Debian/Ubuntu:
-``` sudo apt update && sudo apt install build-essential cmake pkg-config libboost-all-dev libssl-dev libzmq3-dev libunbound-dev libsodium-dev libunwind8-dev liblzma-dev libreadline6-dev libldns-dev libexpat1-dev doxygen graphviz libpgm-dev qttools5-dev-tools libhidapi-dev libusb-dev libprotobuf-dev protobuf-compiler ```
+``` sudo apt update && sudo apt install build-essential cmake pkg-config libboost-all-dev libssl-dev libzmq3-dev libunbound-dev libsodium-dev libunwind8-dev liblzma-dev libreadline6-dev libldns-dev libexpat1-dev doxygen graphviz qttools5-dev-tools libhidapi-dev libusb-dev libprotobuf-dev protobuf-compiler ```
Install all dependencies at once on macOS with the provided Brewfile:
``` brew update && brew bundle --file=contrib/brew/Brewfile ```
diff --git a/contrib/brew/Brewfile b/contrib/brew/Brewfile
index 1fdf45cfe..8459c41a1 100644
--- a/contrib/brew/Brewfile
+++ b/contrib/brew/Brewfile
@@ -20,7 +20,6 @@ brew "boost"
brew "openssl"
brew "hidapi"
brew "zmq"
-brew "libpgm"
brew "unbound"
brew "libsodium"
brew "miniupnpc"
diff --git a/contrib/depends/toolchain.cmake.in b/contrib/depends/toolchain.cmake.in
index 2634423ab..2a0fb261a 100644
--- a/contrib/depends/toolchain.cmake.in
+++ b/contrib/depends/toolchain.cmake.in
@@ -44,7 +44,6 @@ endif()
endif()
SET(ZMQ_INCLUDE_PATH @prefix@/include)
-SET(ZMQ_LIB @prefix@/lib/libzmq.a)
SET(Boost_IGNORE_SYSTEM_PATH ON)
SET(BOOST_ROOT @prefix@)
diff --git a/external/trezor-common b/external/trezor-common
-Subproject bff7fdfe436c727982cc553bdfb29a9021b423b
+Subproject 31a0073c62738827b48d725facd376687942912
diff --git a/src/daemon/CMakeLists.txt b/src/daemon/CMakeLists.txt
index d9bfd9a20..1d5e3e85c 100644
--- a/src/daemon/CMakeLists.txt
+++ b/src/daemon/CMakeLists.txt
@@ -88,7 +88,7 @@ target_link_libraries(daemon
${Boost_REGEX_LIBRARY}
${Boost_SYSTEM_LIBRARY}
${CMAKE_THREAD_LIBS_INIT}
- ${ZMQ_LIB}
+ ${ZMQ_LIBRARIES}
${GNU_READLINE_LIBRARY}
${EXTRA_LIBRARIES}
${Blocks})
diff --git a/src/net/CMakeLists.txt b/src/net/CMakeLists.txt
index 1ce7118ad..7a87f4d3d 100644
--- a/src/net/CMakeLists.txt
+++ b/src/net/CMakeLists.txt
@@ -32,5 +32,5 @@ set(net_headers dandelionpp.h error.h i2p_address.h parse.h socks.h socks_connec
tor_address.h zmq.h)
monero_add_library(net ${net_sources} ${net_headers})
-target_link_libraries(net common epee ${ZMQ_LIB} ${Boost_ASIO_LIBRARY})
+target_link_libraries(net common epee ${ZMQ_LIBRARIES} ${Boost_ASIO_LIBRARY})
diff --git a/src/rpc/CMakeLists.txt b/src/rpc/CMakeLists.txt
index fe5e5a85b..a6b035a2b 100644
--- a/src/rpc/CMakeLists.txt
+++ b/src/rpc/CMakeLists.txt
@@ -151,7 +151,7 @@ target_link_libraries(daemon_rpc_server
${Boost_REGEX_LIBRARY}
${Boost_SYSTEM_LIBRARY}
${Boost_THREAD_LIBRARY}
- ${ZMQ_LIB}
+ ${ZMQ_LIBRARIES}
${EXTRA_LIBRARIES})
target_include_directories(daemon_rpc_server PUBLIC ${ZMQ_INCLUDE_PATH})
target_include_directories(obj_daemon_rpc_server PUBLIC ${ZMQ_INCLUDE_PATH})
diff --git a/tests/trezor/CMakeLists.txt b/tests/trezor/CMakeLists.txt
index 15ed5668d..60fdb0d11 100644
--- a/tests/trezor/CMakeLists.txt
+++ b/tests/trezor/CMakeLists.txt
@@ -62,7 +62,7 @@ target_link_libraries(trezor_tests
${Boost_FILESYSTEM_LIBRARY}
${Boost_PROGRAM_OPTIONS_LIBRARY}
${Boost_SYSTEM_LIBRARY}
- ${ZMQ_LIB}
+ ${ZMQ_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT}
${EXTRA_LIBRARIES})
diff --git a/tests/unit_tests/CMakeLists.txt b/tests/unit_tests/CMakeLists.txt
index 9c24a5ec7..28349a536 100644
--- a/tests/unit_tests/CMakeLists.txt
+++ b/tests/unit_tests/CMakeLists.txt
@@ -122,7 +122,7 @@ target_link_libraries(unit_tests
${GTEST_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT}
${EXTRA_LIBRARIES}
- ${ZMQ_LIB})
+ ${ZMQ_LIBRARIES})
set_property(TARGET unit_tests
PROPERTY
FOLDER "tests")