From: Jason Gunthorpe <jgg@xxxxxxxxxxxx> We don't want to add Requires.private when not producing static libraries as that causes pkg-config to require the devel packages to be installed to get the private .pc files even though it doesn't need any of the information. Signed-off-by: Jason Gunthorpe <jgg@xxxxxxxxxxxx> --- libibverbs/CMakeLists.txt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/libibverbs/CMakeLists.txt b/libibverbs/CMakeLists.txt index 33e86a409708b0..3e60c808636847 100644 --- a/libibverbs/CMakeLists.txt +++ b/libibverbs/CMakeLists.txt @@ -54,4 +54,11 @@ target_link_libraries(ibverbs LINK_PRIVATE kern-abi ) -rdma_pkg_config("ibverbs" "" "${CMAKE_THREAD_LIBS_INIT}") +if (ENABLE_STATIC) + if (NOT NL_KIND EQUAL 0) + set(REQUIRES "libnl-3.0, libnl-route-3.0") + endif() + rdma_pkg_config("ibverbs" "${REQUIRES}" "${CMAKE_THREAD_LIBS_INIT}") +else() + rdma_pkg_config("ibverbs" "" "${CMAKE_THREAD_LIBS_INIT}") +endif() -- 2.19.1