summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorYousong Zhou <yszhou4tech@gmail.com>2020-10-14 16:04:01 +0800
committerYousong Zhou <yszhou4tech@gmail.com>2020-10-22 10:20:32 +0800
commitced0d5358335304773078066f6f683361bbfd907 (patch)
tree8331ec4aeb1bc0f957f2d0b3e56945edee441ed9 /CMakeLists.txt
parent64ff909328c095749ef6eaed7302b3e024409d2f (diff)
downloadnetifd-ced0d5358335304773078066f6f683361bbfd907.tar.gz
build: find and use libnl header dirs
Name of the libnl .pc file is libnl-3.0.pc This commit is mainly for testing netifd build on usual Linux systems. netifd Makefile in current OpenWrt build system specifies custom cmake flags to directly point to libnl-tiny Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt8
1 files changed, 6 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d6203aa..9d19817 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -27,8 +27,12 @@ SET(LIBS
ubox ubus uci json-c blobmsg_json)
IF (NOT DEFINED LIBNL_LIBS)
- FIND_LIBRARY(libnl NAMES libnl-3 libnl nl-3 nl)
- SET(LIBNL_LIBS ${libnl})
+ include(FindPkgConfig)
+ pkg_search_module(LIBNL libnl-3.0 libnl-3 libnl nl-3 nl)
+ IF (LIBNL_FOUND)
+ include_directories(${LIBNL_INCLUDE_DIRS})
+ SET(LIBNL_LIBS ${LIBNL_LIBRARIES})
+ ENDIF()
ENDIF()
IF("${CMAKE_SYSTEM_NAME}" MATCHES "Linux" AND NOT DUMMY_MODE)