cmake: fix libnl issue
[netsniff-ng.git] / src / cmake / modules / FindLibnl.cmake
blobede0b7c2615a5cb09005ddbe6f86cdd280b4a2aa
2 # netsniff-ng - the packet sniffing beast
3 # By Emmanuel Roullit <emmanuel@netsniff-ng.org>
4 # Copyright 2009, 2011 Emmanuel Roullit.
5 # Subject to the GPL, version 2.
8 # Find libnl includes and library. This module defines:
9 #  LIBNL_FOUND       - whether the libnl library was found
10 #  LIBNL_LIBRARIES   - the libnl library
11 #  LIBNL_INCLUDE_DIR - the include path of the libnl library
13 find_library(LIBNL_LIBRARY nl-3)\r
14 find_library(LIBNL_GENL_LIBRARY nl-genl-3)\r
16 message(STATUS LIBNL_LIBRARY=${LIBNL_LIBRARY})\r
17 message(STATUS LIBNL_GENL_LIBRARY=${LIBNL_GENL_LIBRARY})\r
19 set(LIBNL_LIBRARIES ${LIBNL_LIBRARY})\r
20 set(LIBNL_GENL_LIBRARIES ${LIBNL_GENL_LIBRARY})\r
22 find_path(
23   LIBNL_INCLUDE_DIR
24   NAMES netlink/version.h
25   PATH_SUFFIXES include/libnl3
28 include_directories(AFTER ${LIBNL_INCLUDE_DIR})\r
29 message(STATUS LIBNL_INCLUDE_DIR2=${LIBNL_INCLUDE_DIR})\r
31 include(FindPackageHandleStandardArgs)
33 find_package_handle_standard_args(
34    Libnl DEFAULT_MSG\r
35    LIBNL_LIBRARY\r
36    LIBNL_INCLUDE_DIR\r
39 mark_as_advanced(
40    LIBNL_INCLUDE_DIR\r
41    LIBNL_LIBRARY\r